Mixins / foldkit-mixins-ui

Label

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

export * as Label from './label.js'

In the guides

Members

Label.LabelSlots

const · packages/mixins-ui/src/label.ts:10

const LabelSlots: Slots.Contract<{
  readonly label: Slot.UnnamedSlot<
    Capability.Capability<
      'Container',
      readonly [
        Capability.Capability<
          'Interactive',
          readonly [Capability.Capability<'Base', readonly []>]
        >,
      ]
    >,
    readonly Slot.EventName[],
    readonly Slot.AttributeName[],
    readonly Slot.RequirementName[],
    boolean
  >
}>

A form label publishes one slot; it owns no state, messages, or bundles. It names a control through for: pass the id FieldAssociation derived, never a second naming scheme beside it.

Label.LabelView

interface · packages/mixins-ui/src/label.ts:18

interface LabelView<Message = never> {
  readonly for: string
  readonly text: string
  readonly style?: NamedStyle<typeof LabelSlots> | undefined
  readonly mixins?: MixinList<Message> | undefined
}

A label in one call: the control it names, its words, a style for its slot, and mixins beside the style. No upstream component stands behind it.

Label.view

function · packages/mixins-ui/src/label.ts:28

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