Mixins / foldkit-mixins-ui

Frame

namespace · packages/mixins-ui/src/frame.ts:1

export * as Frame from './frame.js'

In the guides

Members

Frame.configure

function · packages/mixins-ui/src/frame.ts:94

function configure<const Names extends string = never>(
  config: Presets<FramePreset, Names>,
): {
  readonly view: <Outer>(
    options: FrameView<Outer> & PresetOption<Names>,
    h: HtmlBuilder<Outer>,
  ) => Html
}

The application's own Frame: base for every use, presets chosen at a use, and the call over both.

Frame.FramePreset

type · packages/mixins-ui/src/frame.ts:89

type FramePreset = Pick<FrameView<never>, 'style' | 'headingLevel'> & {
  readonly mixins?: MixinList<never>
}

What a Frame is given once: its look and its heading level.

Frame.FrameSlots

const · packages/mixins-ui/src/frame.ts:14

const FrameSlots: Slots.Contract<{ readonly root: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>; readonly header: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>; readonly title: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>; readonly description: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>; readonly action: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Interactive", readonly [Capability.Capability<"Base", readonly []>]>]>, readonly Slot.EventName[], readonly Slot.AttributeName[], readonly Slot.RequirementName[], boolean>; readonly panels: Slot.UnnamedSlot<Capability.Capability<"Container", readonly [Capability.Capability<"Inte …;

A frame publishes a tray and the panels that sit in it; it owns no state. It is what holds several things that belong together (a few alerts, an accordion's items, a list of rows): a tinted tray with a title and an action above and a note below, and each panel a bordered surface of its own. Draw the parts it has and skip the rest. Reach for a Card when there is one thing to hold.

Frame.FrameView

interface · packages/mixins-ui/src/frame.ts:30

interface FrameView<Message = never> {
  readonly title?: string | undefined
  readonly headingLevel?: 2 | 3 | 4 | 5 | 6 | undefined
  readonly description?: string | undefined
  readonly action?: Html | undefined
  readonly panels: ReadonlyArray<Html>
  readonly footer?: Html | undefined
  readonly style?: NamedStyle<typeof FrameSlots> | undefined
  readonly mixins?: MixinList<Message> | undefined
}

A frame in one call: the regions it has, the panels in it, a style for its slots, and mixins beside the style. No upstream component stands behind it.

Frame.view

function · packages/mixins-ui/src/frame.ts:52

function view<Message = never>(
  options: FrameView<Message>,
  h: HtmlBuilder<Message>,
): Html