question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature Request] StepIcon should be more customizable

See original GitHub issue

Hello, folks!

I’m having a problem in customize the component StepIcon inside of StepLabel specifically in line 86, component is like this in the last version of material-ui-next (v1.0.0-beta.47):

{icon && (
        <span
          className={classNames(classes.iconContainer, {
            [classes.alternativeLabel]: alternativeLabel,
          })}
        >
          <StepIcon
            completed={completed}
            active={active}
            error={error}
            icon={icon}
            alternativeLabel={alternativeLabel}
          />
        </span>
      )}

This property didn’t permit edit the properties of the icon. Ok, but you will tell me that I can create a custom Icon but I will loss access to the props that is passed through Step, so, my proposal is do something like:

  • add a stepIconProps to edit the props of StepIcon props including access to CSS API through classes prop.
{icon && (
        <span
          className={classNames(classes.iconContainer, {
            [classes.alternativeLabel]: alternativeLabel,
          })}
        >
          <StepIcon
            completed={completed}
            active={active}
            error={error}
            icon={icon}
            alternativeLabel={alternativeLabel}
           {...stepIconProps}
          />
        </span>
      )}
  • Another way is transform this in a callback, so the user can access the icon number that is passed through Step component but is unacessible by the user that is using the component:
{icon && iconCallback(icon, ...other)}

So when you use StepLabel would be:

<StepLabel iconCallback={{ (icon) => {
return (
 <MyCustomStepIcon>{icon}</MyCustomStepIcon>
)
} }} />

Regards,

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
oliviertassinaricommented, May 11, 2018

I’m fine with option two too 😃.

0reactions
svenschaefercommented, Aug 5, 2018

Hi, isn’t this possible with “StepIconProps”: <StepLabel StepIconProps={{ classes: { active: { color: "red" } } }} >

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Feature Request] StepIcon should be more customizable
Hello, folks! I'm having a problem in customize the component StepIcon inside of StepLabel specifically in line 86, component is like this ...
Read more >
Icons in Vuetify VStepper? There's a way | by Greg Muka
In Vuetify, the stepper component is VStepper, and no, it's unfortunately not able to display custom icons (VIcons). There's a feature request ......
Read more >
Step Icon | Free SVG / PNG, Premium Animated GIF / APNG ...
Animations can be customized and applied to single element of icons, making your design subtle and unique comparing to others. Customizable. All icons...
Read more >
Icons - Telerik UI for ASP.NET AJAX - Documentation
Use embedded icons in RadStepper via the icon properties - `Icon` and `SuccessIcon`. Customize the icon element further with the `ClientIconTemplate`.
Read more >
is there an option to change icon for completed step in ...
Simply include an ng-template that defines your custom icon, and indicate which original icon ('edit' or 'done') you're replacing.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found