Skip to content
Discussion options

You must be logged in to vote

You can keep one button mounted and let CSS measure both labels in the same grid cell. The hidden label still participates in layout, so the cell takes the width of the longer string without adding both widths together.

let logging_in = is_logging_in_signal();

rsx! {
    Button {
        class: "login-button",
        disabled: logging_in,
        onclick: move |_| async move {
            // existing login code
        },

        span { class: "login-button__icon",
            if logging_in {
                SpinnerIcon {}
            } else {
                LogIn { size: 24 }
            }
        }

        span { class: "login-button__label",
            span {
                class: 

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@madsmh
Comment options

Answer selected by madsmh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants