Skip to content

Button

The class goes on an ordinary <button>. No JavaScript is loaded, and it works the same in every framework.

data-variantUsed for
(omitted)The main action on the page. Use only one.
secondaryAn alternative action next to the main action
ghostLow weight, for toolbars, actions in tables and cards
dangerDeletes, or cannot be undone

disabled exists only on <button>. If the button is an <a>, use aria-disabled="true" and remove href, otherwise Enter follows it. Write role="link" and tabindex="0" alongside, so screen readers still find the link and can say that it is unavailable. See Link.

If you are navigating the user, the element should be an <a> even if it looks like a button. Then right-click, middle-click and “open in new tab” work.

The button text wraps when it has to. A button with a long label, such as “Send the application for housing benefit for the whole of 2026”, would otherwise become wider than the phone, and then the whole page scrolls sideways.

If you need a full-width button, that is the app’s layout:

.form-button {
inline-size: 100%;
}
ClassWhat it is
.lt-buttonThe button. The variant comes from data-variant.
VariableDefault
--lt-button-paddingvar(--lt-spacing-2) var(--lt-spacing-4)
--lt-button-radiusvar(--lt-spacing-1)
--lt-button-border-width1px
--lt-button-font-weightvar(--lt-font-weight-medium)
--lt-button-line-heightvar(--lt-line-height-default)
:root {
--lt-button-radius: 9999px;
}

An example. A button in a table row needs less space than one standing on its own:

The class row-button is yours. The system does not know it, and it works because the variable is inherited down into the button.

The default value follows the --lt-spacing-* scale, so the button stays in step with the rest when you rewrite the scale, step by step. See Customising.

  • <button> performs an action, <a> takes you somewhere else. Choose by what happens, not by how it looks.
  • Inside a <form>, type="submit" is the default. If the button should not submit the form, write type="button".
  • Let the text describe the action: “Delete user” says more than “OK”.
  • Do not use a disabled button as the only explanation of why something cannot be done. Show an error message the user can act on.