Skip to content

bug: Alert buttons float left when no icon #4723

Description

@john-ccli

Reproduction URL (Required)

https://play.tailwindcss.com/gL8YUhrH2U

What version of daisyUI are you using?

5.7.27

Which browsers are you seeing the problem on?

All browsers

Describe your issue

First, thank you so much for all the work you do on this library! I've attached a Play, but here's how to reproduce the issue:

When I create an alert without an icon
And I add actions
Then the actions float left
Instead of floating right

The workaround is to add an empty div between the content and the actions, but this seems like a bug.

Activity

  1. github-actions commented on Sep 2, 2026

    @github-actions

    Thank you @john-ccli for reporting issues. It helps daisyUI a lot 💚
    I'll be working on issues one by one. I will help with this one as soon as a I find a solution.
    In the meantime providing more details and reproduction links would be helpful.

  2. pdanpdan commented on Sep 2, 2026

    @pdanpdan
    Contributor

    The design is to let the 2nd element grow (based on the general ideea/design of an alert box with icon | content | actions).
    I don't see an easy way to detect if the second column is content or actions.

    But you can align buttons with tailwind classes (justify-self-end): https://play.tailwindcss.com/opz8lzqqAc
    I removed the button wrapper because it is just one, but the exact same goes for a wrapper.

  3. john-ccli commented on Sep 2, 2026

    @john-ccli
    Author

    The design is to let the 2nd element grow (based on the general ideea/design of an alert box with icon | content | actions). I don't see an easy way to detect if the second column is content or actions.

    But you can align buttons with tailwind classes (justify-self-end): https://play.tailwindcss.com/opz8lzqqAc I removed the button wrapper because it is just one, but the exact same goes for a wrapper.

    That's fair- this could just be a documentation issue then. I was thrown off at first because the documentation shows alert examples where the first element is the content, so I assumed the second element would be the actions.

  4. Rupsa-Karmakar commented on Sep 19, 2026

    @Rupsa-Karmakar

    Hi, I was able to reproduce this using the Tailwind Play link — confirmed the button floats left when there's no icon div. I'd like to work on this as my first contribution. Is it still open?

  5. saadeghi commented on Sep 22, 2026

    @saadeghi
    Owner

    @Rupsa-Karmakar Yes, PRs are welcome 💚
    Please make sure the change will only cover this case and it won't change other behaviors or break existing websites.

  6. added a commit that references this issue on Oct 17, 2026
    b3b60f3
  7. added a commit that references this issue on Nov 12, 2026
    d1c2282
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions