Slot Line
A sentence with one slot that cycles through values. The slot's width glides to each new value, so the rest of the line never jumps.
pixikit.com/docs/app-ui/feedback/slot-line
Customize
Interval2200ms
Loops0
Transition
Playing
Default playing
Pause on hover
Pause when hidden
As
Align
Announce
Props
15| Name | Type | Default | Description |
|---|---|---|---|
template | string | "Syncing {slot} now." | The sentence, with one `{slot}` token where the values go. |
items | SlotItem[] | DEFAULT_ITEMS | The values the slot cycles through. |
rest | SlotItem | None | The value it settles on after `loops` passes, and the only one rendered on the server. Default: the first item. |
interval | number | 2200 | Milliseconds each value stays. |
loops | number | 0 | How many passes through the items before it settles on `rest`; 0 loops forever. |
transition | "rise" | "fade" | "blur" | "rise" | How a value gives way to the next: it rises, fades or blurs. |
playing | boolean | None | Whether it is cycling, when you hold the state. |
defaultPlaying | boolean | true | Whether it cycles at first, when the line holds the state. |
pauseOnHover | boolean | true | Pauses while the pointer is over the line. |
pauseWhenHidden | boolean | true | Pauses while the tab or the line is out of view. |
as | "p" | "span" | "h1" | "h2" | "h3" | "p" | The element the sentence is rendered in. |
align | "start" | "center" | "start" | Where the line sits in its box. |
announce | boolean | false | Announces each new sentence to screen readers. |
onChange | (index: number) => void | None | Called with the index of the value now shown, or -1 when it settles on `rest`. |
className | string | None |