-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
BoxControl: Add ability to render custom icon to represent sides #25297
Conversation
This update enhances the BoxControl component to allow for the ability to render a custom icon (a `React.Component`) to represent the selected side. This provides the opportunity for folks to adjust the UI for the icon if they choose to use `BoxControl` for purposes beyond `padding` (the current default implementation).
Size Change: +18 B (0%) Total Size: 1.2 MB
ℹ️ View Unchanged
|
@ItsJonQ Greeeat stuff! Will be checking this out tomorrow |
@ItsJonQ tested in my local project and works well! Extra options that would be cool in the future (for dealing with corners/radius, for example):
I'd be using this today if could (I might try to copy it over into my project, but looks like there are a lot of dependencies), thanks ! |
Another couple of possible improvements for further down the line:
|
I started implementing this the other day only to discover it still hasn't made it into release :( |
I'm going to close out this PR due to inactivity. If you'd like to pick up this work though @rmorse, that would be awesome! |
(GIF above shows the BoxControl icon being rendered with a custom icon (emojis) that represent the selected side)
This update enhances the BoxControl component to allow for the ability to render a custom icon (a
React.Component
) to represent the selected side. This provides the opportunity for folks to adjust the UI for the icon if they choose to useBoxControl
for purposes beyondpadding
(the current default implementation).This idea was originally mentioned here:
#21492
cc'ing @rmorse
How has this been tested?
Easiest way to test right now...
npm run storybook:dev
Types of changes
iconComponent
prop to<BoxControl />
for custom icon renderingChecklist: