Skip to content
View Markdown

Slider ​

A control for choosing a number along a track.

tsx
import { Slider, LabeledContent } from '@satinhq/kit'

Example ​

Full example
tsx
import { useState } from 'react'
import { LabeledContent, List, Screen, Section, Slider } from '@satinhq/kit'

function Example() {
  const [volume, setVolume] = useState(40)

  return (
    <Screen>
      <List id="example">
        <Section>
          <Slider label="Volume" value={volume} onChange={setVolume} min={0} max={100} />
          <LabeledContent label="Volume" value={Math.round(volume)} />
        </Section>
      </List>
    </Screen>
  )
}

Set the range ​

Use min and max for the track bounds. The default range is 0 to 1.

Snap to values ​

Set step to snap values to an increment. Use onEditingChange when you need to distinguish dragging from the settled value.

API ​

Scroll horizontally to read every column.

PropTypeDescription
labelstringThe accessible name.
valuenumberThe current number.
onChange(value: number) => voidReceives changes.
min / maxnumberTrack limits.
stepnumberOptional snapping increment.

Related: Quick start, List, Screen.

:::

Satin runs on the Lumen rendering engine and is open source under the MIT License.