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

Better way to support density switch on breakpoints #3303

Open
1 task done
origami-z opened this issue Apr 25, 2024 · 0 comments
Open
1 task done

Better way to support density switch on breakpoints #3303

origami-z opened this issue Apr 25, 2024 · 0 comments
Labels
community For issues that have been raised by folks outside the core Salt team component: salt provider status: awaiting triage Automatically added to new issues. Should be removed once they have been triaged. type: enhancement 💡 New feature or request

Comments

@origami-z
Copy link
Contributor

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.
@origami-z origami-z added type: enhancement 💡 New feature or request status: awaiting triage Automatically added to new issues. Should be removed once they have been triaged. community For issues that have been raised by folks outside the core Salt team component: salt provider labels Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community For issues that have been raised by folks outside the core Salt team component: salt provider status: awaiting triage Automatically added to new issues. Should be removed once they have been triaged. type: enhancement 💡 New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant