Olddevs UI4.14.0

How to choose a component

Choose by the meaning of the action and by the state, not by the shape that is easier to build. If the rule below does not fit, open the component catalog and the page of the closest candidate before writing JSX.

TaskUseDo not use insteadReason
Pick a value from a known finite setSelectComboboxSelect does not allow a new value; search only filters the set.
Enter a value with a list of options or allow a new oneComboboxSelectCombobox supports free input when the contract allows it.
Pick exactly one modeSegmentedToggleGroupA mode always has a value; an empty state is not allowed.
Turn on zero, one or several independent conditionsToggleGroupSegmentedAn empty set is legitimate for filters and settings.
Confirm a deletion or another dangerous actionConfirmDialogDialogalertdialog, an explicit destructive action and a safe initial focus point.
Show ordinary modal content or a formDialogConfirmDialogAn ordinary dialog must not pretend to be a critical confirmation.
Show a screen's shortcut referenceShortcutsHelpDialog with Kbd / Keyboard elements scattered through itNamed groups and the spoken form of a shortcut ("Ctrl plus K") are already in the component; Keyboard is an on-screen keyboard for input, not a shortcut.
Show a short result of a completed operationtoast + ToasterAlertA toast is temporary and does not take permanent space on the page.
Show a persistent important message in contextAlerttoastThe user must see the message for as long as it is relevant.
Show an entity's statusStatusBadgeBadgeStatus is a closed semantic set; its tone conveys the meaning.
Show a countBadgeStatusBadgeA counter says "how many", not the entity's lifecycle.
Navigate to a URLLink or Button asChild with <a>Button onClickA real link lets users open it in a new tab and copy its URL, and keeps the correct role.
Give an additional short explanationTooltip / HelpTooltiphidden text without a nameA tooltip does not replace a label and the main content.
Show an entity preview on hover over a link or nameHoverCardTooltip / PopoverA card with rich content opens on hover and keyboard focus; it is absent on touch devices, so everything important must be available without it.
Report the state of the whole appBannerAlertAlert describes the state of one area of the page; a banner survives navigation.
Show what happened to the selected filesUploadQueueFileDropzoneThe dropzone provides files, the queue shows what became of them.
Show a feed of events that occurredNotificationListTimelineIn a feed, time sets the order and there are actions; in Timeline, the order is set by the process.
Show a tile with a preview and actionsMediaCardCardFor a tile the main things are a proportionally scaled preview, an overlay and selection.
Let the user set the orderSortableListTable with sortingIn a table the order is computed; here it is assigned by a person.
Show hundreds of previewsVirtualGrida plain CSS gridOnly the visible cells live in the DOM; the consumer sets the container height.
Copy a value to the clipboardCopyButtona hand-built button with an iconThe result is announced, and a clipboard failure is shown rather than swallowed.
Truncate long textTruncatetext-overflow by handThe tooltip appears only when the text is actually truncated and is keyboard-accessible.

The minimal component rule

Do not create a new local primitive while the semantics you need already exist in @olddevs/ui. But do not move domain data into the package: for example, the status vocabulary, the texts of a specific product and the page layout belong to the consumer.

If there is no component

  1. Check the component catalog and the public icon exports.
  2. Build a domain composition from existing primitives if it is only the layout or text of a specific screen.
  3. Propose a new primitive only when the semantics, API and accessibility requirements repeat, not just because one CSS combination does.

On this page