Motion-first React components built on ui-sdk, with docs your coding agent can read and controls an agent in your app can use.
A country's flag, drawn as an SVG so it shows on Windows too, its name in the reader's language, and the short names people search by.
Text cut short shows whole: a label that truncates is marked `data-cut`, and the control around it shows the cut text in a Tooltip, by pointer and keyboard, only while it is cut. Select, Combobox, Breadcrumb, Table, Sidebar and the charts share it.
ui-sdk's Date input: a date typed one segment at a time in the order the locale writes it, where one highlight glides between the segments and each number rolls to its new value. With a time, its segments follow the date's.
Hold the value with value and onValueChange; a value set from outside rolls each number the way it went.
With granularity='minute' the Time input’s segments follow the date’s, joined as the locale joins them, and the value is yyyy-mm-ddTHH:mm. hour and second set how fine the time goes.
Type the date, or step each segment with the arrow keys: the highlight follows you and each number rolls to its new value.
locale sets the order, separators and placeholders; without it, the field follows the browser’s language.
A date outside min and max shows as invalid, and a form won’t submit it.
ui-sdk's Date picker: a date typed in the page's language or picked from the Calendar in a popover, one day or a range in one box, with presets and a clear button. A range stays open until both ends are picked.
For a date that is picked, never typed, DatePickerTrigger writes it in words and opens the calendar. Its children show until a day is picked.
A day and its time are two fields side by side: the Date picker for the day and the Time input for the time, each with its own value.
Type the date in the order the page’s language writes it, or press the calendar button to pick it. The typed date is read on Enter or when focus leaves, and a pick closes the calendar.
In a Field, the label names the field and the date is sent as yyyy-mm-dd under the Field’s name. With required, sending it empty shows the error and focuses the field. A typed day the picker won’t take, such as a Saturday here, fails the same way.
locale sets the order a date is typed and shown in, and the calendar’s names and first weekday: month first in the United States.
DatePickerPresets puts the ranges people ask for most beside the calendar, and the pill slides to the one the value matches. The content’s children sit side by side, so the calendar is the Calendar’s CalendarMonths. DatePickerClear empties the field once it holds a date.
With mode="range" the box holds two dates, and months={2} shows two months side by side, one on a phone. The calendar stays open until both ends are picked, and the value is [start, end], null until then.
Every date calculation in one place: yyyy-mm-dd dates and yyyy-mm months, adding days and months, weeks and month grids, today in a time zone, the locale's first weekday and names, and the matchers and limits for days that can't be picked.
A stack of cards as a ui-sdk primitive, the Carousel's deck: the top card follows a drag and is thrown off by its speed, Previous brings the last one back, and an agent pages it with the Carousel's actions.
Pairs of a label and its value, lined up as a table lines up its columns: details start on one line after their labels, and amounts line up on the end edge over a total. In a narrow column each value goes under its label, and an action beside a value never makes its row taller.
Values start on one line after the labels. DescriptionListAction holds buttons at the row’s end, such as Copy or Edit, and DescriptionListValue keeps the value’s text together beside them. An xs button never makes its row taller.
A long ID breaks onto the next line. truncate on the value cuts it to one line instead, with Copy for the whole.
align="end" lines amounts up on the end edge, as a receipt does, and variant="total" puts the sum under a line. A long label wraps beside its amount.
Numbers line up as they change, and an Animated number rolls each one to its new value.
A dialog that rises into the centre and leaves faster than it came, and is a sheet on the bottom edge of a small screen. Long content scrolls inside, and the box follows its content when that changes height.
Put the second Dialog inside the first one’s content. The first steps back, and Escape closes only the one on top.
When content appears or goes, the box moves to its new height and the footer stays on its bottom edge.
A dialog opened with the open prop needs no trigger. When it closes, focus goes back to what had it before.
It rises into the centre and leaves faster than it came. On a screen under 640px wide it is a sheet on the bottom edge.
Put what can grow in DialogBody. It scrolls, and the header and the footer stay in place.
When the footer’s buttons are the answer, leave the close button out with showCloseButton={false}. Escape still closes it.
A change shown as a diff and accepted or rejected piece by piece: Code diff marks the lines and the words inside them, Text diff the words in running prose, and both follow an after that still arrives.
The changes between a before and an after, by line for code and by word for prose, each with an id that holds while after still arrives, and the text once each change is accepted or rejected.
Without onResolvedChange, the diff only shows what changed.
What a person or an agent decided about each change of a diff: Accept and Reject for one change, Accept all and Reject all for the rest, through onResolvedChange with the press's details.
Each change has Reject and Accept under it, and the page holds the decisions with resolved and onResolvedChange. Once they are made, resolveCode from @/lib/diff-math gives the file: pass it diffCode(before, after), resolved and 'rejected', which keeps before where a change is still open.
Text diff marks the words a suggestion changes in running prose: struck out where they leave, underlined where they arrive.
Pass the suggestion as it is written with complete false: before past what has arrived stays as it is, and the change still being written waits to be decided. Press Rewrite reply to watch one arrive.
A panel docked at one edge of a box that pushes the page aside: its room moves on the layout role while the panel slides with its edge, and under 48rem it is a Drawer. Holds whether it is open, docked and as a Drawer, a shortcut that toggles it, and the wiring of the buttons that do.
Shares of a whole as a ring or, with no hole, a pie chart, with labels, more rings inside and a slice that grows. The slice under the pointer or the keys stays bright while the rest step back and its value rolls into the centre; new data or a slice hidden from the legend moves every slice by its angles from where it is.
DonutChartLabels writes each slice’s value, share or name past the ring, on a short line. A label with no room is skipped.
Each slice moves by its angles to the new month, from wherever it is. The slice under the pointer stays bright while the rest step back, and its value rolls into the centre.
patterns lays a fine pattern over each slice after the first, so slices differ by more than colour, in grey and in print too.
With innerRadius={0} the ring closes into a pie. Labels with position='inside' sit on their slices, in white or black, whichever reads on the colour, and sliceGap={0} closes the gaps.
Each DonutChartRing adds a ring inside for another value of the same slices, such as last year’s. The tooltip gives every ring’s value.
With selected, a press or the menu picks a slice, which stays bright and keeps its value in the centre. With grow, it grows out of the ring too.
Charts in a ChartGroup share the slice under the pointer by its key, so pointing at a region on one lights it on the other.
A map of the world drawn as dots, with places on it by latitude and longitude and lines between them that draw in and pulse. Any part of the world, scaled as one drawing.
A panel that slides in from any edge, start and end following the text direction, and is dragged back to it to close, on the feel’s spring. On the bottom edge it has a handle, follows its content when that changes height and rests at snap points. A drawer opened on top dims or steps back the one below, and an outlet steps the page back with the finger.