Latitude ComponentsLibrary 0.1.0

Button

Buttons trigger actions. Primary is the one main action in a view or dialog; Secondary is every other action; Ghost is for low-emphasis actions in toolbars and lists. Rules: design system, UX Elements & Rules → Button (R-A8, R-A9).

Add it to a page

Load the pinned file once in your Latitude Site or web page, then use the tag.

<script type="module" src="https://web-components.sites.latd.com/components/lat-button/0.1.0/lat-button.js"></script>

The file is an ES module. It loads Lit, the design-system tokens and the Roobert stylesheet from this catalog once per page, however many components you use.

Version0.1.0
File/components/lat-button/0.1.0/lat-button.js (1.7 KB gzipped)
SHA-256c043bfdb88e4fdcd3dfc2da0916ea4c8603e90bd3935e35ef07b185a458b825f

Permutations

Variants

Dark
Create study Cancel Show all
Light
Create study Cancel Show all
<lat-button variant="primary">Create study</lat-button>
<lat-button>Cancel</lat-button>
<lat-button variant="ghost">Show all</lat-button>

Small and round

Dark
Save Cancel Filters · 3
Light
Save Cancel Filters · 3
<lat-button variant="primary" size="sm">Save</lat-button>
<lat-button size="sm">Cancel</lat-button>
<lat-button shape="round" size="sm">Filters · 3</lat-button>

Danger and warning

Dark
Delete study Remove Reset results
Light
Delete study Remove Reset results
<lat-button variant="primary" intent="danger">Delete study</lat-button>
<lat-button intent="danger">Remove</lat-button>
<lat-button intent="warning">Reset results</lat-button>

Disabled and loading

Dark
Create study Cancel Show all Saving
Light
Create study Cancel Show all Saving
<lat-button variant="primary" disabled>Create study</lat-button>
<lat-button disabled>Cancel</lat-button>
<lat-button variant="ghost" disabled>Show all</lat-button>
<lat-button variant="primary" loading>Saving</lat-button>

In a form

Dark
Submit
Light
Submit
<form onsubmit="event.preventDefault(); this.querySelector('output').value = 'Submitted'">
  <lat-button variant="primary" type="submit">Submit</lat-button>
  <output></output>
</form>

Attributes

AttributeValuesNotes
variantsecondary (default), primary, ghostUse one Primary per area.
intentdefault, danger, warningDanger for destructive actions; Warning (Secondary only) for actions with consequences.
sizemd (default, 40px), sm (32px)Ghost is always 32px.
shapedefault, roundRound for filters and buttons with a counter.
typebutton (default), submit, resetSubmits or resets the form the button is in.
disabledboolean
loadingbooleanShows a spinner in place of the label and ignores clicks. The label is still read by screen readers.