qat

Stepper

Stepper. It is copied into your app’s ui/ by qatjs add stepper: the code is yours to edit.

Example

  1. 2Delivery
  2. 3Payment
Example.qx18 lines, 1 reactive nameOpen in the playground
import Button from './ui/button/button.qx'
import Stepper from './ui/stepper/stepper.qx'

export default function Example() {
  let step = state(1)
  return (
    <Stepper
      label="Checkout"
      steps={['Recipient', 'Delivery', 'Payment']}
      current={step}
      navigable
      on:step={(i) => (step = i)}
    />
    <Button on:click={() => (step = Math.min(2, step + 1))}>
      Next step
    </Button>
  )
}
step state

Add it

shell1 line
npx qatjs add stepper

Stepper

As a custom element: <ui-stepper>.

Stepper: props
PropTypeAttribute
stepsstring[]property only
currentnumberyes
labelstringyes
doneLabelstringyes
navigablebooleanyes
Stepper: events
EventDetail
on:stepCustomEvent<number>