A wider screen, please

This page features interactive demos and side-by-side code samples that need at least 340 pixels of horizontal space. Please widen your browser window, or rotate your device, to continue.

Morpheus v0.1.0
v0.1.0

Navgroup#

Component <neo-navgroup> is a roving-tabindex keyboard navigation host. Arrow keys move focus across children marked data-neo-navgroup-item; Tab enters and leaves as a single stop. orientation picks the axis (horizontal, vertical, or 2D grid); columns fixes the grid column count; wrap opts into edge wrapping; typeahead opts into focus by printable key. No implicit ARIA role; author role and aria-label to fit the semantics.

This is keyboard navigation

Focus an item, then the arrow keys   plus Home  / End  and typeahead. With a pointer the demos are just buttons; the behavior is only observable from the keyboard.

Deactivate Rename Duplicate
Delete
New state Toggle autoplay
HTML CSS

The selected state's markup and its scoped CSS. The CSS is wrapped in <style>@scope { ... }</style> and applies to the preview only. Edits change the preview above, applied live while Sync is on, or when you click Patch or Replace. Patch morphs the preview; Replace swaps it outright.

Replace Patch

Signals

Datastar signals declared in the selected state's markup. Change a value to drive the preview, applied live while Sync is on, or when you click Patch.

Patch

Reference#

Attributes #

NameTypeDefaultDescription
orientation"horizontal" | "vertical" | "grid" observedhorizontalLayout axis. grid measures rendered columns unless columns is set.
columnsnumber observednoneOptional fixed grid column count.
wrapbooleanfalseArrow-key focus wraps at the edges.
typeaheadbooleanfalsePrintable keys focus matching items. Labels are read from data-neo-navgroup-label, aria-label, label, then text content.
typeahead-timeoutnumber500Idle reset duration in milliseconds.
typeahead-match"substring" | "prefix""substring"How the buffered query is matched against item labels.

Slots #

NameDescription
defaultChildren that carry the data-neo-navgroup-item attribute.

Events #

NameDetailBubblesDescription
neo-navgroup-navigate{ index: number, item: HTMLElement }yesFires when roving focus moves to an item via keyboard navigation.

CSS variables #

NameDefaultDescription
--neo-navgroup-gapcalc(var(--page-spacing, 0.25rem) * 2)Gap between items.
--neo-navgroup-columns1Column count in grid orientation. JS mirrors the columns attribute into this property.

Examples#

Toolbar#

A horizontal row of formatting buttons with wrap on, so arrow keys cycle past either edge. role="toolbar" and aria-label turn the group into a single labelled landmark for assistive tech.

B I U S

Vertical#

Same component, axis flipped to match a stacked list. Up/down arrows move focus, wrap keeps the cursor inside the group when it reaches either end.

Profile Settings Billing Sign out

Grid#

Set orientation="grid" with a columns count and arrow keys move in two dimensions. wrap wraps both axes, so a Right at the end of a row jumps to the start of the next row.

123456789

Media controls#

Disabled items stay in place so the toolbar's visual order is preserved, but arrow keys skip over them: they're dropped from the roving focus set and can't be activated. Useful for media controls where the available actions change with playback state.

Settings

Theme

Default Sunshine Ocean Matrix Rose

Accessibility

Playgrounds

Server Simulator