Mixins / foldkit-mixins-ui

SliderView

interface · packages/mixins-ui/src/slider.ts:113

interface SliderView<
  Message,
  Value extends number | Range | ReadonlyArray<number>,
> extends Bounds {
  readonly id: string
  readonly label: string
  readonly value: Value
  readonly onChange: (value: Value) => NoInfer<Message>
  readonly onCommit?: ((value: Value) => NoInfer<Message>) | undefined
  readonly description?: string | undefined
  readonly format?: ((value: number) => string) | undefined
  readonly words?: Partial<SliderWords> | undefined
  readonly marks?: ReadonlyArray<number | Mark> | undefined
  readonly ticks?: boolean | undefined
  readonly orientation?: 'horizontal' | 'vertical' | undefined
  readonly showValue?: boolean | undefined
  readonly name?: string | undefined
  readonly disabled?: boolean | undefined
  readonly style?: NamedStyle<typeof SliderSlots> | undefined
  readonly mixins?: MixinList<Message> | undefined
}

Members

SliderView.id

property · packages/mixins-ui/src/slider.ts:118

readonly id: string

Prefixes the ids the slider draws, unique on the page.

SliderView.label

property · packages/mixins-ui/src/slider.ts:120

readonly label: string

What the slider chooses, shown and naming it.

SliderView.value

property · packages/mixins-ui/src/slider.ts:122

readonly value: Value

Within the bounds and on the step; a range's low at most its high, and a list in order.

SliderView.onChange

property · packages/mixins-ui/src/slider.ts:124

readonly onChange: (value: Value) => NoInfer<Message>

The Message for the next value; its type comes from h.

SliderView.onCommit

property · packages/mixins-ui/src/slider.ts:130

readonly onCommit?: ((value: Value) => NoInfer<Message>) | undefined

Sent once when the reader lets go, with the value then: the native change of the range input, which fires on release after a drag and on each key press, where onChange has sent every step on the way.

SliderView.description

property · packages/mixins-ui/src/slider.ts:132

readonly description?: string | undefined

Said under the slider and read with it: each thumb is described by it.

SliderView.format

property · packages/mixins-ui/src/slider.ts:134

readonly format?: ((value: number) => string) | undefined

How a value reads aloud, as each thumb's aria-valuetext, and as shown; default String.

SliderView.words

property · packages/mixins-ui/src/slider.ts:136

readonly words?: Partial<SliderWords> | undefined

The fixed text; see SliderWords.

SliderView.marks

property · packages/mixins-ui/src/slider.ts:141

readonly marks?: ReadonlyArray<number | Mark> | undefined

Values marked on the track, each drawn with data-filled when the fill covers it; a Mark also writes its label under the track.

SliderView.ticks

property · packages/mixins-ui/src/slider.ts:143

readonly ticks?: boolean | undefined

A dot at every step, as marks would draw each (data-tick); for a few steps, not hundreds.

SliderView.orientation

property · packages/mixins-ui/src/slider.ts:145

readonly orientation?: 'horizontal' | 'vertical' | undefined

Default horizontal. Vertical runs from the bottom up.

SliderView.showValue

property · packages/mixins-ui/src/slider.ts:147

readonly showValue?: boolean | undefined

Draws each thumb's value, formatted, beside it; the recipe's value axis places it.

SliderView.name

property · packages/mixins-ui/src/slider.ts:149

readonly name?: string | undefined

Submits the value under this name; a range submits both, low first.

SliderView.disabled

property · packages/mixins-ui/src/slider.ts:150

readonly disabled?: boolean | undefined

SliderView.style

property · packages/mixins-ui/src/slider.ts:152

readonly style?: NamedStyle<typeof SliderSlots> | undefined

A style of SliderSlots, for the look.

SliderView.mixins

property · packages/mixins-ui/src/slider.ts:154

readonly mixins?: MixinList<Message> | undefined

Mixins beside the style.