Button
| Modifier | DaisyUI class |
|---|---|
| :no_animation | no-animation |
| :glass | glass |
| :ghost | btn-ghost |
| :link | btn-link |
| :outline | btn-outline |
| :active | btn-active |
| :disabled | btn-disabled |
| :lg | btn-lg |
| :md | btn-md |
| :sm | btn-sm |
| :xs | btn-xs |
| :wide | btn-wide |
| :block | btn-block |
| :circle | btn-circle |
| :square | btn-square |
| :neutral | btn-neutral |
| :primary | btn-primary |
| :secondary | btn-secondary |
| :accent | btn-accent |
| :info | btn-info |
| :success | btn-success |
| :warning | btn-warning |
| :error | btn-error |
# Button
1 Button do 2"Button" 3end
# Buttons with brand colors
1 Button do 2"Button" 3end 4 5 Button :neutral do 6"Neutral" 7end 8 9 Button :primary do 10"Primary" 11end 12 13 Button :secondary do 14"Secondary" 15end 16 17 Button :accent do 18"Accent" 19end 20 21 Button :ghost do 22"Ghost" 23end 24 25 Button :link do 26"Link" 27end
# Active buttons
1 Button :active do 2"Button" 3end 4 5 Button :active, :neutral do 6"Neutral" 7end 8 9 Button :active, :primary do 10"Primary" 11end 12 13 Button :active, :secondary do 14"Secondary" 15end 16 17 Button :active, :accent do 18"Accent" 19end 20 21 Button :active, :ghost do 22"Ghost" 23end 24 25 Button :active, :link do 26"Link" 27end
# Buttons with state colors
1 Button :info do 2"Info" 3end 4 5 Button :success do 6"Success" 7end 8 9 Button :warning do 10"Warning" 11end 12 13 Button :error do 14"Error" 15end
# Outline buttons
1 Button :outline do 2"Default" 3end 4 5 Button :outline, :primary do 6"Primary" 7end 8 9 Button :outline, :secondary do 10"Secondary" 11end 12 13 Button :outline, :accent do 14"Accent" 15end
# Outline buttons with state colors
1 Button :outline, :info do 2"Info" 3end 4 5 Button :outline, :success do 6"Success" 7end 8 9 Button :outline, :warning do 10"Warning" 11end 12 13 Button :outline, :error do 14"Error" 15end
# Button sizes
1 Button :lg do 2"Large" 3end 4 5 Button do 6"Normal" 7end 8 9 Button :sm do 10"Small" 11end 12 13 Button :xs do 14"Tiny" 15end
# Responsive button
1 Button :xs, responsive: {sm: :sm, md: :md, lg: :lg} do 2"Responsive" 3end
# Wide button
1 Button :wide do 2"Wide" 3end
# Glass button
1 Button :glass do 2"Glass button" 3end
# Buttons with different HTML tags
1 Button as: :a, role: :button do 2"Link" 3end 4 5 Button type: :submit do 6"Button" 7end 8 9 Button as: :input, type: :button, value: "Input" 10 Button as: :input, type: :submit, value: "Submit" 11 Button as: :input, type: :radio, aria_label: "Radio" 12 Button as: :input, type: :checkbox, aria_label: "Checkbox" 13 Button as: :input, type: :reset, value: "Reset"
# Disabled buttons
1 Button disabled: true do 2"Disabled using attribute" 3end 4 5 Button :disabled, tabindex: -1, role: :button, aria_disabled: true do 6"Disabled using class name" 7end
# Square button
1 Button :square do 2x_svg 3end 4 5 Button :square, :outline do 6x_svg 7end
# Circle button
1 Button :circle do 2x_svg 3end 4 5 Button :circle, :outline do 6x_svg 7end
# Icon at start
1 Button do 2heart_svg 3 plain "Button" 4end
# Icon at end
1 Button do 2 plain "Button" 3heart_svg 4end
# Button block
1 Button :block do 2"block" 3end
# Button with loading spinner
1 Button :square do 2 Loading :spinner 3end
# Button with loading spinner and text
1 Button do 2 Loading :spinner 3 plain "loading" 4end
# Button without click animation
1 Button :no_animation do 2"I don't have click animation" 3end