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

Prop to set line-width #28

Open
sboerrigter opened this issue Jan 31, 2021 · 6 comments
Open

Prop to set line-width #28

sboerrigter opened this issue Jan 31, 2021 · 6 comments
Labels
enhancement New feature or request
Milestone

Comments

@sboerrigter
Copy link

It would be great if there was a prop to set the line width. So something like this:

<Hamburger lineWidth={3} />

Keep up the epic work!! 💪😄

@luukdv
Copy link
Collaborator

luukdv commented Feb 1, 2021

I think you can get pretty far with a combination of the width and distance props, could you elaborate on the design you want to achieve? Just so I can think along about ways to accomplish it, and if a new prop would be suitable. 😁

@sboerrigter
Copy link
Author

I am trying to make this:

Screenshot 2021-02-01 at 13 09 18

The width is 24px and the line-height is 3px. I've tried playing around with the distance prop, but they all result in a line-height of 2px.

Thanks for looking into this!

@luukdv
Copy link
Collaborator

luukdv commented Feb 4, 2021

Yup, the distance prop only controls the distance between the lines.

I've thought about this for a bit, but I'm not sure about adding lineWidth. For example, what would happen if you set both size and lineWidth? They would conflict and the API wouldn't be as dead-simple to reason about as it is now.

My goal is to have a simple burger that's suitable for 90% of the use cases, by setting a size and forgetting about it. When the ability to control every pixel is desirable, something custom-made is probably more suitable.

With something like barWidth ideally you'd want to add barHeight as well, and make sure size takes precedence over one/both of them (or the other way around). It's confusing and the logic would add even more bytes to the component.

Maybe this could be something for the next breaking version (3.0).

@sboerrigter
Copy link
Author

Ok, I understand. Thanks for considering this.

@ms007
Copy link

ms007 commented Jun 6, 2022

I have a case where the customer also wants the line-height to be different (thicker) and so I also lack the ability to customize the line-height.

@z0lo13
Copy link

z0lo13 commented Sep 23, 2022

@ms007 @luukdv

.hamburger-react div div {
      height: 4px !important;
    }

Would be a great Prop To Have
To control both height and width

@cyntler cyntler added this to the v3.0.0 milestone Jul 12, 2023
@cyntler cyntler added the enhancement New feature or request label Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants