Latitude ComponentsLibrary 0.1.0

Icon button

An icon-only button for compact actions in toolbars, cards, menus and the player. Use it when the icon is unambiguous and space is tight. Always give it a label, and add a tooltip when the meaning isn't obvious. Rules: UX Elements & Rules → IconButton.

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-icon-button/0.1.0/lat-icon-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-icon-button/0.1.0/lat-icon-button.js (1.3 KB gzipped)
SHA-256a24132c50327adaf4faaaee5ea6e49bba1d4a19a41dc87da039a74d384a05460

The icon goes inside the button, usually as a <lat-icon>, so load that file too.

Permutations

Variants

Dark
Light
<lat-icon-button label="Edit"><lat-icon name="edit"></lat-icon></lat-icon-button>
<lat-icon-button label="Add filter" variant="round"><lat-icon name="add-filter"></lat-icon></lat-icon-button>
<lat-icon-button label="Ask AI" variant="primary"><lat-icon name="ai"></lat-icon></lat-icon-button>
<lat-icon-button label="Delete" variant="danger"><lat-icon name="trash-bin"></lat-icon></lat-icon-button>

Sizes

Dark
Light
<lat-icon-button label="Close" size="sm"><lat-icon name="close"></lat-icon></lat-icon-button>
<lat-icon-button label="Close"><lat-icon name="close"></lat-icon></lat-icon-button>
<lat-icon-button label="Close" size="lg"><lat-icon name="close"></lat-icon></lat-icon-button>

Selected, toggle and disabled

Dark
Light
<lat-icon-button label="Comments" selected><lat-icon name="comments-filled"></lat-icon></lat-icon-button>
<lat-icon-button label="Show heatmap" toggle><lat-icon name="one-touch"></lat-icon></lat-icon-button>
<lat-icon-button label="Edit" disabled><lat-icon name="edit"></lat-icon></lat-icon-button>

Overlay, on video

Dark
<div style="padding: 24px; border-radius: 8px; background: var(--lat-gradient-banner-info)">
  <lat-icon-button label="Play" variant="overlay" size="lg"><lat-icon name="play"></lat-icon></lat-icon-button>
</div>

Attributes

AttributeValuesNotes
labeltextRequired. The button's name for screen readers.
variantdefault, round, primary, danger, overlayOverlay is for use on video.
sizesm (24px), md (32px, default), lg (40px)Small takes a 16px icon; the others 20px.
selectedbooleanShows the selected state and sets aria-pressed.
togglebooleanClicking flips selected and fires change.
disabledboolean