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

Tabs#

Component <neo-tabs> is a tabbed interface: clicking a <neo-tab> commits its value to the host, which reveals the matching <neo-tabpanel>. Arrow keys move focus across tabs; activation is manual (Enter or Space commits). Set auto-activate to opt into the selection-follows-focus pattern.

Default
Icons + labels
No animation
Custom animation
Custom styling
Auto-activate
Vertical
Deactivate Rename Duplicate
Delete
New state Toggle autoplay
Overview Activity Reports Settings

Overview

A snapshot of the project — open issues, recent commits, and the CI status.

Activity

The chronological feed.

Reports

(unreachable in this demo)

Settings

Project-wide preferences.

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 observednoneActive tab value.
orientation"horizontal" | "vertical" observedhorizontalLayout axis.
auto-activatebooleanfalseArrow keys commit the selection in addition to moving focus.
easingstring observednoneCSS transition shorthand for the panel swap.
enter-animationstring observednone@keyframes name for the entering panel.
exit-animationstring observednone@keyframes name for the exiting panel.

States #

NameDescription
:state(forward)Set on <neo-tabs> when the new tab sits after the previous one; the built-in and author animations branch on it.
:state(backward)Set on <neo-tabs> when the new tab sits before the previous one.
:state(leaving)Set on the outgoing <neo-tabpanel> for the duration of its exit animation.

Slots #

NameDescription
default<neo-tablist>, <neo-tab>, and <neo-tabpanel> children.

Events #

NameDetailBubblesDescription
neo-tabs-change{ value: string }yesFires after the active tab changes.

CSS variables #

NameDefaultDescription
--neo-tabs-list-bgcolor-mix(in srgb, var(--page-fg) 6%, transparent)Tablist pill background.
--neo-tabs-list-padding0.25remPadding inside the tablist pill.
--neo-tabs-list-border-width2pxTablist border width in forced-colors and high-contrast modes.
--neo-tabs-radiusvar(--page-radius, 0.5rem)Tablist corner radius.
--neo-tabs-focus-outline-width2pxFocus outline width.
--neo-tabs-focus-outline-offset2pxFocus outline offset.
--neo-tabs-tab-radiusmax(2px, calc(var(--neo-tabs-radius) - var(--neo-tabs-list-padding)))Tab corner radius.
--neo-tabs-tab-padding-y0.4remTab vertical padding.
--neo-tabs-tab-padding-x0.85remTab horizontal padding.
--neo-tabs-tab-paddingvar(--neo-tabs-tab-padding-y) var(--neo-tabs-tab-padding-x)Tab padding shorthand.
--neo-tabs-edge-tab-padding-xvar(--neo-tabs-tab-padding-x)Horizontal padding of the first and last tab in forced-colors and high-contrast modes.
--neo-tabs-tab-colorvar(--muted, currentColor)Inactive tab text color.
--neo-tabs-tab-hover-colorvar(--page-fg, currentColor)Tab text color on hover.
--neo-tabs-tab-active-bgvar(--page-bg, #ffffff)Active tab background.
--neo-tabs-tab-active-colorvar(--page-fg, currentColor)Active tab text color.
--neo-tabs-tab-active-shadow0 1px 2px color-mix(in srgb, var(--page-fg) 16%, transparent)Active tab shadow.
--neo-tabs-focus-ringvar(--accent, currentColor)Focus outline color.
--neo-tabs-panel-padding0.85rem 0Panel padding.

Examples#

Icons + labels#

Each <neo-tab> accepts arbitrary children. Drop in a <neo-icon> next to the label and the tab's flex layout aligns them with the same gap as a <neo-button>.

Inbox Messages Notifications Trash

Inbox

Your incoming mail, threaded by sender.

No animation#

Omit easing and the panel swap is instant. This is the default; the examples below opt into transitions and keyframe animations.

OverviewActivityReports

Overview

A snapshot of the project: open issues, recent commits, and the CI status.

Custom animation#

Point enter-animation and exit-animation at author-defined @keyframes. The tabs-tilt set here branches on the host's :state(forward) / :state(backward) custom state (set when the active tab changes), so the panel rotates and slides in from the side of travel.

GeneralAppearanceAdvanced

General

Display name, timezone, language.

Custom styling#

The --neo-tabs-* custom-property family swaps the default pill frame for any visual. Here a scoped <style> block sets those properties to turn the active pill into an accent-coloured underline, GitHub-style. Selection, keyboard navigation, and animation are unchanged.

Overview Issues Pull requests Actions

README, recent commits, and the CI badge.

Auto-activate#

Set auto-activate on the host so arrow keys commit the selection as focus moves, matching the classic WAI-ARIA radiogroup pattern.

Only observable with the keyboard: focus a tab, then press   /   and the panel follows focus. A pointer behaves like a normal tab list.

DayWeekMonthYear

Activity over the last 24 hours.

Vertical#

Set orientation="vertical" on the host. The tablist stacks, arrow-key axes flip to /, and the aria-orientation hint propagates to the tablist.

GeneralAppearanceAdvanced

General

Display name, timezone, language.

Settings

Theme

Default Sunshine Ocean Matrix Rose

Accessibility

Playgrounds

Server Simulator