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

Add block prop for ButtonGroup for full width #133

Closed
tqwewe opened this issue Mar 7, 2024 · 1 comment · Fixed by #135
Closed

Add block prop for ButtonGroup for full width #133

tqwewe opened this issue Mar 7, 2024 · 1 comment · Fixed by #135
Labels
enhancement New feature or request

Comments

@tqwewe
Copy link
Contributor

tqwewe commented Mar 7, 2024

In a particular use case of mine, I'd like the ButtonGroup component to stretch to full width, with each button child being equal width filling the space.

For example, something similar to:

<div class="flex w-full"> <!-- ButtonGroup -->
    <button class="w-1/3">One</button> <!-- Button -->
    <button class="w-1/3">Two</button> <!-- Button -->
    <button class="w-1/3">Three</button> <!-- Button -->
</div>

From:

view! {
    <ButtonGroup block=true>
        <Button>"One"</Button>
        <Button>"Two"</Button>
        <Button>"Three"</Button>
    </ButtonGroup>
}

Additionally, the ButtonGroup component is missing class and style props, so at this stage I don't even have a way of manually putting class="w-full" on the ButtonGroup sadly.

@luoxiaozero
Copy link
Collaborator

I'll add the class and block attributes later, you can temporarily fix them now with the following method:

use leptos_meta::Style;

view! {
    <div class="my-button">
        <Style>
            ".my-button > .thaw-button-group {
            }
           .my-button > .thaw-button {
            }"
        </Style>
        <ButtonGroup block=true>
            <Button>"One"</Button>
            <Button>"Two"</Button>
            <Button>"Three"</Button>
        </ButtonGroup>
    </div>
}

@luoxiaozero luoxiaozero added the enhancement New feature or request label Mar 8, 2024
@luoxiaozero luoxiaozero linked a pull request Mar 12, 2024 that will close this issue
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.

2 participants