Mixins / foldkit-mixins-ui

Skeleton

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

export * as Skeleton from './skeleton.js'

In the guides

Members

Skeleton.avatarRow

function · packages/mixins-ui/src/skeleton.ts:127

function avatarRow<Message = never>(
  options: Common<Message>,
  h: HtmlBuilder<Message>,
): Html

A circle beside a name and a shorter line: a person, a comment, a notification.

Skeleton.card

function · packages/mixins-ui/src/skeleton.ts:133

function card<Message = never>(
  options: Common<Message>,
  h: HtmlBuilder<Message>,
): Html

A picture over a title and two lines of text.

Skeleton.configure

function · packages/mixins-ui/src/skeleton.ts:162

function configure<const Names extends string = never>(
  config: Presets<SkeletonPreset, Names>,
): {
  readonly view: <Outer>(
    options: SkeletonView<Outer> & PresetOption<Names>,
    h: HtmlBuilder<Outer>,
  ) => Html
  readonly lines: <Outer>(
    options: SkeletonLinesView<Outer> & PresetOption<Names>,
    h: HtmlBuilder<Outer>,
  ) => Html
  readonly avatarRow: <Outer>(
    options: Common<Outer> & PresetOption<Names>,
    h: HtmlBuilder<Outer>,
  ) => Html
  readonly card: <Outer>(
    options: Common<Outer> & PresetOption<Names>,
    h: HtmlBuilder<Outer>,
  ) => Html
  readonly tableRow: <Outer>(
    options: SkeletonTableRowView<Outer> & PresetOption<Names>,
    h: HtmlBuilder<Outer>,
  ) => Html
}

The application's own Skeleton: base for every use, presets chosen at a use with preset, and the call over both. The helpers share the look.

Skeleton.lines

function · packages/mixins-ui/src/skeleton.ts:111

function lines<Message = never>(
  options: SkeletonLinesView<Message>,
  h: HtmlBuilder<Message>,
): Html

Skeleton.SkeletonLinesView

interface · packages/mixins-ui/src/skeleton.ts:107

interface SkeletonLinesView<Message = never> extends Common<Message> {
  readonly lines: number
}

Lines of text, the last one ending early as a paragraph's does.

Skeleton.SkeletonPreset

type · packages/mixins-ui/src/skeleton.ts:156

type SkeletonPreset = Pick<Common<never>, 'style'> & {
  readonly mixins?: MixinList<never>
}

What a Skeleton is given once: its look. Its label is each use's.

Skeleton.SkeletonSlots

const · packages/mixins-ui/src/skeleton.ts:15

const SkeletonSlots: Slots.Contract<{
  readonly bar: 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 group: 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 loading placeholder publishes its bars, and the frame that lays several out as one shape: text lines, an avatar beside two lines, a card, a table row. It owns no state, messages, or bundles. A lone bar, or a frame, is one status named by what it stands in for, or hidden from assistive technology when it names nothing; the bars inside a frame are drawing. A frame carries data-kind, and its bars data-shape (circle, block for a picture) and data-short for a line that ends early, for a style to lay them out; a table row carries --fk-skeleton-columns.

Skeleton.SkeletonTableRowView

interface · packages/mixins-ui/src/skeleton.ts:137

interface SkeletonTableRowView<Message = never> extends Common<Message> {
  readonly columns: number
}

One cell a column, for the rows of a table still loading.

Skeleton.SkeletonView

interface · packages/mixins-ui/src/skeleton.ts:35

interface SkeletonView<Message = never> extends Common<Message> {
  readonly inline?: string | undefined
  readonly block?: string | undefined
}

One bar in one call. No upstream component stands behind it. inline and block are CSS lengths ('8rem', '60%') written as --fk-skeleton-inline and --fk-skeleton-block, which the recipe reads for a lone bar; a bar of a form's input or a list's action has a size of its own.

Skeleton.tableRow

function · packages/mixins-ui/src/skeleton.ts:141

function tableRow<Message = never>(
  options: SkeletonTableRowView<Message>,
  h: HtmlBuilder<Message>,
): Html

Skeleton.view

function · packages/mixins-ui/src/skeleton.ts:54

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