UI Interface

Buttons

Variants, tones, sizes, icons, loading and disabled states, groups, split buttons, segmented controls, chips, link buttons, FABs and social buttons. Every preview is live; open the Code panel to copy the exact markup.

Stable shell.css

Button variants

Primary, outline, ghost and soft cover almost every surface. Glass and white are made for gradient heroes and aurora headers.

Hover each button to see the kit hover state; press Tab to see the focus ring. Use one primary button per view, everything else outline, ghost or soft.

Glass and white (on gradients)

Translucent glass and solid white buttons sit on hero banners, aurora cards and dark gradient panels.

Both variants use light text or light fills, so keep them on dark or saturated backgrounds only.

Tones: solid, soft and outline

Soft buttons read the shared data-tone attribute. Solid and tonal outline need the small page-local helpers shown in the code view.

Soft
Solid
Outline

Tones: primary, success, warning, danger, info, accent, violet, orange, blue, pink, neutral. Dark mode brightens the tone foreground automatically.

Sizes

The kit ships default (36px) and sm (30px). Larger and smaller steps are plain Tailwind utilities that override the kit.

Primary
Outline
Pill

Leading and trailing icons

Drop a lucide or Phosphor icon inside the button. The kit sizes it to 15px and spaces it with the built-in gap.

Icon-only buttons

Use sx-btn--icon for square buttons. Always provide an aria-label; add data-tip for a hover tooltip.

States: hover, focus and disabled

Hover and focus come from the kit. Disabled uses the native attribute (or aria-disabled on links) with a tiny page-local rule.

Enabled
Disabled Link disabled

Explain why an action is unavailable next to the button; a disabled control alone gives no feedback.

Loading state (spinner)

Swap the leading icon for a spinning loader, set aria-busy and disable the button. Click the live buttons to try it.

Static
Live

Keep the label visible so the button width does not jump. Announce completion with a toast or live region.

Button groups

Join related buttons into one control with a page-local .ui-group wrapper. Supports outline, soft and icon-only members.

Split button with dropdown

A main action plus a caret that opens a sx-menu. The dropdown is handled by the shell with data-sx-dropdown.

Use sx-menu--up when the split button sits near the bottom of the viewport.

Segmented controls (sx-seg)

Mutually exclusive options in one compact control. The shell toggles .is-active and fires a sx:seg event with the chosen value.

Text
Icons
Full width

Listen with el.addEventListener("sx:seg", e => e.detail.value) to swap data. Keep labels short; use tabs for navigation between panels.

Chips (sx-chip)

Compact pills for filters and quick picks. Click to toggle the selected look; add an icon or a remove button.

Filter
Icons
Removable Status: Active Owner: Maya Plan: Pro
Sizes

Floating action buttons

Round primary actions pinned to a corner. Shown here inside a mock frame; in production use position fixed.

Standard
Extended
Mini + stack

A FAB should represent the single most common action on the screen. Always label icon-only FABs.

Social buttons

Sign-in and share buttons using Phosphor brand logos. Outline for neutral providers, inverted fill for dark brands.

Icon-only
Share

Brand marks are generic Phosphor logos. Follow each provider brand guidelines before shipping real sign-in flows.

Full-width and responsive

Combine Tailwind width utilities with the kit: block buttons, stacked on mobile and inline from sm, and icon-only collapse.

Labels hide below 640px

Keep touch targets at least 36px tall on phones (default size) and use size lg for the primary mobile action.

Usage tips and accessibility

Guidelines worth following across the whole template

Usage tips

  • Limit each view to one primary button; secondary actions use outline, ghost or soft.
  • Start labels with a verb: Save changes, Send invoice, Export report.
  • Pair destructive actions with the danger tone and confirm irreversible ones.
  • Use size lg for the main mobile call to action and keep groups under five items.
  • Shared styles used on this page that are not in shell.css are shown in each Code panel as page-local CSS.

Accessibility

  • Icon-only buttons need an aria-label; tooltips (data-tip) are supplementary, not a replacement.
  • Toggle buttons, chips and segmented items expose state with aria-pressed.
  • Loading buttons set aria-busy and stay in the tab order context; disabled ones use the native attribute.
  • The kit focus ring (2px primary outline) is visible on every variant; never remove it.
  • Use anchors for navigation and buttons for actions, and keep touch targets at 36px or more.

Hi, I’m Nova! Need a hand?