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

Dialog#

Component <neo-dialog> is a modal dialog wrapping the platform <dialog> element. The host wires trigger, close, and aria plumbing; the browser owns top-layer rendering, focus trap, scroll lock, and Esc. No portal: markup stays in light DOM so kit CSS themes it directly.

Default
Non-dismissible
Custom surface
Deactivate Rename Duplicate
Delete
New state Toggle autoplay
Open dialog

Are you absolutely sure?

This action cannot be undone. This will permanently delete your account and remove your data from our servers.

Cancel Continue
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
openboolean reflected observedfalseControls modal visibility.
dismissibletrue | falsetrueBackdrop click and Esc close the dialog. Set dismissible="false" to require an explicit close.

Slots #

NameDescription
defaultA <dialog> with optional [data-neo-dialog-header], [data-neo-dialog-body], [data-neo-dialog-footer] children.
[data-neo-dialog-trigger]Element that opens the dialog on click.
[data-neo-async-placeholder]Loading skeleton swapped in while the body morphs in.

Events #

NameDetailBubblesDescription
neo-dialog-opennoneyesFires when the dialog opens.
neo-dialog-closenoneyesFires when the dialog closes.

CSS variables #

NameDefaultDescription
--neo-dialog-bgvar(--page-bg, #ffffff)Dialog surface background.
--neo-dialog-colorvar(--page-fg, #111827)Dialog text color.
--neo-dialog-border-colorvar(--btn-border, rgba(0, 0, 0, 0.08))Border color.
--neo-dialog-border-width1pxBorder width.
--neo-dialog-radiuscalc(var(--page-radius, 0.25rem) * 1.5)Corner radius.
--neo-dialog-paddingcalc(var(--page-spacing, 0.25rem) * 6)Inner padding of the dialog box.
--neo-dialog-shadow0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 10px 15px -3px rgba(0, 0, 0, 0.1)Box shadow of the dialog box.
--neo-dialog-min-width18remMinimum width of the dialog box.
--neo-dialog-max-width32remMaximum width of the dialog box.
--neo-dialog-screen-offset1remMinimum gap between the dialog box and the viewport edge.
--neo-dialog-enter-durationcalc(180ms * var(--neo-duration-scale, 1))Open and close transition duration.
--neo-dialog-overlay-bgrgba(0, 0, 0, 0.55)Backdrop dim color behind the dialog.
--neo-dialog-overlay-blur0pxBackdrop blur applied to the page behind the dialog.
--neo-dialog-blur0pxSurface blur applied as a backdrop-filter on the dialog box for a frosted-glass effect with a translucent background.

Examples#

Non-dismissible#

For must-decide flows, set dismissible="false": backdrop clicks and Esc are ignored, so the user must pick an action. Pair it with a clearly destructive primary button.

Delete project

Delete project?

This will remove all builds, secrets, and members. The project name cannot be reused for 30 days.

Cancel Delete

Custom surface#

Theme the surface by setting --neo-dialog-* tokens inline on the host.

  • Here a dark translucent panel with an 18px backdrop blur over a heavier overlay dim.
  • Holds up in light and dark modes: the dialog stays dark and the blurred page reads through the glass either way.
Open frost glass

Frost glass surface

Two stacked blurs: the ::backdrop frosts the page behind the modal at 6px (with a soft 18% black tint), and the dialog surface adds another 22px on top of its own 42% dark wash. The page reads through both layers as a deep frosted scene: soft outside the dialog, denser within.

Close OK

Examples: Datastar#

Morphing during interaction#

A Datastar app can fat-morph an open dialog's body at any moment; the dialog stays mounted and open and focus survives.

  • A <neo-elastic> wrapper around the body animates the dialog's height between the two layouts.
  • Autoplay cycles the states below to simulate the server-driven morphs.
Initial
Different content
Deactivate Rename Duplicate
Delete
New state Toggle autoplay
What's new

Release notes

The server just morphed this content in place.

  • New dashboard layout
  • Faster search
Close
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

Load the body on every open. A [data-neo-async-placeholder] child holds skeleton bars; opening posts to the server, whose response morph-patches real content in to replace it.

  • On close the host reinstates the placeholder, so each open shows it again until the new request resolves.
  • requestCancellation aborts an in-flight request when the user closes mid-load.

Async loading#

Loading states only show with simulated delay. Raise network latency or handler delay in the Settings panel.

Load profile

Team members

Loaded fresh from the server each time you open this dialog.

Close

Async load with failure swap#

Async load that shows a failure state and a retry button when the request keeps failing.

  • The loader lives in the dialog's [data-neo-async-placeholder] slot, so close/reopen restores it; on success the server morphs <div id="<host-id>-body"> in place.
  • Once Datastar exhausts its retry budget, a failure view with a [data-neo-popover-async-retry] button replaces the body without closing the dialog.
  • Same failure-swap contract as PopoverAsync.

Loading states only show with simulated delay. Raise network latency or handler delay in the Settings panel.

Load profile

Team member

Loaded fresh from the server each time you open this dialog.

Close

Opening streams progress patches over time. Each patch morphs the steps wrapper inside a <neo-elastic>, which animates the dialog's height as rows are added.

The final patch swaps in a <neo-button data-neo-dialog-close> so the user can dismiss only after the simulated job finishes.

Continuous patching#

Run deployment

Deployment

The server streams progress patches; the body grows inside a <neo-elastic> wrapper that animates the height change.

Settings

Theme

Default Sunshine Ocean Matrix Rose

Accessibility

Playgrounds

Server Simulator