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 site header's menu whose triggers share one panel: it grows out of the trigger, travels and resizes as the pointer moves along, and new content slides in from the side it moved towards. A highlight glides along the triggers and between the links inside, and a panel can show the picture of the link it is on.
The panel grows out of its trigger, then travels and resizes as you move along, with new content sliding in from the side you moved towards.
Give each link a preview and the panel a NavigationMenuPreview, and the link's picture fades in and settles as the highlight reaches it.
A NavigationMenuLink in the list looks like a trigger and has no panel, and the one marked current keeps a tint; a disabled trigger is skipped.
A highlight glides between the links of a panel, across headings and gaps, and icons brighten as it arrives.
Set how far new content travels with --navigation-menu-slide, on a panel or on <body>.
A form that signs an email address up for letters, as the Footer’s newsletter and the Changelog’s release emails do: the box and its button, the wait while it sends, the line that says where the letters will go, and a way back to use another address.
What a Toast and an Alert share: the icon for each kind of message, which rolls into the next when the kind changes, and the type of the title and description beside it.
A bell with how many are unread, which opens the notifications grouped by day, with All and Unread tabs, as a popover or, unless motion is reduced, a bottom sheet on a phone. Three variants: short rows for lots of small news, a feed with actions in its rows, and an inbox archived down to empty with Undo.
Led by the people in it, with what they wrote quoted under them and an invite answered in its row. The answer stays on the row, and the row is read.
Notifications are archived once dealt with, down to an empty list. Archive all read clears what’s been seen, and Undo puts it back until the panel closes.
Short rows, many to a screen, for an app that sends a lot of small news. Under the pointer the time gives way to Mark as read; opening a row marks it read.
A number field with a stepper on each side, whose digits roll up or down when the value is stepped. Typing never rolls.
Step it with the buttons or the arrow keys and its digits roll; typing never rolls.
format takes Intl.NumberFormat options, and Shift steps by largeStep. For money, use the Money input.
Wrap the label in NumberInputScrubArea to change the value by dragging it.
One number formatter for each locale and set of options, made once, so every Kino component writes numbers the same way.
The arithmetic of pages, for the Pagination and the table data: the page count, the range a page shows, and the page that keeps the first item on screen when the page size changes.
ui-sdk’s Pagination: Previous, Next and the pages between them, as buttons or links, in a nav, with First and Last, the range a page shows, a page-size Select and a field to type a page in. Drawn as the Tabs are: the pill slides to the current page, a backdrop follows the pointer, and the numbers roll as the range moves. The row keeps its width on every page and shows fewer pages when it is narrow.
Previous, the page as a field and Next, for a narrow space. Type a page and press Enter, or step with the arrow keys.
A table’s footer: the range the page shows, how many rows a page holds, and the pages. A new page size keeps the first row you saw on screen.
With href, every page is a link, for pages a person can bookmark or share.
First and Last for the ends of a long range, and a field to go straight to a page. The numbers roll as the range moves.
Short of room, Previous and Next keep only their arrows. A row still too wide shows fewer pages around the current one.
A list paged by a cursor: with no count, hasNextPage says whether Next goes anywhere, and the range names only the page.
What Dialog, Alert dialog and Drawer share: the dim behind them, a box that follows its content’s height with the footer on its edge, the close button, and the header, title, description, body and footer; and the sheet look a Popover takes on a phone. Card takes its title and description.
A password field with a button that shows or hides what was typed. Its eye rolls to the crossed eye, the caret stays where it was, and the password hides again when its form is sent or reset.
Own visible to show two fields together.
Show the password, then sign in: it hides again as the form is sent, so the browser never saves it as text.
Use new-password so a password manager offers a strong one, and give each toggle on the page its own toggleLabel. A Password strength under the box shows how strong it is.
How strong a new password is while it is typed: the Meter’s bar, the level in words, and the rules the form asks for, each ticked as it is met. A screen reader hears the level once typing pauses.
Put it under a new password’s box, in the same Field, on a sign-up, reset or change form; never on a sign-in or current password. Its rules tick as they are met and describe the box, and userInputs marks a password built on the person’s name, email or your product’s name as weaker. Every check here is a hint: your server enforces the length and checks the password against a breach list, such as Have I Been Pwned, and says why in the Field’s error. Mask it in session replays as you mask the box, since replays record text.
Weak, Fair, Good and Strong, from estimatePasswordScore. Length counts most, and capitals or symbols earn nothing on their own. Weak warns in red below the notch, Fair is amber, and Good and Strong are green. It is a light estimate with no dictionary: a name and a year (“Michelle1990!”) can still read Strong.
Leave out rules for the bar and the word alone. For a score that knows names, places and words, pass zxcvbn-ts’s through score.
A phone number with its country: a button with the flag and dial code opens a searchable list of countries, the number is formatted as it is typed, a number pasted with its code moves the country to it, and the form gets the number in E.164.
Own value and country, such as a number saved on an account.
Offer only the countries you serve with countries.
Pick a country and type the number: it is formatted as you go, and the form gets it in E.164.
A number pasted or autofilled with its code, or with an exit code such as 00, moves the country to it.
Phone numbers as a field reads and writes them: formatted as typed, a pasted number with its code moved to its country, the caret kept after the same digit, and the value in E.164.
The look a row of choices shares: a muted track, labels that darken on hover, a backdrop under the pointer and a pill in the primary colour. Tabs and Segmented control share it.
The look of content that is still loading: a faint tint of the text colour that breathes slowly. The Skeleton and the charts share it.
A popover that grows out from under its trigger, as wide as the trigger at first, and folds back into it. Content taller than the space left on screen scrolls inside. With presentation auto, a small touch screen opens it as a sheet from the bottom edge, unless motion is reduced.
It grows out from under its trigger, as wide as the trigger at first, and folds back into it.
A trigger with only an icon needs an aria-label.
Content taller than the space left on screen scrolls inside the box.
With openOnHover, it also opens when the pointer rests on the trigger for 200ms, and what is inside stays usable.
Pick where it opens with side and align. It still grows from where its trigger is.