-
Notifications
You must be signed in to change notification settings - Fork 118
Open
Labels
component: salt providerstatus: awaiting triageAutomatically added to new issues. Should be removed once they have been triaged.Automatically added to new issues. Should be removed once they have been triaged.type: enhancement 💡New feature or requestNew feature or request
Description
Area
UI Components
The problem
Some site needs to switch density depending on breakpoints, Salt website does this as well. There isn't a straightforward way to implement this at the moment, where density needs to be provided as a prop to SaltProvider but breakpoint can only be accessed inside the provider (e.g., via nested component). It creates unnecessary nesting to implement this feature.
The solution
Add callback to SaltProvider / its useDensity hook to update density, similar to POC for mode in #3237.
Alternatives and examples
Not so ideal implementation with nested component just for a callback: https://stackblitz.com/edit/salt-template-56hpdn?file=App.tsx
Are you a JPMorgan Chase & Co. employee?
- I am an employee of JPMorgan Chase & Co.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
component: salt providerstatus: awaiting triageAutomatically added to new issues. Should be removed once they have been triaged.Automatically added to new issues. Should be removed once they have been triaged.type: enhancement 💡New feature or requestNew feature or request