Refine Stepper component#42165
Conversation
Smaller track-sizeChanging the The industry standard is As a result, the stepper tracker has been reduced from For reference:
|
Fixed text row for horizontal steppersBecause Furthermore, this also fixes something extremely important. Horizontal steppers will always be fighting for space on more condensed UIs (e.g: half screen container), and if the text is too long, with the old code having a forced height that was matching the bubble's height, the text would not fit, so it would start overflowing outside the container. |
Text alignment on horizontal steppersAdding |
Further improvement ideasOne last thing that perhaps you could change, since I'm not sure how or even if last Current
Even though the first step was "complete" by being marked with the Improvement suggestion (I've photoshopped an example for you to have a look at).
And a few reference images: I'm yet to find one that colors the line on the left side. Let me know what do you think. |
|
Looking great! I'd love to see the examples you have at #42165 (comment) in a new section called Sidebar: we have the |
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
|
I've made a separate PR (#42174) for the Docs. #42165 (comment) - what's your take on this? Do you think it should be changed so that the theme customizes the right side instead of the left side? |
We could always look into gradients for stuff like this too :) |
|
|
|
Yup, forgot to account for gap size when calcualting the width. Fixed 🙃. |
|
True, something like
Perhaps as a future update? |
Since the `--stepper-size` container is customizable, it makes sense for the `font-size` to be as well, when using larger sizes, larger font size may also be required. This also changes the default `font-size` to `-sm` size for the counter inside the bubble. This is the perfect example where if we use the `-sm` variant, it makes the text feel more relaxed inside the bubble.
This further relaxes the component by taking away the attention from the track itself, allowing bubbles and text to be more easily readable at a glance without feeling overcrowded. The industry standard is 1px or 2px at max. As a result, the stepper tracker has been reduced to down to `2px` from `4px` For reference: - Tailwind UI practices `2px` width: https://tailwindcss.com/plus/ui-blocks/application-ui/navigation/progress-bars#component-4b1efed043d1ab5688c705f2e27524f3 - Material UI practices `1px` width: https://material.angular.dev/components/stepper/overview - Preline UI practices `1px` width: https://preline.co/docs/stepper.html - Flowbite UI practices `1px` width: https://flowbite.com/docs/components/stepper/ - ReUI practices `1px` width: https://reui.io/patterns/stepper
This will make the text to always start at the top, regardless of whether other bubbles have a multi-line text or not.
Fixes the horizontal bottom row being fixed in height, causing the spacing between the count bubble and the text not be the same as intended (as the gap dictates), nor as its vertical stepper counterpart. This also fixes the text overflowing outside fixed boundaries, causing it to move in places it shouldn't be.
Fixed RTL mode by making use of logical properties instead of physical ones.
Colored the right side stepper line instead of the left side for active elements. This is the natural way, if I reached the next step, then the edge leading to it should be colored in the color of the completed step.
Fixed stepper width not account for stepper's gap
- Added complex stepper support for vertical steppers. - Added --stepper-text-gap CSS var (customizable spacing between text & bubble) - Fixed text overflow for vertical steppers when the text is too long
Restored 1fr for the rows template. While I believed it looked better before, I'd rather keep the row size across all steps.
|
Rebased and made edits—once tests pass will merge. I've made steppers container-responsive instead of viewport-responsive. Also edited some docs and fixed the linter errors. @pricop You should double check you have the suggested extensions added for linting locally so your CI jobs don't fail for you :). |
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
* 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: #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>



















This PR changes the following on the BS6
steppercomponent:smvariant)I've created a comment for each change, so please bear with me until the end 😅.
New font-size variable and new font-size default
Since the counter bubble is customizable via
--stepper-sizeCSS var, it makes sense for the for a--stepper-font-sizeto be present as well.This also changes the default
font-sizeto-smsize for the counter inside the bubble.This is the perfect example where we should use the
-smvariant, because the progress bar & the bubble are visually supportive elements. It also makes the bubble feel slightly more relaxed.Before

After

While subtle, when inspected on the screen, it makes a world of a difference.