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

Button group#

Component <neo-buttongroup> is a segmented row (or column) of <neo-button> children. Setting value on the host promotes it into a radiogroup with the matching child as the selected option.

Use button group for one selected value. Use <neo-toggle-group>  when multiple independent toggles may be on at the same time.

Default
Horizontal
Vertical
Deactivate Rename Duplicate
Delete
New state Toggle autoplay
Day Week Month Year
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
valuestring reflected observednoneSelected child value. Switches the host into segmented (radiogroup) mode, giving it a single roving tab stop with arrow-key focus movement. Absent, the buttons are independent tab stops with no selection or arrow navigation.
orientation"horizontal" | "vertical"horizontalLayout axis.
auto-activatebooleannoneArrow keys commit the selection in addition to moving focus.

Slots #

NameDescription
default<neo-button>  children. Mark the active one in segmented mode with a matching value. Use <neo-toggle-group>  for multiple independent on/off choices.

Events #

NameDetailBubblesDescription
neo-buttongroup-change{ value: string }yesFires after the selection changes in segmented mode.

Examples#

Horizontal#

Two groups: a visual-only row, then a segmented radiogroup.

  • Without value the buttons share borders only: no selection state, and each is its own tab stop with no arrow-key navigation.
  • Setting value on the host and a matching value on one button makes it a radiogroup: a single roving tab stop where arrow keys and Home / End move focus between buttons. Add auto-activate to commit the selection as focus moves.
Prev Today NextDay Week Month Year

Vertical#

Same segmented behaviour stacked in a column; keyboard arrows follow the layout direction.

S M L

Settings

Theme

Default Sunshine Ocean Matrix Rose

Accessibility

Playgrounds

Server Simulator