Raft Design System

Patterns

Choosing a component

Which component to use when people pick something, when you tell them something, for what floats above the page, while they wait, and for a row.

Several components can look right for the same job. These tables pick one per situation. Each component's own doc says how to use it once chosen.

When it applies

Whenever you put a control, a message, a popup or a row on a screen. Products don't override these choices; a product-specific case goes on the product's page.

Rules

Picking something

You needUse
To act on one thingA menu (DropdownMenu); press and hold on a phone opens the same menu (ContextMenu)
Yes or no, applied at onceSwitch
Yes or no, applied on SaveCheckbox
One of 2 to 5 answers, submitted with a formRadioGroup
Another view of the same contentSegmentedControl
Sections of one page, each with its own contentTabs
One of up to 10 valuesSelect
One of many valuesA select with a search row at the top of its list (ComboboxSelect)
A few of several valuesA multi-select: a box before each item, and the field shows the chosen values (ComboboxSelect with multiple)
A few of many values (people, agents, labels)A multi-select with search: chosen values become chips in the field, and typing continues after them (ComboboxSelect with multiple, or Combobox with its chips)
To filter a listA filter: a select or combobox opened from a PickerTriggerButton
To change one property of an item in placeThe value in a DescriptionList opens a picker

Telling people something

SituationUseStays
Something the person just did has a resultToastA few seconds
They need to know it before actingBanner, inside a dialog or formAlways
Something in one panel failed: an agent won't start, a setting didn't saveA full-width banner under the panel header (PanelNotice, Panel)Until it is fixed
The state of the whole workspace: a computer offline, a quota nearly full, an updateThe notification center (NotificationCenter), with an attention dot on the bellUntil it changes
Something happened elsewhere that the person should seeActivity (ActivityInbox); its entry point shows an attention dot or a countUntil it is read
An agent needs approvalAn action card in the conversation (MessageActionCard), also listed in ActivityUntil it is handled
The person must decide nowDialogUntil they decide
An input is invalidThe input's error state (Field)Until it is fixed
What an icon meansTooltipWhile hovered
  • Never put anything in a toast that would confuse people if they missed it.

Overlays

SituationUse
One sentence on hoverTooltip
A person or agent, on hoverA profile card (PreviewCard)
A list of actions, on click or press and holdDropdownMenu
One value, on clickSelect, with search when there are many values
Several values, on clickA multi-select, with search when there are many values. Choosing a value doesn't close the list
A little input, on clickPopover
Details and settings people look at for a whileDrawer
A large form filled in one passThe wide Dialog; see Forms
A place to go, on a phone (switch workspace, Working now)A bottom sheet (Drawer). Picking a value is still a select list; acting on something is still a menu
A short explanation, on a phoneA bottom sheet (Drawer)
A confirmationAlertDialog
Task detailsA centered dialog, at most 760px wide, full screen on a phone (Tasks)
  • Put a scrim behind every centered overlay: dialogs, confirmations, search, task details, large forms. How overlays move is in Motion.

Waiting

SituationUse
The layout is knownSkeleton
The duration is unknown, and there is no layout to holdThe pixel spinner (Spinner)
The percentage is knownProgress
A button started the waitThe button's loading state (Button)
  • Don't use pink for any of these. They are passive.

Rows

WhereUse
A phone list: channels, direct messages, settings, membersListRow
Agents and people on a detail or profile pageListRow, in an inset group
The desktop sidebarThe sidebar row (Sidebar)
Activity and notificationsInboxItem
A message found by searchThe search result row (Search)
A taskTaskCard, on a board or in a list
  • Composites: things built from these components.
  • Feedback: errors by scope.
  • Forms: which controls apply at once and which are saved.