Interpolator
Micro two-face morph — compact chrome swaps size and shape in one slot, with optional blur, footprint, and origins.
Interpolator morphs one compact control face into another inside a single layout slot. You pass an idle exit face and an active enter face, then drive interpolating from product state. Scale comes from measured layout boxes — both faces stay simple chrome (buttons, thin progress, icon-in-surface), not page sections or heavy trees.
Use it when the control itself should change silhouette (labeled action → round icon, save → busy bar) and reverse cleanly. Origins, blur, and footprint are opt-in for that pair; inactive faces stay inert. Prefer Spinner or Button loading when only a busy glyph is needed, and Disclosure / ToggleButton interpolateIcons for icon-pair crossfades.
Keep faces small
Interpolator is for micro chrome. Large cards, media, or multi-widget trees stretch poorly and cost more to measure. When the silhouette barely changes, a simpler swap usually wins.
When to use
- A labeled action that should become a compact status or icon face in the same slot
- Bidirectional handoff between two similar-height chrome faces (confirm, busy, added)
- Opt-in blur or footprint morph when the pair needs the slot to resize with the visible face
When not to use
- Page or section swaps, cards, or large trees
- Busy glyph inside an unchanged Button → Button
loading/ Spinner - Disclosure or ToggleButton icon pairs →
interpolateIcons - More than two faces or multi-step wizards
Common examples
Labeled action to icon
A large pill Button with a cart addon collapses into a matching IconButton. Badge wraps only that IconButton. After enter settles, flip show so the status dot pops in. Reverse to the Button turns show off; the next trip to the IconButton brings the badge back after settle again.
footprint="morph" lets the slot follow the visible face as the label collapses. Drive Badge show from the same added flag (with a short delay) — off as soon as you leave the IconButton face, back on the next enter.
Compact running toast
A wide paused Surface toast holds play and a labeled readout. Press play to start the clock and morph into a tighter face: timer icon and time on opposite ends. Press that compact face to pause and expand again.
Drive interpolating from the same running flag that owns the clock. footprint="morph" shrinks the Surface pill as the label drops away; the compact face is one button so pause and expand stay a single hit target.
Hover icon to labeled action
A large primary pill IconButton with an up-right arrow sits idle. Pointer enter morphs it into a matching primary pill Button with the same icon and the label Open in new window. Leave reverses. Both faces use radius="pill". Leave origins at the default center — they match the centered face slot, so the scale does not fight footprint="morph".
Drive interpolating from pointer enter/leave on the Interpolator root so the hover target survives the face swap. Omit variant — primary is the Button default. footprint="morph" grows the slot; omit origin props (default center) so scale stays aligned with the faces.
Ask your agent
Turn the Add to cart button into a pill that morphs into a matching cart IconButton when clicked. Shortly after the morph settles, show a green status badge on the icon. Clicking the icon should reverse the morph.Related
- Button — labeled exit face
- IconButton — compact enter face
- Surface — toast chrome for both faces
- Badge — status dot after settle
- Spinner — in-control busy without a face swap
- LinearProgress — thin busy bar face when the pair fits
Last updated on