Patterns

How components come together into pages.

Reach for it when
  • Starting a new page or view: match the closest pattern before designing from scratch.
  • Adding an empty, loading or error state.

The short version

If you read nothing else on this page, read these.

Custom domains
No custom domains yet. Add one to serve your docs from your own URL.
Do. Empty is one sentence and one action, inside the card the content would fill.
Custom domains
🌵Oops! Nothing here!It looks like you haven't set anything up.
Don't. Fill the gap with a mascot and a joke. The user still doesn't know what to do.
Do. Open detail beside the list. The list stays visible and keeps its selection.
Don't. Cover the list with a modal to show one record. The context is gone.

Page patterns

Match the closest one before designing from scratch. Each sketch is drawn with the real surface tokens.

Page layout

A page is a title row, a toolbar, then framed content. Analytics and Feedback are the reference.
4 rules
  • text-title page title at the top left, the primary action at the top right.
  • A toolbar row below the title holds filters and view toggles; it is not inside a card.
  • Stat tiles come before detail. Charts and tables each sit in their own surface-card.
  • Page width is fluid up to the content max; cards stretch, text columns don't.

Lists and tables

Rows are the unit. Hairlines separate them, bg-hover on hover, bg-selected when chosen.
4 rules
  • Primary identifier first, in mono if it's a domain, version or ID.
  • Status is a StatusBadge; time is relative with the exact value in a tooltip.
  • Row actions live in a trailing ghost icon button that opens a menu.
  • Empty tables show one sentence and the create action inside the card, not a blank grid.

Picking repositories

Every GitHub repository picker uses RepositoryPicker: it handles connecting GitHub, installing the Fern GitHub App, errors and the list, for one repository or several. Put it inline when picking is the step's main job. Elsewhere, show what's picked with PickedRepositories and edit it in RepositoryPickerDialog. Don't build a picker from AccountSelect or RepositoryList.
4 rules
  • Put RepositoryPicker inline when picking repositories is the step's main job.
  • Everywhere else, show the picks with PickedRepositories and edit them in RepositoryPickerDialog.
  • RepositoryPicker owns connecting GitHub, installing the Fern GitHub App and errors; don't rebuild them.
  • Don't build a picker from AccountSelect or RepositoryList; Biome blocks it.

Side panels

Detail opens beside the list, never over it. The list stays visible and keeps its selection.
4 rules
  • Use AnimatedSidepanelContainer with a PanelResizeSeparator; set min, max and initial widths.
  • The panel has its own header with the title and a close button; Escape closes it.
  • Edits in the panel save on their own; the list updates in place.
  • On narrow screens the panel takes the full width and the list becomes a back link.

Empty, loading and error

Every view has all three, in its story. They keep the layout and tell the user what happens next.
4 rules
  • Loading is a skeleton with the shape of the content. Spinners only follow a click.
  • Empty is one sentence and one action, inside the surface the content would fill.
  • Errors use Note variant="error" with the retry action next to the message.
  • Partial data is shown; only the failed part gets the error.

Confirmations and destructive actions

Removing is reversible and quick; deleting is confirmed and explained.
4 rules
  • Remove detaches and can be undone from the toast. Delete destroys and opens a dialog.
  • The dialog names the thing and the consequence; the confirm button repeats the verb.
  • Destructive buttons use destructiveOutline in place and destructive only inside the confirmation.
  • Destructive settings sit last on the page, in their own card.

Forms and settings

One card per concern. Each card has its own Save, enabled only when something changed.
4 rules
  • Label above the field, help text below, error replaces the help text.
  • Switches apply immediately and confirm with a toast; text fields wait for Save.
  • Keep the primary button at the bottom right of the card; Cancel is a ghost beside it.
  • Advanced options are collapsed by default, under a plain disclosure, not a tab.

Keep going

Components
Shared components, from single controls to whole features.
Content
Write plainly with sentence case. Follow these guidelines to ensure you do so.
Surfaces
Introduce layering of components with ease.