@net-advantage/nabs-ui-stepper
v0.26.0
Published
Reusable stepper control for the Nabs UI library.
Downloads
206
Readme
nabs-ui-stepper
Reusable React stepper control for the Nabs UI library.
Usage
import { Stepper } from "@net-advantage/nabs-ui-stepper";
export function Example() {
return (
<Stepper
stepsPosition="left"
stepsAlignment="center"
stepLabelAlignment="right"
showCenterLine
defaultActiveIndex={0}
onStepChange={(index) => console.log(index)}
>
<Stepper.Steps>
<Stepper.Step index={0} label="Details" icon="🧾" />
<Stepper.Step index={1} label="Review" icon="🔍" />
<Stepper.Step index={2} label="Submit" icon="✅" />
</Stepper.Steps>
<Stepper.ContentSteps>
<Stepper.ContentStep index={0}>Step 0 content</Stepper.ContentStep>
<Stepper.ContentStep index={1}>Step 1 content</Stepper.ContentStep>
<Stepper.ContentStep index={2}>Step 2 content</Stepper.ContentStep>
</Stepper.ContentSteps>
</Stepper>
);
}Props
stepsPositionsupportstop,bottom,left, andright.stepsAlignmentsupportsleft,right,center, andspread.stepLabelAlignmentsupportsleft,right,top, andbottomfor all step labels.showCenterLinetoggles the connector line between steps.activeIndexcontrols the active step.defaultActiveIndexsets the initial uncontrolled step.onStepChangefires with the selected step index.Stepper.Stepsupportsiconfor an optional step icon.
The step index and content step index are matched by the same numeric value.
