Use buttons to convey important actions that a user can take on a page, form or dialog. This button library has a wide variety of button types, sizes and states for a range of applications.
This button library has a wide variety of button types, sizes and states for a range of applications. There are many variations, states and types of buttons. However, the examples below represent the most often used types of buttons within an interface at the default size.
<button class="luci-button luci-button--primary"> Primary </button>
<button class="luci-button luci-button--secondary"> Secondary </button>
<button class="luci-button luci-button--primary luci-button--disabled" disabled> Disabled </button>
<button class="luci-button luci-button--primary luci-button--small"> Primary </button>
<button class="luci-button luci-button--secondary luci-button--small"> Secondary </button>
<button class="luci-button luci-button--primary luci-button--small luci-button--disabled" disabled> Disabled </button>
Use primary buttons for the highest-priority action that the user is required to take to complete the task.
<button class="luci-button luci-button--primary"> Default </button>
<button class="luci-button luci-button--primary luci-button--disabled" disabled> Disabled </button>
Use small buttons in settings with limited space, like toolbars, filters and advanced search components. For example, small buttons are often placed above data tables.
<button class="luci-button luci-button--primary luci-button--small"> Default </button>
<button class="luci-button luci-button--primary luci-button--small luci-button--disabled" disabled> Disabled </button>
<button class="luci-button luci-button--primary-on-dark"> Default </button>
<button class="luci-button luci-button--primary-on-dark luci-button--disabled" disabled> Disabled </button>
<button class="luci-button luci-button--primary-on-dark luci-button--small"> Default </button>
<button class="luci-button luci-button--primary-on-dark luci-button--small luci-button--disabled" disabled> Disabled </button>
Use secondary buttons for most non-primary actions throughout an interface such as going back, canceling, resetting and adding or creating an object.
<button class="luci-button luci-button--secondary"> Default </button>
<button class="luci-button luci-button--secondary luci-button--disabled" disabled> Disabled </button>
<button class="luci-button luci-button--secondary luci-button--small"> Default </button>
<button class="luci-button luci-button--secondary luci-button--small luci-button--disabled" disabled> Disabled </button>
Use a split button when there are multiple actions but only one can be chosen. The default value of the split button must be the most likely or common action. Split buttons introduce complexity to the user interface, use only when space is limited.
<div class="luci-button-group">
<button class="luci-button luci-button--primary luci-button--small"> Default </button>
<button class="luci-button luci-button--primary luci-button--small luci-button--with-icons">
<span class="luci-button__inner">
<svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
<use xlink:href="/icons/luci.svg#expand">
</use>
</svg>
</span>
</button>
</div>
<div class="luci-button-group">
<button class="luci-button luci-button--primary luci-button--small luci-button--disabled" disabled> Disabled </button>
<button class="luci-button luci-button--primary luci-button--small luci-button--with-icons luci-button--disabled" disabled>
<span class="luci-button__inner">
<svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
<use xlink:href="/icons/luci.svg#expand">
</use>
</svg>
</span>
</button>
</div>
<div class="luci-button-group">
<button class="luci-button luci-button--secondary luci-button--small"> Default </button>
<button class="luci-button luci-button--secondary luci-button--small luci-button--with-icons">
<span class="luci-button__inner">
<svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
<use xlink:href="/icons/luci.svg#expand">
</use>
</svg>
</span>
</button>
</div>
<div class="luci-button-group">
<button class="luci-button luci-button--secondary luci-button--small luci-button--disabled" disabled> Disabled </button>
<button class="luci-button luci-button--secondary luci-button--small luci-button--with-icons luci-button--disabled" disabled>
<span class="luci-button__inner">
<svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
<use xlink:href="/icons/luci.svg#expand">
</use>
</svg>
</span>
</button>
</div>
Add icons to provide clarification of the button's function. Do not use icons purely for visual interest.
<button class="luci-button luci-button--primary luci-button--with-icons">
<span class="luci-button__inner">
<svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
<use xlink:href="/icons/luci.svg#chat">
</use>
</svg>
<span class="luci-button__text"> Default </span>
</span>
</button>
<button class="luci-button luci-button--primary luci-button--with-icons luci-button--disabled" disabled>
<span class="luci-button__inner">
<svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
<use xlink:href="/icons/luci.svg#chat">
</use>
</svg>
<span class="luci-button__text"> Default </span>
</span>
</button>
<button class="luci-button luci-button--primary luci-button--small luci-button--with-icons">
<span class="luci-button__inner">
<svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
<use xlink:href="/icons/luci.svg#chat">
</use>
</svg>
<span class="luci-button__text"> Default </span>
</span>
</button>
<button class="luci-button luci-button--primary luci-button--small luci-button--with-icons luci-button--disabled" disabled>
<span class="luci-button__inner">
<svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
<use xlink:href="/icons/luci.svg#chat">
</use>
</svg>
<span class="luci-button__text"> Default </span>
</span>
</button>
Icon only buttons are useful when space is constrained and the intent of the icon is well understood or placed in an appropriate context. For example, a common (and appropriate) application of an icon-only button is to trigger a popover component. They can also be used for common actions associated with a content object such as delete or edit.
<button class="luci-button luci-button--icon-only luci-button--primary">
<span class="luci-button__inner">
<svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
<use xlink:href="/icons/luci.svg#add">
</use>
</svg>
</span>
</button>
<button class="luci-button luci-button--icon-only luci-button--primary luci-button--small">
<span class="luci-button__inner">
<svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
<use xlink:href="/icons/luci.svg#add">
</use>
</svg>
</span>
</button>
<button class="luci-button luci-button--icon-only luci-button--flat">
<span class="luci-button__inner">
<svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
<use xlink:href="/icons/luci.svg#add">
</use>
</svg>
</span>
</button>
<button class="luci-button luci-button--icon-only luci-button--flat luci-button--small">
<span class="luci-button__inner">
<svg class="luci-icon luci-button__icon luci-button__icon--left" aria-hidden="true">
<use xlink:href="/icons/luci.svg#add">
</use>
</svg>
</span>
</button>
Refer to the icon-only button group if you need to group a set of actions together within a single container.
role="button"
attribute when using <input type="radio">
or <input type="checkbox">
buttons.aria-pressed="true"
when the button is :checked
and aria-pressed="false"
when it is not :checked
.Class | Applies to | Outcome |
---|---|---|
|
|
Creates a primary button. |
|
|
Creates a secondary button. |
|
|
Creates a primary button for use on dark backgrounds. |
|
|
Creates a button with a smaller font size and padding. |
|
|
Ensures correct vertical alignment between button text and icon(s). |
|
|
Icon only specific padding. |
|
|
Removes background and border. |