mirror of
https://github.com/carbon-design-system/carbon-components-svelte.git
synced 2025-09-14 18:01:06 +00:00
docs(progress-indicator): improve docs
This commit is contained in:
parent
86e8aa8b00
commit
a6da4f1ef0
1 changed files with 17 additions and 5 deletions
|
@ -7,8 +7,12 @@ components: ["ProgressIndicator", "ProgressStep", "ProgressIndicatorSkeleton"]
|
||||||
import Preview from "../../components/Preview.svelte";
|
import Preview from "../../components/Preview.svelte";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
`ProgressIndicator` provides a visual representation of progress through a sequence of steps. It supports horizontal and vertical layouts, step completion states, and interactive navigation.
|
||||||
|
|
||||||
## Default (horizontal)
|
## Default (horizontal)
|
||||||
|
|
||||||
|
Create a horizontal progress indicator with four steps.
|
||||||
|
|
||||||
<ProgressIndicator currentIndex={2}>
|
<ProgressIndicator currentIndex={2}>
|
||||||
<ProgressStep complete
|
<ProgressStep complete
|
||||||
label="Step 1"
|
label="Step 1"
|
||||||
|
@ -30,9 +34,7 @@ components: ["ProgressIndicator", "ProgressStep", "ProgressIndicatorSkeleton"]
|
||||||
|
|
||||||
## Prevent change on click
|
## Prevent change on click
|
||||||
|
|
||||||
By default, clicking any step that is complete will update the current step index.
|
Disable automatic step selection when clicking completed steps.
|
||||||
|
|
||||||
Set `preventChangeOnClick` to `true` to prevent this behavior.
|
|
||||||
|
|
||||||
<ProgressIndicator preventChangeOnClick currentIndex={2}>
|
<ProgressIndicator preventChangeOnClick currentIndex={2}>
|
||||||
<ProgressStep complete
|
<ProgressStep complete
|
||||||
|
@ -55,12 +57,14 @@ Set `preventChangeOnClick` to `true` to prevent this behavior.
|
||||||
|
|
||||||
## Programmatic usage
|
## Programmatic usage
|
||||||
|
|
||||||
When programmatically updating the `currentIndex`, keep in mind that only completed steps should be selectable.
|
Update the current step programmatically while maintaining step completion rules.
|
||||||
|
|
||||||
<FileSource src="/framed/ProgressIndicator/ProgrammaticProgressIndicator" />
|
<FileSource src="/framed/ProgressIndicator/ProgrammaticProgressIndicator" />
|
||||||
|
|
||||||
## Invalid step
|
## Invalid step
|
||||||
|
|
||||||
|
Mark a step as invalid to indicate an error state.
|
||||||
|
|
||||||
<ProgressIndicator>
|
<ProgressIndicator>
|
||||||
<ProgressStep complete
|
<ProgressStep complete
|
||||||
label="Step 1"
|
label="Step 1"
|
||||||
|
@ -78,6 +82,8 @@ When programmatically updating the `currentIndex`, keep in mind that only comple
|
||||||
|
|
||||||
## Disabled steps
|
## Disabled steps
|
||||||
|
|
||||||
|
Disable specific steps to prevent user interaction.
|
||||||
|
|
||||||
<ProgressIndicator>
|
<ProgressIndicator>
|
||||||
<ProgressStep complete
|
<ProgressStep complete
|
||||||
label="Step 1"
|
label="Step 1"
|
||||||
|
@ -95,6 +101,8 @@ When programmatically updating the `currentIndex`, keep in mind that only comple
|
||||||
|
|
||||||
## Spaced-equally
|
## Spaced-equally
|
||||||
|
|
||||||
|
Distribute steps evenly across the available space.
|
||||||
|
|
||||||
<ProgressIndicator spaceEqually>
|
<ProgressIndicator spaceEqually>
|
||||||
<ProgressStep
|
<ProgressStep
|
||||||
label="Really long label"
|
label="Really long label"
|
||||||
|
@ -112,6 +120,8 @@ When programmatically updating the `currentIndex`, keep in mind that only comple
|
||||||
|
|
||||||
## Vertical
|
## Vertical
|
||||||
|
|
||||||
|
Display steps in a vertical layout.
|
||||||
|
|
||||||
<ProgressIndicator vertical>
|
<ProgressIndicator vertical>
|
||||||
<ProgressStep
|
<ProgressStep
|
||||||
label="Really long label"
|
label="Really long label"
|
||||||
|
@ -129,10 +139,12 @@ When programmatically updating the `currentIndex`, keep in mind that only comple
|
||||||
|
|
||||||
## Skeleton
|
## Skeleton
|
||||||
|
|
||||||
Use the `count` prop to specify the number of progress steps to render.
|
Show a loading state with the specified number of steps.
|
||||||
|
|
||||||
<ProgressIndicatorSkeleton />
|
<ProgressIndicatorSkeleton />
|
||||||
|
|
||||||
## Skeleton (vertical)
|
## Skeleton (vertical)
|
||||||
|
|
||||||
|
Show a vertical loading state with the specified number of steps.
|
||||||
|
|
||||||
<ProgressIndicatorSkeleton vertical />
|
<ProgressIndicatorSkeleton vertical />
|
Loading…
Add table
Add a link
Reference in a new issue