Button

You need buttons in your app. This is how you get them.

bin/rails g quicksilver_ui:affordance button

Buttons already exist in HTML, so let’s not make a component for them. Instead we use affordances to make it simple to style them.

button class: "ui-button ui-button-primary" do
  "Click me!"
end

One of the upsides of affordances is, that we can now style other things as buttons as well. You want a link, that looks like a button? You got it.

a href: "#", class: "ui-button ui-button-primary" do
  "Click me!"
end

What about a submit input? No problem.

input value: "Click me!",
  type: "submit",
  class: "ui-button ui-button-primary"

It all looks the same and it is easy to reason about.

Default

  • Primary

  • Secondary

  • Warning

  • Danger

  • Large

  • Medium

  • Small

  • Extra small