Scroll & Storytelling
ProFeatures as balls on a dial: scrolling turns it with detents, the arriving ball kicks on the hand and stretches into its label while the screen swaps.
Scroll insideScroll inside
Product tour
Every request in one queue, sorted by who has to act.
feature-dial, lively
A features walkthrough for a product page: four to eight features sit as icon balls on a dial
beside a pinned stage. Scrolling turns the dial from mark to mark (it leans toward the next mark,
then snaps on), the arriving ball kicks against the hand, the hand stretches into a pill carrying
the feature's name and the stage shows that feature's screen. Without scroll (manual) it is an
in-app "What's new" or settings tour. For a list of steps beside a pinned screen use Sticky Feature
Scroll; for one shape that morphs through a scroll use Scroll Morph;
for plain tabs use Tabs.
pnpm dlx shadcn@latest add @motionkit-pro/feature-dialnpx shadcn@latest add @motionkit-pro/feature-dialyarn dlx shadcn@latest add @motionkit-pro/feature-dialbunx --bun shadcn@latest add @motionkit-pro/feature-dialRequires a Pro license and the @motionkit-pro registry with your token. See Installation.
import { FeatureDial, FeatureDialRise } from "@/components/ui/feature-dial"
const features = [
{
id: "inbox",
label: "Inbox",
icon: <InboxIcon />,
screen: (
<div>
<FeatureDialRise index={0}>…header…</FeatureDialRise>
<FeatureDialRise index={1}>…rows…</FeatureDialRise>
</div>
),
},
{ id: "approvals", label: "Approvals", icon: <CheckIcon />, screen: <ApprovalsScreen /> },
{ id: "reports", label: "Reports", icon: <ChartIcon />, screen: <ReportsScreen /> },
]
export function Tour() {
return (
<FeatureDial features={features}>
<h2>Everything your team needs</h2>
</FeatureDial>
)
}children is the heading row above the dial. In the scroll presets the section is
scrollRange (default 80) percent of the viewport tall per feature, and the heading, dial and
stage stay pinned while it scrolls past; inside a scroll area, pass scrollContainer (a ref to
it). progress (0 to 1) replaces the scroll binding; value / defaultValue /
onValueChange take the feature id. Wrap the parts of a screen in FeatureDialRise (with an
index) and they rise one after another once the dial has turned; anything else in the screen
simply fades in. The ball, the pill and the stage use your theme's primary, background,
card and border tokens.
temperament (calm, lively, playful) changes only the turn's spring, the kick on the hand,
how far the travelling ball stretches and the cascade's stagger (calm: a 0.26 s turn, no
overshoot, no kick); the dial looks the same at rest. Presets change the configuration:
dial (default): a half dial on the left, its centre off canvas, the hand at 3 o'clock and the
label pill growing toward the screen on the right.ring: a full ring the features orbit around the screen tile, hand at 12 o'clock, label pill
under the hand. A wrap from the last feature to the first takes the short way round.manual: no scroll binding and no pinning; Prev / Next buttons, a compact dial and clickable
balls, for an in-app card.Below 560 px of room (520 for ring) every preset becomes the top arc of a large circle: balls
along a 120 px strip, the hand at the top centre, the label pill under it and the stage full
width below; a scroll step is 75% of scrollRange.
Prop
Type
Also accepts all props of Omit<
ComponentProps<"section">,
"children" | "defaultValue" | "onChange"
>.
Prop
Type
Also accepts all props of ComponentProps<typeof motion.div>.
preset="ring" in a product page section: six capabilities orbit the screen they open.
Scroll insideScroll inside
Platform
feature-dial, lively
preset="manual" in a release-notes card: Prev / Next, the balls or the arrow keys turn the
dial; the description line sits under the screen.
Scroll insideScroll inside
Four changes from this release.
Follows the system setting, or pick one in Appearance.
feature-dial, lively
FeatureDial: the section (ref goes here), the heading row (children), the dial and the
stage. In the scroll presets a sticky wrapper and the scroll track under it.data-slot="feature-dial-ring"): the 4 px track, the hand pill and the role="tablist"
rotor, one rotating element that carries every ball.data-feature): a role="tab" button with the Switch thumb's depth; its icon
layer counter-rotates on the same value, so icons stay upright.data-slot="feature-dial-hand"): the primary pill at the hand, a ball while the dial
turns, a pill with the label once it lands.data-slot="feature-dial-stage"): the role="tabpanel" tile (radius 20, rim, tinted
shadow) and the optional description line.FeatureDialRise: a part of a screen that cascades in after a turn.manual, data-slot="dial-prev" / "dial-next"): Prev / Next and the position.role="tablist" (vertical in dial, horizontal otherwise) named by label;
each ball is a role="tab" with aria-selected, aria-controls and the feature name as its
aria-label (icons are aria-hidden). The stage is the role="tabpanel", labelled by the
active tab. Only the active tab is in the tab order.ring-[3px] ring-ring/50 and turns with its ball.primary with primary-foreground text, inactive balls are
background with a rim and muted-foreground icons; the active feature is also named by the
pill's text, never by color alone.| Keys | Action |
|---|---|
ArrowDown / ArrowRight | Turn to the next feature |
ArrowUp / ArrowLeft | Turn to the previous feature |
Home | Turn to the first feature |
End | Turn to the last feature |
Enter / Space | Select the focused feature |
Focus follows the selection. In ring the arrows wrap around.
No pinning and no scroll binding: the section is a static dial controlled by clicks, keys and
swipes, as in manual. The ring still travels to the new feature, gliding in the fade time with
no lean, stretch or kick; the label pill swaps without stretching and the screen crossfades. Both
states are complete pictures (rimmed balls, the pill with its label, the full screen).
Scroll position comes from Motion's useScroll (one passive listener) and is only followed
while the section is near the viewport and the tab is visible; back in view it catches up.
Per frame the dial animates one rotation (the rotor and each icon's counter-rotation share one
motion value), each ball's opacity and the hand pill's width (one absolutely positioned element
that lays out nothing else). Room and label widths are measured on mount and by a
ResizeObserver. Nothing loops and the screens never animate on their own. Dependency:
motion (about 40 kB gzip, shared with every MotionKit component).
Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Not measured yet · budget 15.0 kB gzip
Component and MotionKit helpers; excludes react, react-dom, motion.
scroll, click, entering the viewport, drag
No pinning and no scroll binding: a static dial controlled by clicks, keys and swipes, the ring glides to the new feature in the fade time with no lean, stretch or kick, and the screen crossfades.
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)