Core components
The two dozen components most apps need, grouped by task, each with a one-line rule of thumb and a minimal snippet.
Forms and input
Form-associated controls: they submit, reset and validate with a native form.
Button lr-button
Use when: Any action: submit a form, confirm a step, or navigate when given an href.
<script type="module">
import '@aceshooting/lyra-ui/components/lr-button.js';
</script>
<lr-button variant="brand">Save changes</lr-button>
<lr-button appearance="outlined">Cancel</lr-button>
Input lr-input
Use when: Single-line text, email, password, number or search entry with a label and hint.
<script type="module">
import '@aceshooting/lyra-ui/components/lr-input.js';
</script>
<lr-input label="Email" type="email" name="email" placeholder="you@example.com" hint="We never share it." required></lr-input>
Textarea lr-textarea
Use when: Multi-line free text such as a message, description or note.
<script type="module">
import '@aceshooting/lyra-ui/components/lr-textarea.js';
</script>
<lr-textarea label="Message" name="message" rows="3" maxlength="280" with-count></lr-textarea>
Select lr-select
Use when: Pick one (or, with multiple, several) values from a short known list.
<script type="module">
import '@aceshooting/lyra-ui/components/lr-select.js';
import '@aceshooting/lyra-ui/components/lr-option.js';
</script>
<lr-select label="Region" name="region" placeholder="Choose a region">
<lr-option value="eu">Europe</lr-option>
<lr-option value="us">United States</lr-option>
<lr-option value="apac">Asia Pacific</lr-option>
</lr-select>
Checkbox lr-checkbox
Use when: A yes/no choice that takes effect when the form is submitted, like accepting terms.
<script type="module">
import '@aceshooting/lyra-ui/components/lr-checkbox.js';
</script>
<lr-checkbox name="terms" required>I accept the terms</lr-checkbox>
Switch lr-switch
Use when: An on/off setting that reads as a preference rather than a form answer.
<script type="module">
import '@aceshooting/lyra-ui/components/lr-switch.js';
</script>
<lr-switch name="digest" checked>Weekly email digest</lr-switch>
Radio group lr-radio-group
Use when: Exactly one choice from two to five options that should all stay visible.
<script type="module">
import '@aceshooting/lyra-ui/components/lr-radio-group.js';
import '@aceshooting/lyra-ui/components/lr-radio.js';
</script>
<lr-radio-group label="Plan" name="plan" value="team">
<lr-radio value="solo">Solo</lr-radio>
<lr-radio value="team">Team</lr-radio>
<lr-radio value="enterprise">Enterprise</lr-radio>
</lr-radio-group>
Layout and navigation
Shells, surfaces and the wayfinding that holds a page together.
Page lr-page
Use when: The application shell: header, navigation that collapses to a drawer, and main content.
<script type="module">
import '@aceshooting/lyra-ui/components/lr-page.js';
</script>
<lr-page style="block-size: 14rem;">
<strong slot="header" style="padding: 0.75rem 1rem;">Acme</strong>
<nav slot="navigation" style="display: grid; gap: 0.5rem; padding: 1rem;">
<a href="#overview">Overview</a>
<a href="#reports">Reports</a>
</nav>
<p style="padding: 1rem; margin: 0;">Main content</p>
</lr-page>
Card lr-card
Use when: Group related content and actions on one surface.
<script type="module">
import '@aceshooting/lyra-ui/components/lr-card.js';
import '@aceshooting/lyra-ui/components/lr-button.js';
</script>
<lr-card style="max-inline-size: 22rem;">
<strong slot="header">Storage</strong>
You are using 7.2 GB of 10 GB.
<lr-button slot="footer" appearance="outlined">Upgrade</lr-button>
</lr-card>
Tabs lr-tab-group
Use when: Switch between peer views of the same object without leaving the page.
<script type="module">
import '@aceshooting/lyra-ui/components/lr-tab-group.js';
import '@aceshooting/lyra-ui/components/lr-tab.js';
import '@aceshooting/lyra-ui/components/lr-tab-panel.js';
</script>
<lr-tab-group>
<lr-tab panel="general">General</lr-tab>
<lr-tab panel="members">Members</lr-tab>
<lr-tab-panel name="general">Project name, owner and visibility.</lr-tab-panel>
<lr-tab-panel name="members">Invite and manage collaborators.</lr-tab-panel>
</lr-tab-group>
Breadcrumb lr-breadcrumb
Use when: Show where the current page sits in a hierarchy and link back up it.
<script type="module">
import '@aceshooting/lyra-ui/components/lr-breadcrumb.js';
import '@aceshooting/lyra-ui/components/lr-breadcrumb-item.js';
</script>
<lr-breadcrumb label="Location">
<lr-breadcrumb-item href="#projects">Projects</lr-breadcrumb-item>
<lr-breadcrumb-item href="#apollo">Apollo</lr-breadcrumb-item>
<lr-breadcrumb-item current>Settings</lr-breadcrumb-item>
</lr-breadcrumb>
Overlays
Content that opens above the page: modal, side panel, menu and hint.
Dialog lr-dialog
Use when: Interrupt for a decision or a short task that must finish before continuing.
<script type="module">
import '@aceshooting/lyra-ui/components/lr-button.js';
import '@aceshooting/lyra-ui/components/lr-dialog.js';
const dialog = document.getElementById('guide-dialog');
document.getElementById('guide-dialog-open').addEventListener('click', () => dialog.show());
document.getElementById('guide-dialog-confirm').addEventListener('click', () => dialog.close('confirm'));
</script>
<lr-button id="guide-dialog-open">Delete project</lr-button>
<lr-dialog id="guide-dialog" label="Delete project?">
This removes the project and its history.
<lr-button slot="footer" variant="danger" id="guide-dialog-confirm">Delete</lr-button>
</lr-dialog>
Drawer lr-drawer
Use when: Secondary detail or filters that slide in beside the page while keeping context.
<script type="module">
import '@aceshooting/lyra-ui/components/lr-button.js';
import '@aceshooting/lyra-ui/components/lr-drawer.js';
import '@aceshooting/lyra-ui/components/lr-checkbox.js';
const drawer = document.getElementById('guide-drawer');
document.getElementById('guide-drawer-open').addEventListener('click', () => drawer.show());
</script>
<lr-button id="guide-drawer-open" appearance="outlined">Filters</lr-button>
<lr-drawer id="guide-drawer" label="Filters" placement="end">
<lr-checkbox name="open-only" checked>Open items only</lr-checkbox>
</lr-drawer>
Dropdown lr-dropdown
Use when: A short list of actions behind one trigger, such as a row or page menu.
<script type="module">
import '@aceshooting/lyra-ui/components/lr-dropdown.js';
import '@aceshooting/lyra-ui/components/lr-button.js';
import '@aceshooting/lyra-ui/components/lr-dropdown-item.js';
</script>
<lr-dropdown aria-label="Project actions">
<lr-button slot="trigger" with-caret>Actions</lr-button>
<lr-dropdown-item value="rename">Rename</lr-dropdown-item>
<lr-dropdown-item value="duplicate">Duplicate</lr-dropdown-item>
<lr-dropdown-item value="delete" variant="danger">Delete</lr-dropdown-item>
</lr-dropdown>
Tooltip lr-tooltip
Use when: A brief, non-essential hint for a control on hover or keyboard focus.
<script type="module">
import '@aceshooting/lyra-ui/components/lr-tooltip.js';
import '@aceshooting/lyra-ui/components/lr-button.js';
</script>
<lr-tooltip content="Copies a share link">
<lr-button appearance="outlined">Share</lr-button>
</lr-tooltip>
Feedback and status
Tell people what happened, what is happening and what is missing.
Callout lr-callout
Use when: A persistent inline message about the page or a section: success, warning or error.
<script type="module">
import '@aceshooting/lyra-ui/components/lr-callout.js';
</script>
<lr-callout variant="success" heading="Changes saved">Your profile is now visible to your team.</lr-callout>
Toast lr-toast
Use when: A brief confirmation that appears and dismisses itself, such as after saving.
<script type="module">
import '@aceshooting/lyra-ui/components/lr-button.js';
import '@aceshooting/lyra-ui/components/lr-toast.js';
const region = document.getElementById('guide-toast');
document.getElementById('guide-toast-trigger').addEventListener('click', () => {
region.create({ message: 'Changes saved', variant: 'success' });
});
</script>
<lr-button id="guide-toast-trigger">Save</lr-button>
<lr-toast id="guide-toast" placement="bottom-end"></lr-toast>
Badge lr-badge
Use when: A compact status or count attached to something else.
<script type="module">
import '@aceshooting/lyra-ui/components/lr-badge.js';
</script>
<lr-badge variant="success">Active</lr-badge>
<lr-badge variant="warning">Pending</lr-badge>
<lr-badge variant="danger">3 failed</lr-badge>
Progress bar lr-progress-bar
Use when: Progress of a task with a known end, like an upload or a setup checklist.
<script type="module">
import '@aceshooting/lyra-ui/components/lr-progress-bar.js';
</script>
<lr-progress-bar value="64" label="Upload progress" with-value></lr-progress-bar>
Empty state lr-empty
Use when: A list, search or view with nothing to show yet, plus the next step.
<script type="module">
import '@aceshooting/lyra-ui/components/lr-empty.js';
import '@aceshooting/lyra-ui/components/lr-button.js';
</script>
<lr-empty heading="No projects yet" description="Create a project to start collecting results.">
<lr-button slot="actions" variant="brand">New project</lr-button>
</lr-empty>
Data display
Show records, numbers and people compactly.
Table lr-table
Use when: Rows of records with sortable columns, selection and pagination.
<script type="module">
import '@aceshooting/lyra-ui/components/lr-table.js';
const table = document.getElementById('guide-table');
table.columns = [
{ key: 'customer', label: 'Customer', sortable: true, cell: (row) => row.customer },
{ key: 'amount', label: 'Amount', align: 'end', sortable: true, sortValue: (row) => row.amount, cell: (row) => row.amount.toFixed(2) },
];
table.rows = [
{ customer: 'Northwind', amount: 1280 },
{ customer: 'Contoso', amount: 640.5 },
{ customer: 'Fabrikam', amount: 92 },
];
table.rowKey = (row) => row.customer;
</script>
<lr-table id="guide-table" aria-label="Invoices" sort-key="customer" sort-dir="asc"></lr-table>
Stat lr-stat
Use when: One headline number with a label and change since the last period.
<script type="module">
import '@aceshooting/lyra-ui/components/lr-stat.js';
</script>
<lr-stat label="Active users" value="1,204" delta-percent="4.2" variant="success"></lr-stat>
Avatar lr-avatar
Use when: Represent a person or team with an image or initials.
<script type="module">
import '@aceshooting/lyra-ui/components/lr-avatar.js';
</script>
<lr-avatar initials="AL" label="Ada Lovelace"></lr-avatar>
<lr-avatar initials="GH" label="Grace Hopper" variant="brand"></lr-avatar>
Pagination lr-pagination
Use when: Move through a long result set one page at a time.
<script type="module">
import '@aceshooting/lyra-ui/components/lr-pagination.js';
</script>
<lr-pagination total="240" page-size="20" page="3"></lr-pagination>