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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allowed passing customized icon for completed steps in Stepper #2345

Merged
merged 23 commits into from
Nov 19, 2024

Conversation

smmr-dn
Copy link
Contributor

@smmr-dn smmr-dn commented Nov 18, 2024

Changes

Added a new stepContent prop in the steps array for Stepper component which allows users passing in their customized icon or content to replace the default step number for completed steps.

image

Testing

Added unit tests.

Docs

Added minor changeset. Updated documentation as well as stories for Stepper.

After-PR TODO:

@smmr-dn smmr-dn changed the title Uyen/stepper custom icon Allowed passing customized icon for completed steps in Stepper Nov 18, 2024
@smmr-dn smmr-dn marked this pull request as ready for review November 18, 2024 17:51
@smmr-dn smmr-dn requested a review from a team as a code owner November 18, 2024 17:51
@smmr-dn smmr-dn requested review from mayank99 and r100-stack and removed request for a team November 18, 2024 17:51
Copy link
Contributor

@mayank99 mayank99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM apart from one small comment.

packages/itwinui-react/src/core/Stepper/StepperStep.tsx Outdated Show resolved Hide resolved

By default, each step circle shows the step number. However, users can customize the icon or content displayed for each step in the `Stepper` component by providing the `stepContent` property in each item of the `steps` array.

This property is a function that takes the step index and returns custom content to represent the status of each step. A common use case for this customization is to indicate step completion.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: it no longer takes the step index.

Suggested change
This property is a function that takes the step index and returns custom content to represent the status of each step. A common use case for this customization is to indicate step completion.
This property is a function that returns custom content to represent the status of each step. A common use case for this customization is to indicate step completion.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have made the change.

.changeset/curly-bikes-protect.md Outdated Show resolved Hide resolved
@smmr-dn smmr-dn merged commit d869473 into main Nov 19, 2024
17 of 18 checks passed
@smmr-dn smmr-dn deleted the uyen/stepper-custom-icon branch November 19, 2024 14:27
@imodeljs-admin imodeljs-admin mentioned this pull request Nov 19, 2024
@smmr-dn smmr-dn restored the uyen/stepper-custom-icon branch November 20, 2024 17:44
@smmr-dn smmr-dn deleted the uyen/stepper-custom-icon branch November 20, 2024 18:16
@smmr-dn smmr-dn restored the uyen/stepper-custom-icon branch November 20, 2024 18:46
@smmr-dn smmr-dn deleted the uyen/stepper-custom-icon branch November 20, 2024 18:48
@smmr-dn smmr-dn linked an issue Nov 20, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stepper improvements
3 participants