Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Motion Presets Command Menu Block for React

A motion tool's preset menu shown open over its transitions panel: easing curves, springs and durations each drawn as a 24 px curve, a track band that runs the highlighted preset's real CSS timing once on an arrow key or Replay, and a text reading under reduced motion.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

Feel a timing before you pick it with this motion presets command menu for React with Base UI. It opens from the Motion panel of Easelane, a motion-presets tool, whose header holds an outline field with its ⌘ K cap, and the tool's transitions panel is drawn under a soft scrim inside a hairline frame with a plus mark on each corner. The menu is the catalog Command with three groups: Easing (ease-out, ease-in-out and a custom cubic-bezier), Spring (Gentle, Snappy and Bouncy, each with its stiffness and damping) and Duration (150, 300 and 500 ms). Every row is drawn as its own curve in a 24 px SVG and says how its timing is written. A band under the list shows the highlighted preset on a track: a dot runs along it using that preset's own CSS timing and duration, a cubic-bezier or a linear() list sampled from the spring, and settles on the goal mark. The dot runs once when an arrow key moves the highlight, on the Replay button, on Alt and R, and when Enter chooses a preset; it never loops, never plays on load, and the pointer only selects what the band shows. Enter sets the preset, closes the menu, and the drawn panel behind it names the preset and runs its track once. For preview the menu is drawn open in place when the page loads; the field, or Ctrl or ⌘ K while focus is in the block, opens the real command dialog with the same preset and query. For animation tools, design-system docs and any product with motion settings.

FAQ

Why is the menu already open, and what do I keep?

So you can see it without a click. On load the menu is the Command with its track band drawn inline over a picture of the panel, in a plain shell that is not modal, so nothing is trapped, hidden or focused and the page around the preview keeps working. The header's field opens the real command dialog, modal, with its focus trap, Escape and focus return, and the inline copy stays closed until a reload. Both show the same Palette and share the block's state, so the preset set in the copy is the one the dialog opens on. In your app keep the dialog and drop the copy: the "in-place" state, the scrim with its shell and the Escape and blur effects.

Is the dot really using the preset's timing?

Yes. The track's dot is a CSS transition of its inline position with the preset's transition-timing-function and transition-duration set inline: the easing rows use their cubic-bezier(), the duration rows use ease-out over that time, and the spring rows use a linear() easing list sampled from a damped spring with the row's stiffness and damping, stepped in 1/240 s and ending exactly on 1, so a bouncy spring overshoots the goal and settles. The row's time is where the spring settles within one percent. Browsers without linear() ignore the declaration and fall back to the default easing.

When does it play?

Only when you press something: an arrow key (or Home or End) that moves the highlight, the Replay button, Alt and R (Option and R on a Mac, read from the key's code so the Option character doesn't matter), and Enter, which also runs the track on the drawn panel behind. Moving the pointer over rows only changes which preset the band shows, so sweeping the list never makes the dot dart about. Each press runs the dot once, the status line is not touched by highlighting, and nothing repeats.

What happens with reduced motion?

Nothing moves. The dot has no transition under prefers-reduced-motion, so it is at the goal at once, and the line under the track changes to a sentence that names the preset's time in words ("This preset takes 300 ms"), so the information that the animation would carry is still there. The curves in the rows are still pictures of the timing and carry no movement.

What stays local, and how do I wire it?

All of it. The nine presets and the chosen one are typed state in the block; nothing is saved and nothing leaves the page. In your app build PRESETS from your own timing tokens, write the choice to the selected animation in pick, and keep the track as the preview.

Is it accessible from the keyboard?

Yes. Type to search by name, timing or word ("ease", "spring", "bounce", "300"), the arrow keys move through the presets, Enter uses the highlighted one and Escape closes the menu and puts focus on the field; Tab reaches Replay. Ctrl or ⌘ K opens the dialog while focus is inside the block, and only then. The rows are options of a cmdk listbox; the block turns off its own fuzzy filter and lists the rows itself. The curves and the track are pictures and hidden from assistive technology; each row names its preset and its timing in words.

How does it look on a phone?

The copy shown on load docks to the top of the page at full width, so the keyboard does not cover the foot; the key hints go, the count stays, and the track band keeps its full width under the list. The real dialog keeps the Command dialog's own phone layout.

  • Pro

    A dashboard configurator's layout switcher as a command menu docked at the end of the page: six layouts each with a greyscale diagram, a band that draws the highlighted one larger, and Enter to re-arrange the drawn dashboard, still under reduced motion.

  • Pro

    A dashboard app's appearance menu shown open beside a live mini app: mode, corner radius, density and text size in four groups with a tick on each current choice, and a preview that restyles the moment you choose while the menu stays open.

  • Pro

    A design-system inspector's token picker as a command menu hung from a Fill field: tokens in groups with their resolved values and a small drawing, a box pane that wears whatever you apply, the alias chain of the last token, and a copy as CSS variable or JSON.

  • Pro

    A report builder's chart-type menu rising from the foot of a drawn report: eight types with tiny glyphs, a band that redraws one typed series as the chosen chart in hand-built SVG, a sentence and a list of figures for each, and a Stacked switch for bar and area.

  • Pro

    A design tool's tone picker as a command menu shown open over its Fill row: an eleven-step grey ramp and recent tones, a HEX, RGB or HSL switch that rewrites every value and what Enter copies, and a band with the highlighted tone's contrast on white and on black.

  • Pro

    A site builder's new-page menu shown open over its page tree: templates in five groups each with a drawn wireframe of six lines, a typed name that turns the list into Create from templates, and choosing one adds the page, with its slug, to the tree and selects it.