Alert

ModifierDaisyUI class
:infoalert-info
:successalert-success
:warningalert-warning
:erroralert-error
:neutralalert-neutral
:primaryalert-primary
:secondaryalert-secondary
:accentalert-accent

# Alert

1
Alert do
2
  exclamation_svg
3
4
  span do
5
    "12 unread messages. Tap to see."
6
  end
7
end

# Info color

1
Alert :info do
2
  exclamation_svg
3
4
  span do
5
    "New software update available."
6
  end
7
end

# Success color

1
Alert :success do
2
  exclamation_svg
3
4
  span do
5
    "Your purchase has been confirmed!"
6
  end
7
end

# Warning color

1
Alert :warning do
2
  exclamation_svg
3
4
  span do
5
    "Warning: Invalid email address!"
6
  end
7
end

# Error color

1
Alert :error do
2
  exclamation_svg
3
4
  span do
5
    "Error! Task failed successfully."
6
  end
7
end

# Alert with buttons

1
Alert do
2
  exclamation_svg
3
4
  span do
5
    "We use cookies for no reason."
6
  end
7
8
  div do
9
    Button :sm do
10
      "Deny"
11
    end
12
13
    Button :sm, :primary do
14
      "Accept"
15
    end
16
  end
17
end

# Alert with title and description

1
Alert class: "shadow-lg" do
2
  exclamation_svg
3
4
  div do
5
    h3 class: "font-bold" do
6
      "New message!"
7
    end
8
9
    div class: "text-xs" do
10
      "You have 1 unread message"
11
    end
12
  end
13
14
  Button :sm do
15
    "See"
16
  end
17
end