Skip to content

Commit 7428dc8

Browse files
pricopmdo
andauthored
Added Complex section to Stepper Docs (twbs#42174)
* Added Complex section I've added a new section called **Complex** to the **Stepper** component to demonstrate how this component can be used in different scenarios. This is possible as part of: twbs#42165 * Slight rephrase to match the rest of the docs Slight rephrase to match the rest of the docs * Updated the badge stepper Updated the badge stepper to better illustrate how a "Complete" progress would work with multi-step "Complete" / "In-progress" / "Pending" statuses. * Added vertical complex stepper example Added vertical complex stepper example * w-100 is not needed for vertical stepper w-100 is not needed for vertical stepper * Revamp --------- Co-authored-by: Mark Otto <markdotto@gmail.com>
1 parent e867fcf commit 7428dc8

3 files changed

Lines changed: 62 additions & 2 deletions

File tree

scss/_stepper.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ $stepper-tokens: defaults(
7171
grid-template-rows: auto;
7272
grid-template-columns: var(--stepper-size) auto;
7373
gap: var(--stepper-text-gap);
74-
align-items: center;
74+
align-items: var(--stepper-align-items, center);
7575
text-decoration: none;
7676

7777
// The counter

site/src/content/docs/components/stepper.mdx

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,67 @@ Wrap your horizontal stepper in a `.stepper-overflow` container to enable horizo
6666
<li class="stepper-item">Finish onboarding</li>
6767
</ol>
6868
</div>`} />
69+
70+
## Complex
71+
72+
Add additional content beyond labels to provide more context within each step, such as descriptions, helper messages, status indicators, or other decorative elements.
73+
74+
<Example code={`<ol class="stepper stepper-vertical">
75+
<li class="stepper-item align-items-start active">
76+
<div class="pt-1">
77+
<div class="fw-semibold">Create</div>
78+
<small class="fg-3">Create an account.</small>
79+
</div>
80+
</li>
81+
<li class="stepper-item align-items-start active">
82+
<div class="pt-1">
83+
<div class="fw-semibold">Confirm</div>
84+
<small class="fg-3">Confirm your email.</small>
85+
</div>
86+
</li>
87+
<li class="stepper-item align-items-start">
88+
<div class="pt-1">
89+
<div class="fw-semibold">Set-up</div>
90+
<small class="fg-3">Configure your profile.</small>
91+
</div>
92+
</li>
93+
<li class="stepper-item align-items-start">
94+
<div class="pt-1">
95+
<div class="fw-semibold">Finish</div>
96+
<small class="fg-3">Welcome aboard!</small>
97+
</div>
98+
</li>
99+
</ol>`} />
100+
101+
Mix with other components, like badges, and our theme helpers to create a more unique steppers.
102+
103+
<Example code={`<ol class="stepper stepper-horizontal w-100">
104+
<li class="stepper-item theme-success active">
105+
<div>
106+
<div>Create account</div>
107+
<div class="badge badge-subtle">Complete</div>
108+
</div>
109+
</li>
110+
<li class="stepper-item theme-success active">
111+
<div>
112+
<div>Confirm email</div>
113+
<div class="badge badge-subtle">Complete</div>
114+
</div>
115+
</li>
116+
<li class="stepper-item theme-primary active">
117+
<div>
118+
<div>Update profile</div>
119+
<div class="badge badge-subtle">In-progress</div>
120+
</div>
121+
</li>
122+
<li class="stepper-item theme-secondary">
123+
<div>
124+
<div>Finish</div>
125+
<div class="badge badge-subtle">Pending</div>
126+
</div>
127+
</li>
128+
</ol>`} />
129+
69130
## Alignment
70131

71132
Use [text alignment utilities]([[docsref:/utilities/text-alignment]]) (because we use `display: inline-grid`) to align the steps. The inline grid arrangement allows us to keep the steps equal width and ensures the connecting lines are rendered correctly.

site/src/types/auto-import.d.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ export declare global {
2424
export const Placeholder: typeof import('@shortcodes/Placeholder.astro').default
2525
export const ResizableExample: typeof import('@shortcodes/ResizableExample.astro').default
2626
export const ScssDocs: typeof import('@shortcodes/ScssDocs.astro').default
27-
export const StepperPlayground: typeof import('@shortcodes/StepperPlayground.astro').default
2827
export const Swatch: typeof import('@shortcodes/Swatch.astro').default
2928
export const Table: typeof import('@shortcodes/Table.astro').default
3029
}

0 commit comments

Comments
 (0)