Production-Ready Patterns

Interactive, runnable blueprints for advanced UI cases — seamless routing, async dismissal, nested layers, focus recovery, and portal integration.

All recipes

11 runnable projects
State & lifecycleIntermediate8 min

Route-controlled sheet

Open from URL state, cold-open without a trigger, and update navigation only after exit motion completes.

State & lifecycleIntermediate6 min

Async editor close

Flush a dirty draft at the dismissal-request boundary before committing controlled state or starting exit motion.

State & lifecycleIntermediate7 min

Destructive confirmation

Give destructive work an alert-dialog role, a safe initial target, and dismissal ownership while the mutation is busy.

Nested layersAdvanced12 min

Nested modal navigation

A centered library with a body-safe native scroller and a right-side detail surface that swipes back independently.

Nested layersAdvanced12 min

Nested navigation with Tailwind v4

The same nested modal architecture expressed with Tailwind v4 while preserving structural CSS and gesture handoff.

Nested layersAdvanced10 min

Detail → confirmation → lightbox

Compose host-relative navigation, an alert dialog, and a family-correct Lightbox without losing dismissal order.

Library adaptersIntermediate6 min

Radix popover in a Sheet

Keep Radix positioning and focus behavior while enrolling its portaled Content in Velvet dismissal ownership.

Library adaptersIntermediate6 min

React Aria popover in a Sheet

Let React Aria own accessible popover semantics while Velvet coordinates the parent modal and dismissal stack.

Library adaptersIntermediate6 min

Base UI popover in a Sheet

Place Velvet's Base UI boundary inside Popover.Portal and slot the real Positioner, leaving Base UI in charge of layout.

ResilienceFocused4 min

Reduced-motion initial-open sheet

Prove that a controlled draggable sheet mounted open never turns setup-time runway normalization into a false close.

ResilienceFocused4 min

Deleted-trigger focus fallback

Restore focus safely when the control that opened a sheet disappears during an optimistic update.