Skip to content
View Markdown

Stepper ​

A control that increases or decreases a number.

tsx
import { Stepper } from '@satinhq/kit'

Example ​

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

function Example() {
  const [copies, setCopies] = useState(1)

  return (
    <Screen>
      <List id="example">
        <Section>
          <Stepper
            label={`Copies: ${copies}`}
            value={copies}
            onChange={setCopies}
            min={1}
            max={8}
          />
        </Section>
      </List>
    </Screen>
  )
}

Set the range ​

Use min and max to bound the value. At a limit, the corresponding button becomes disabled.

Choose the increment ​

step defaults to 1. Use a different positive step for the unit your field needs.

API ​

Scroll horizontally to read every column.

PropTypeDescription
labelstringThe visible label.
valuenumberThe current value.
onChange(value: number) => voidReceives changes.
min / maxnumberOptional limits.
stepnumberThe increment, 1 by default.

Related: Quick start, List, Screen.

:::

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