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.3.0
v0.3.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
DeactivateRenameDuplicate
Delete
New state Toggle autoplay
Click me
HTMLCSS

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.

ReplacePatch

Signals

Datastar signals declared in the selected state's markup. Change a value to update 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 or 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-bgvar(--btn-bg)Background of the default neutral button.
--neo-button-colorvar(--btn-fg)Text color of the default neutral button.
--neo-button-border-colorvar(--btn-border)Border color of the default neutral button.
--neo-button-hover-bgvar(--btn-hover-bg)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-bgvar(--accent)Background of the primary variant.
--neo-button-primary-colorvar(--accent-fg)Text color of the primary variant.
--neo-button-primary-hover-bgvar(--accent-hover)Background 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-bgcolor-mix(in srgb, var(--page-fg) 10%, transparent)Background of the secondary variant.
--neo-button-secondary-colorvar(--page-fg)Text color of the secondary variant.
--neo-button-secondary-hover-bgcolor-mix(in srgb, var(--page-fg) 16%, transparent)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-colorvar(--page-fg)Text color of the ghost variant.
--neo-button-ghost-hover-bgvar(--btn-hover-bg)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-bgvar(--danger-bg)Background of the danger variant.
--neo-button-danger-colorvar(--danger-fg)Text color of the danger variant.
--neo-button-danger-hover-bgvar(--danger-hover-bg)Background 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-ringvar(--accent)Focus-visible outline color.
--neo-link-radius2pxCorner radius of the focus outline on the anchor variant and <a data-neo-link>.

Examples#

Variants & states#

The 6 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

DefaultSunshineOceanMatrixRose☀ ◐ ☾

Accessibility

Playgrounds

Server Simulator