Skip to content
omaris

Build

Choosing a component

The look-alikes, told apart. Find the situation, take the component.

Most wrong choices are between two components that look the same and mean different things. Each table below is one of those families. Find the row that sounds like your situation; the component in it is the answer, and its page opens with the same "Use it for / Not for" so you can check.

Something to press

The situationUseBecause
The one action the screen is aboutButton filledOnce per view. Everything else steps down.
The other actions beside itButton tonal / outlined / textThe emphasis ladder, in that order.
The action is only an iconIcon ButtonSame tones, its own geometry, aria-label required.
The screen's main action, floating, on a phoneFABOne per screen. Sits above the content.
One action plus a menu of alternativesSplit ButtonThe wide half acts, the narrow half opens the rest.
A few related actions that read as one controlButton GroupLayout only; the buttons stay plain.
A list of actions hanging off a triggerMenuActions, not values.
A small action inline with content — "add filter", "assist"ChipThe assist chip.
Navigation to another pageButton href, or a plain linkA link is a link; variant="link" inside a sentence.

Something to choose

The situationUseBecause
One of a few options, all visible, mutually exclusiveSegmented ButtonTwo to five options, short labels.
One of a few options, in a formRadioThe choice is submitted, not applied.
One of many optionsSelectA styled list of values.
One of many, and you have to search for itComboboxType to filter; load for the server.
An on/off that takes effect immediatelySwitchA setting. Nothing to submit.
A yes/no that is submitted with the formCheckboxAlso "select this row".
Several of many, above a listfilter ChipsThe filter bar.
A number in a rangeSliderPrecision does not matter; the feel does.
A colour, a phone number, a price, an emojiColor Picker, Phone Input, Price Input, Emoji PickerEach one stores the right value and shows the right keyboard.

Something to type

The situationUseBecause
One lineText FieldLabel, supporting text, affixes, clear, password eye — built in.
One line with a shape — a slug, a decimal, a card numberText Field with formatRejects what does not fit as it is typed.
A few linesTextareaautosize for a composer.
Formatted proseRich Text EditorA contenteditable and a toolbar; nothing heavier.
CodeCode EditorA real textarea with a painted highlight layer, vim optional.

Something on top of the page

The situationUseBecause
A decision the person must make before continuingDialogInterrupts. await dialog.confirm(…) for the common case.
A task that keeps the page in view — edit, filter, detailsSheetA side panel on a laptop, a bottom sheet on a phone.
A list of actionsMenuAnchored, dismisses on choice.
A word or two about a control, on hoverTooltipNever for anything the person must read.
A picture, full screenImage ViewerTap to lift it off the page.
A first-run walkthroughTourA spotlight, one thing at a time.

Telling the person something

What happenedShowBecause
Something succeeded or failed, brieflyToastNever blocks; toast.promise follows the request.
Something about this page, that staysAlertA banner in the content, with a tone.
Something is on its wayProgress or SkeletonA bar when there is a known amount; a skeleton the shape of what is coming.
There is nothing to showEmptyWith the one action that changes that.
A count, or a status, on somethingBadgeA pill on its own, or a dot on an icon.
Something that needs a decisionDialogSee above.

More on this in Feedback.

Something to hold content

The situationUseBecause
A unit of content — one order, one metricCardDefaults to outlined; a grid of them usually wants elevated.
Rows of one to three lines eachListSwipe actions on a phone.
Rows with columns, sorting, selectionTableServer-side paging when it is big.
Sections that expand one at a timeAccordionContent in the page, not off it.
Sections that swapTabsWithin a page — not app navigation.
Panels the person can dragResizableRemembers the layout.
Media, side by side, swipedCarouselFive layouts.
Photos of different heightsMasonryThe photo wall.
Cards you drag between columnsKanbanA board, not a table.

Getting around

The situationUseBecause
Top-level destinations, on a laptopNavigation Drawercollapsed is the rail; responsive makes it modal on a phone.
Top-level destinations, on a phoneNavigation BarThree to five, at the bottom.
The title of this screen and its actionsTop App BarPass sticky.
Where you are, in a hierarchyBreadcrumbCollapses in the middle.
Views within a pageTabsPrimary on top, secondary nested.
Pages of a long listPaginationOr the Table's own.
Sections of a long pageTable of ContentsThe rail on the right of this page.
Searching the whole appSearch BarThe bar and the view it opens into.

Showing data

The situationUseBecause
A number over timeLine or Area ChartTime goes on the x axis.
Numbers by categoryBar ChartCategories are bars.
One number against its rangeGaugeThe dial.
A trend inside a statSparkline, from ChartsNo axes; the shape is the point.
PlacesMapomaris/map, opt-in.
Code, read-onlyCode BlockHighlighted, copyable.
A change between two versionsDiff ViewerUnified or split.
A JSON payloadJSON ViewerCollapsible and searchable.
A stream of log linesLog ViewerLevels, ANSI colour, follow.
Any string on the screenTextThe variant is the whole type decision.