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

Card#

Component <neo-card> is a styled surface container. Wrap content in a single <div data-neo-card-inner>: the host paints the border, background, and radius; the inner element carries padding and gap rhythm. Optional data-neo-card-* markers cue a header / media / body / footer cadence.

Default
Variants
Composed
Media hero
Horizontal media
Adaptive
Deactivate Rename Duplicate
Delete
New state Toggle autoplay

Card title

A short supporting line beneath the title.

Action
Card body content goes here. Edit this HTML to see the layout update live.
Cancel Confirm
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"" | "outline" | "elevated"noneSurface treatment. Empty (default) renders a filled card with a subtle border; outline drops the fill; elevated drops the border and adds a soft shadow.
orientation"" | "horizontal"noneLayout direction. Empty (default) stacks slots top-to-bottom; horizontal places the media slot on the left and stacks header/body/footer in a column on the right. Horizontal cards auto-collapse to vertical when their own inline size drops below 28rem, via a CSS @container query (not viewport).

Slots #

NameDescription
[data-neo-card-header]Header row. Stacks vertically (title above description); switches to a horizontal row pinning [data-neo-card-actions] to the end when actions are present.
[data-neo-card-title]Card title. Bolder weight, slightly larger size; no default margin.
[data-neo-card-description]Secondary line under the title. Muted color, no default margin.
[data-neo-card-actions]Right-aligned actions inside the header.
[data-neo-card-media]Edge-to-edge media. Escapes the card's padding via negative margins and rounds the corners that touch the card edge when placed first or last.
[data-neo-card-body]Main content. Block layout, default line-height.
[data-neo-card-footer]Footer actions row. Right-aligned, wraps on narrow widths.

CSS variables #

NameDefaultDescription
--neo-card-bgvar(--btn-bg, transparent)Card background.
--neo-card-colorvar(--page-fg, currentColor)Card text color.
--neo-card-border-colorvar(--btn-border, currentColor)Border color.
--neo-card-border-width1pxBorder width.
--neo-card-radiusvar(--page-radius, 0.5rem)Corner radius.
--neo-card-paddingcalc(var(--page-spacing, 0.25rem) * 5)Inner padding.
--neo-card-gapcalc(var(--page-spacing, 0.25rem) * 4)Gap between stacked slots.
--neo-card-shadow0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 14px rgba(0, 0, 0, 0.08)Box shadow used by the elevated variant.
--neo-card-title-size1.05remTitle font size.
--neo-card-title-weight600Title font weight.
--neo-card-description-colorcolor-mix(in srgb, var(--page-fg) 65%, transparent)Description text color.
--neo-card-horizontal-media-width12remMedia column width in horizontal orientation.
--neo-card-horizontal-body-min-width12remBody minimum width in horizontal orientation.
--neo-card-media-default-height8remDefault height of the media slot.
--neo-card-horizontal-collapse28remInline-size threshold below which a horizontal card collapses to vertical.

Examples#

Variants#

Three surface treatments via the variant attribute: default (filled + subtle border), outline (border only, no fill), elevated (soft shadow, no border).

Default

Filled background, subtle border.

Outline

Border only, no fill.

Elevated

Soft shadow, no border.

Composed#

A typical composition uses all four structural slots: header (with title, description, and right-aligned actions), body, and a footer row of buttons. The header switches from vertical stack to horizontal row via :has([data-neo-card-actions]) only when actions are present.

Production deploy

Promotes the latest green build from staging.

Logs
Last deployed 14 minutes ago by you. 23 commits since the previous release. Review the changelog before shipping.
Cancel Deploy

Media hero#

[data-neo-card-media] escapes the card's padding so an image fills it edge-to-edge. The corners that touch the card edge round to match the host's --neo-card-radius; the opposite edge stays sharp where it meets the next slot.

Bay of Uri, Brunnen, by John Singer Sargent, June 4, 1870

Bay of Uri, Brunnen
from Switzerland 1870 Sketchbook

John Singer Sargent

American · June 4, 1870

Horizontal media#

orientation="horizontal" lays the card out as a row of [data-neo-card-media] on the left and a column of [data-neo-card-header][data-neo-card-body][data-neo-card-footer] on the right. The media slot fills the left column edge-to-edge and rounds the corners that touch the card's left edge.

Torban, 19th century, Ukrainian
TitleTorban
Date19th century
GeographyUkraine
CultureUkrainian
MediumWood and wire
DimensionsLength 118.1 cm, Width 36.8 cm, Height 17 cm
ClassificationChordophone-Lute-plucked
Credit LineThe Crosby Brown Collection of Musical Instruments, 1889
Object Number89.4.310

Adaptive#

The same horizontal-mode markup auto-collapses to a vertical stack via an @container query keyed on the card's own inline size (default threshold --neo-card-horizontal-collapse: 28rem). No @media rule and no JavaScript: drag the resize handle below 28rem to see the card adapt to its own width.

Sintel

Blender Open Movie · 2010

A short fantasy film by the Blender Foundation, released under Creative Commons BY 3.0. Drag the resize handle on this stage below 28rem to watch the card auto-collapse into a vertical stack, with no viewport reload, no JavaScript, no @media query.

Settings

Theme

Default Sunshine Ocean Matrix Rose

Accessibility

Playgrounds

Server Simulator