A confirmed search flies into the list title as a ball, stretches into a pill between the words and pushes the counter; the pill removes the filter.
TypeType
Projects, 128Projects· 128128
Showing 6 of 128, latest first.
Name
Owner
Status
Updated
Atlas web app
Team A
Active
2 h ago
Billing service
Team B
Active
5 h ago
Atlas mobile
Team A
Active
Yesterday
Onboarding flow
Team C
Paused
Yesterday
Data export
Team B
Active
Oct 29
Atlas API
Team D
Active
Oct 28
query-wedge · , lively
query-wedge-demo.tsx
When to use
Use on the heading of a filtered list with one text query: typing does not move the title, Enter sends the query into it as a pill that updates the counter, and the pill removes the filter.
When not to use
Not for many combined filters such as status, owner and date: use Filter Bar or Leapfrog Title. Not for search that filters live while typing.
Use Query Wedge on the heading of a filtered list: projects, tickets, customers. Typing never moves the title. When the person presses Enter, the title's word and its counter step apart, the query leaves the field as a ball, drops into the gap and stretches into a pill that pushes the counter to the new number: "Projects [atlas ×] · 4". The heading now says what you are looking at and how much of it there is. The pill is the button that removes the filter. For many combined filters (status, owner, date), use a filter bar with chips; Query Wedge is for one text query.
QueryWedge holds the confirmed filter (query, defaultQuery, onQueryChange; null is no filter) and connects its parts, which can sit anywhere inside it: the ball always starts from the field's caret, wherever the field is.
QueryWedgeField is the search input in its frame: Enter confirms, Backspace in the empty field removes the filter. Its props go to the input (value, onChange, aria-label, ...), className styles the frame.
QueryWedgeTitle is the heading row: children are the title words, count the number for the current filter, as the heading level (h2 by default). onLand is called when the number changes: apply the list filter there and the list answers together with the number. Replacing the filter (a new query while one is shown) is a single moment: the pill breathes in, morphs to the new word's width and the counter rides its edge to the new number. formatCount, removeLabel and announce adapt the text to your language. Without QueryWedge, pass query and onRemove to the title directly.
QueryWedgeMatch marks the filter's hit inside a list cell (children is the text). Inside QueryWedge it follows the title: the mark sweeps in, in primary, at the moment the pill lands, row after row (index, total delay capped), so the eye goes from the pill to the rows it kept. Outside it, pass query.
Presets: section (default, 26 px title), page (32 px, the page's own heading) and compact (21 px, dense cards). Below 420 px of width the larger presets use the compact metrics. wedge swaps the pill for a tile, a ball or any SVG path. The pill never grows past the room left before the counter: a long query ends with an ellipsis in the pill (the full query is its tooltip and accessible name).
Set the character for the whole app with MotionKitProvider, or per instance with temperament (calm, lively, playful). It changes motion intensity only, never the drawing.
A replaced filter now plays one swap moment instead of an exit followed by an enter, and onLand fires once per change (it used to replay the previous filter's landing first).
The pill uses the soft MotionKit dialect: tinted primary shadow and rim light instead of the ink rim and flat offset shadow. The field has a 1 px input border.
The heading holds the full text for screen readers ("Projects, filtered by atlas, 4"); the moving words are aria-hidden.
The pill is a native button named "Remove filter atlas". It is focusable only at rest; activating it removes the filter and returns focus to the field.
A polite live region announces "Filtered by atlas: 4 results" and "Filter removed: 128 results" once the number has changed.
QueryWedgeMatch uses a native mark; its sweep is decorative and the text never changes contrast (it stays the row's color, in semibold).
The pill uses primary with primary-foreground text, darker on hover and press; the counter uses muted-foreground, AA in both themes. Its focus ring stays inside the 8 px gap around it.
No charge, flight, stretch, squash or clack: the pill fades in at its place, the words jump to their new position and the number swaps. On removal the pill fades out first, then the counter moves back. A replaced filter takes its new width at once and its label fades in. QueryWedgeMatch marks are shown without the sweep.
Transform and opacity on the words, the counter and the label; the ball and the pill are one SVG path redrawn with real radii, never scaled.
Each moment starts once per change: the start effect is keyed to the run, never to callback identity.
Everything is measured once when a moment starts. One requestAnimationFrame loop runs only during the moment, about 860 ms.
At rest a ResizeObserver keeps the pill aligned with the title when fonts load or the width changes.
Technical sheet
Motion
calm
260 ms · bounce 0
lively
400 ms · bounce 0.3
playful
540 ms · bounce 0.45
Main spring of each temperament. Set it with the temperament prop or MotionKitProvider; the default is lively.
Size
Not measured yet · budget 15.0 kB gzip
Component and MotionKit helpers; excludes react, react-dom.
Dependencies
motion
Triggers
typing, a keyboard shortcut, click, a value change
Reduced motion
No charge, flight, stretch, squash or clack: the pill fades in at its place, the words jump to their new position and the number swaps; on removal it fades out. A swap takes its new width at once; hit marks skip the sweep.
Keyboard
Enter
In the field: confirms the typed query, which flies into the title
Backspace
In the empty field: removes the filter
Tab
Reaches the filter pill in the title; Enter or Space on it removes the filter and returns focus to the field
Browsers
Last 2 versions of Chrome, Edge, Firefox and Safari (iOS 16.4+)