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

Support Breakpoints in sizes Prop #79

Open
AbuSM opened this issue Feb 16, 2025 · 0 comments
Open

Support Breakpoints in sizes Prop #79

AbuSM opened this issue Feb 16, 2025 · 0 comments

Comments

@AbuSM
Copy link

AbuSM commented Feb 16, 2025

Currently, the sizes prop accepts only a single value (e.g., string or number). It would be useful to allow responsive breakpoints where users can define different sizes based on screen widths.

Motivation & Use Case:

  • This would improve responsiveness by allowing different sizes for different screen widths.
  • Many UI libraries (e.g., Chakra UI, Tailwind CSS) support responsive props via objects, and adding this would enhance flexibility.
  • Right now, users have to manually handle media queries, which isn't efficient.

Proposed Solution:
Modify the sizes prop to support both a number and an object for breakpoints, like this:
<Hamburger sizes={{ xs: 12, sm: 18, md: 24, lg: 28, xl: 32 }} />

  • If an object is passed, the component should use breakpoints internally.
  • If a string or number is passed, it should behave as it does now.

Alternatives Considered:

  • Using CSS media queries manually, but this makes the code more complex.
  • Wrapping the component to handle breakpoints externally.

If maintainers approve, I'm happy to contribute to this feature!
Would love feedback on preferred implementation details. 😊

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

No branches or pull requests

1 participant