Demos v1
StepIndicator with navigation
Every visited step can be clicked.
<StepIndicatoruse_navigation="true"active_item={1}on_change={({ currentItem }) => {console.log('on_change', currentItem)}}data={[{title: 'Om din nye bolig',},{title: 'Ditt lån og egenkapital',on_click: ({ currentItem }) =>console.log(currentItem)},{title: 'Oppsummering',}]}/>
StepIndicator customized
Completely customized step indicator.
function CustomStepIndicator({ children, ...props }) {const [step, setStep] = React.useState(0)return (<><StepIndicatoruse_navigationactive_item={step}on_change={({ currentItem }) => setStep(currentItem)}{...props}/><Section style_type="lavender" spacing>{children(step)}</Section></>)}render(<CustomStepIndicatordata={[{title: 'First',is_active: true},{title: 'Second',is_active: true},{title: 'Last',is_active: true}]}>{(step) => {switch (step) {case 0:return <>Step One</>case 1:return <>Step Two</>default:return <>Fallback</>}}}</CustomStepIndicator>)
StepIndicator with urls
Using urls for visited steps only.
Default StepIndicator with no navigation
<StepIndicatordata={[{title: 'Om din nye bolig'},{title: 'Ditt lån og egenkapital'},{title: 'Oppsummering',is_current: true}]}/>
Default StepIndicator with strings only
<StepIndicatoractive_item="1"data={['Om din nye bolig','Ditt lån og egenkapital','Oppsummering']}/>
StepIndicator with custom renderer.
<StepIndicatoruse_navigationactive_item={1}on_change={({ currentItem }) => {console.log('on_change', currentItem)}}on_item_render={({ StepItem }) => {return (<StepItemonClick={e => console.log(e)}/>)}}data={[{title: 'Om din nye bolig',},{title: 'Ditt lån og egenkapital',on_click: ({ currentItem }) =>console.log(currentItem),on_render: ({ StepItem, props, params }) => (<StepItemonClick={e => console.log(e)}/>)},{title: 'Oppsummering',/*We can also overwrite the statesis_active: trueis_current: true*/}]}/>