Buttons

Button components with various styles and states using the theme.

Variants#

Solid button variants with their default styling.

<%= primary_button "Primary" %>
<%= secondary_button "Secondary" %>
<%= naked_button "Naked" %>
<%= success_button "Success" %>
<%= warning_button "Warning" %>
<%= danger_button "Danger" %>

Outline Variants#

Outline button variants with transparent backgrounds and colored borders.

<%= outline_primary_button "Outline Primary" %>
<%= outline_success_button "Outline Success" %>
<%= outline_warning_button "Outline Warning" %>
<%= outline_danger_button "Outline Danger" %>

Buttons that render as links when a path is provided.

<%= primary_button "Primary Link", path: "#" %>
<%= secondary_button "Secondary Link", path: "#" %>
<%= naked_button "Naked Link", path: "#" %>
<%= success_button "Success Link", path: "#" %>
<%= warning_button "Warning Link", path: "#" %>
<%= danger_button "Danger Link", path: "#" %>
<%= outline_primary_button "Outline Primary Link", path: "#" %>
<%= outline_success_button "Outline Success Link", path: "#" %>
<%= outline_warning_button "Outline Warning Link", path: "#" %>
<%= outline_danger_button "Outline Danger Link", path: "#" %>

Sizes#

Different button sizes using the size parameter.

<%= primary_button "Small", size: "sm" %>
<%= primary_button "Medium (Default)" %>
<%= primary_button "Large", size: "lg" %>

Disabled#

Disabled state for all button variants.

<%= primary_button "Primary Disabled", disabled: true %>
<%= secondary_button "Secondary Disabled", disabled: true %>
<%= naked_button "Naked Disabled", disabled: true %>
<%= success_button "Success Disabled", disabled: true %>
<%= warning_button "Warning Disabled", disabled: true %>
<%= danger_button "Danger Disabled", disabled: true %>
<%= outline_primary_button "Outline Primary Disabled", disabled: true %>
<%= outline_success_button "Outline Success Disabled", disabled: true %>
<%= outline_warning_button "Outline Warning Disabled", disabled: true %>
<%= outline_danger_button "Outline Danger Disabled", disabled: true %>

Circular Buttons#

Perfect for icon-only actions like toggles and close buttons.

<%= primary_button icon("menu", size: 20), class: "btn-circular" %>
<%= secondary_button icon("x", size: 20), class: "btn-circular" %>
<%= naked_button icon("settings", size: 20), class: "btn-circular" %>
<%= success_button icon("check", size: 20), class: "btn-circular" %>
<%= warning_button icon("triangle-alert", size: 20), class: "btn-circular" %>
<%= danger_button icon("trash", size: 20), class: "btn-circular" %>
<%= outline_primary_button icon("search", size: 20), class: "btn-circular" %>
<%= outline_success_button icon("circle-check", size: 20), class: "btn-circular" %>
<%= outline_danger_button icon("loader", size: 20, spin: true), class: "btn-circular" %>
<%= outline_warning_button icon("info", size: 40), class: "btn-circular" %>

Buttons with Icons#

Buttons with icons and text content using block syntax.

<%= primary_button icon("search") + "Search" %>
<%= secondary_button icon("settings") + "Settings" %>
<%= naked_button icon("info") + "Info" %>
<%= success_button icon("check") + "Save" %>
<%= warning_button icon("triangle-alert") + "Warning" %>
<%= danger_button icon("trash") + "Delete" %>
<%= outline_primary_button icon("user") + "Profile" %>
<%= outline_success_button icon("circle-check") + "Confirm" %>
<%= outline_warning_button icon("info") + "Alert" %>
<%= outline_danger_button icon("loader", spin: true) + "Loading" %>

HTML content#

Buttons with arbitrary content using block syntax.

<%= outline_warning_button do %>
  <p>This is some <strong>HTML</strong> content <%= icon("info", class: "inline") %> in the <code>button</code> body.</p>
<% end %>