Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

add colors example to docs #8346

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
46 changes: 46 additions & 0 deletions website/content/docs/components/stepper/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,52 @@ function Example() {
render(<Example />)
```

## Changing the colors

```jsx manual=true
const steps = [
{ title: 'First', description: 'Contact Info' },
{ title: 'Second', description: 'Date & Time' },
{ title: 'Third', description: 'Select Rooms' },
]

function Example() {
const { activeStep } = useSteps({
index: 1,
count: steps.length,
})

return (
<Stepper index={activeStep} height='400px' gap='0'>
{steps.map((step, index) => (
<Step key={index}>
<StepIndicator sx={{
'[data-status=complete] &': { background: 'purple', borderColor: 'black'},
'[data-status=active] &': { background: 'yellow', borderColor: 'black'},
'[data-status=incomplete] &': { background: 'red', borderColor: 'black'}
>
<StepStatus
complete={<StepIcon />}
incomplete={<StepNumber />}
active={<StepNumber />}
/>
</StepIndicator>

<Box flexShrink='0'>
<StepTitle>{step.title}</StepTitle>
<StepDescription>{step.description}</StepDescription>
</Box>

<StepSeparator _horizontal={{ backgroundColor: 'red' }} />
</Step>
))}
</Stepper>
)
}

render(<Example />)
```

## Changing the size

To change the size of the step indicator, you can pass the `size` prop to the
Expand Down