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

Clipcopy#

Component <neo-clipcopy> is a wrapper that copies a value to the clipboard when its first child is clicked. The host toggles a copied attribute so consumers style idle and copied states from CSS.

Default
Icon + target ref
Deactivate Rename Duplicate
Delete
New state Toggle autoplay
Copy install command Copied
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
valuestringnoneLiteral text to copy. Takes precedence over for.
forstringnoneId of an element whose textContent is copied.
copied-durationnumber1500Milliseconds the copied attribute stays on the host.

Slots #

NameDescription
defaultTrigger element. Children may use [data-neo-clipcopy-idle] and [data-neo-clipcopy-copied] to swap label content per state.

Events #

NameDetailBubblesDescription
neo-clipcopy-copy{ value: string }yesFires after a successful copy.
neo-clipcopy-error{ error: Error }yesFires when the clipboard write fails.

Examples#

Icon + target ref#

The host reads the textContent of the <code> element pointed to by its for attribute, so the copied value tracks what the user sees on the page. Useful when the rendered text is the source of truth.

sk_live_AbC123DefGhI456JkL789MnO

Settings

Theme

Default Sunshine Ocean Matrix Rose

Accessibility

Playgrounds

Server Simulator