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#

Component <neo-button> is a styled, keyboard-activated button with variant, size, and icon-slot conventions shared across the kit.

Default
Variants & states
Composed content
Deactivate Rename Duplicate
Delete
New state Toggle autoplay
Click me
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
variant"primary" | "secondary" | "ghost" | "danger" | "anchor"noneVisual style. Omit for the default neutral styling.
disabledboolean observedfalseRemoves the host from the tab order and swallows clicks.
size"sm" | "lg"noneControl-size step: sm compact, lg large. Omit for the default size.
valuestringnoneSelection value inside a <neo-buttongroup> .

Events #

NameDetailBubblesDescription
click noneyesAlso fires on Enter / Space.

CSS variables #

NameDefaultDescription
--neo-button-bg#ffffffBackground of the default neutral button.
--neo-button-color#111827Text color of the default neutral button.
--neo-button-border-colorrgba(0, 0, 0, 0.12)Border color of the default neutral button.
--neo-button-hover-bgrgba(0, 0, 0, 0.04)Background on hover for the default neutral button.
--neo-button-active-bgrgba(0, 0, 0, 0.08)Background while pressed (:active) for the default neutral button. Darker than hover.
--neo-button-active-colorvar(--neo-button-color)Text color while pressed for the default neutral button.
--neo-button-gap0.35remGap between adjacent button content (icon and label).
--neo-button-shadow0 1px 2px rgba(0, 0, 0, 0.1)Resting box shadow.
--neo-button-hover-shadow0 6px 16px rgba(0, 0, 0, 0.2)Box shadow on hover.
--neo-button-active-shadow0 1px 3px rgba(0, 0, 0, 0.14)Box shadow while pressed.
--neo-button-hover-lift-1pxVertical translateY offset on hover. Zeroed under reduced motion and while a popup is anchored open.
--neo-button-active-lift1pxVertical translateY offset while pressed. Zeroed under reduced motion and while a popup is anchored open.
--neo-button-radiusvar(--page-radius, 0.25rem)Corner radius.
--neo-button-paddinground(calc(var(--page-spacing, 0.25rem) * 2), 1px) round(calc(var(--page-spacing, 0.25rem) * 3.5), 1px)Per-side padding, snapped to whole pixels so the used height stays an integer.
--neo-button-primary-bg#2563ebBackground of the primary variant.
--neo-button-primary-color#ffffffText color of the primary variant.
--neo-button-primary-hover-bg#1d4ed8Background on hover for the primary variant.
--neo-button-primary-active-bgcolor-mix(in srgb, var(--neo-button-primary-hover-bg), #000 8%)Background while pressed for the primary variant.
--neo-button-secondary-bgrgba(0, 0, 0, 0.06)Background of the secondary variant.
--neo-button-secondary-colorcurrentColorText color of the secondary variant.
--neo-button-secondary-hover-bgrgba(0, 0, 0, 0.1)Background on hover for the secondary variant.
--neo-button-secondary-active-bgrgba(0, 0, 0, 0.14)Background while pressed for the secondary variant.
--neo-button-ghost-bgtransparentBackground of the ghost variant.
--neo-button-ghost-colorcurrentColorText color of the ghost variant.
--neo-button-ghost-hover-bgrgba(0, 0, 0, 0.06)Background on hover for the ghost variant.
--neo-button-ghost-active-bgrgba(0, 0, 0, 0.1)Background while pressed for the ghost variant.
--neo-button-danger-bg#dc2626Background of the danger variant.
--neo-button-danger-color#ffffffText color of the danger variant.
--neo-button-danger-hover-bg#b91c1cBackground on hover for the danger variant.
--neo-button-danger-active-bgcolor-mix(in srgb, var(--neo-button-danger-hover-bg), #000 8%)Background while pressed for the danger variant.
--neo-button-anchor-underline-offset0.25emUnderline offset for the anchor variant.
--neo-button-focus-ringcurrentColorFocus-visible outline color.
--neo-link-radius2pxCorner radius of the focus outline on the anchor variant and <a data-neo-link>.

Examples#

Variants & states#

The six built-in variant values (default, primary, secondary, ghost, danger, anchor), the disabled state, and an icon-and-label composition.

DefaultPrimarySecondaryGhostDangerAnchorDisabled Settings

Composed content#

A button can host richer markup when the action needs more context than a short label.

Live deploy Project Morpheus
97% healthy

Settings

Theme

Default Sunshine Ocean Matrix Rose

Accessibility

Playgrounds

Server Simulator