Skip to the page
Supply UI

Tabs panel

In code: TabsPanel

A part of Tabs: use it inside one.

The content of one tab in Tabs, shown when the Tab with the same value is chosen

Preview

3 bookings this week, the next on Friday at 09:30

Use

The code of the preview above
import { Tab, Tabs, TabsList, TabsPanel } from '@/components/ui';

<div className="ui-grow">
  <Tabs defaultValue="upcoming">
    <TabsList aria-label="Bookings">
      <Tab value="upcoming">Upcoming</Tab>
      <Tab value="past">Past</Tab>
      <Tab value="cancelled">Cancelled</Tab>
    </TabsList>
    <TabsPanel value="upcoming"><p>3 bookings this week, the next on Friday at 09:30</p></TabsPanel>
    <TabsPanel value="past"><p>128 bookings since March</p></TabsPanel>
    <TabsPanel value="cancelled"><p>2 cancelled in November, both moved to December</p></TabsPanel>
  </Tabs>
</div>

This page as text, for an AI

Options

OptionTypeWhat it does
className stringMore classes on the outer element, for layout around it (margins, grid placement), not to restyle it.

It also takes the 283 attributes of the element or UI SDK part it draws: className, aria-label, events and the rest.

Without React

The same look on any HTML, with the classes ui-tabs…, ui-tabs-list--pills.

With the CSS in parts (/ui/css/), it needs these, besides the ones every page loads:

components/tabs.csscomponents/small-things.csscomponents/calendar.css

In the examples

Small screens made with it and the rest of the kit. They work: click, type and choose in them.

In€4,320.00
Out€831.00
Left€3,489.00
Kestrel StudioWebsite€1,200.00
Lumen BakeryMenu design€340.00
Northwind JoinerySignage€2,780.00
In, out, and what is left Three numbers on top, the rows under two tabs
Ines DuarteTutor · Maths and physics
  • Algebra, TomMon 16:00
  • Forces, LeaTue 17:30
Sections on one page Pills switch what the profile shows

Showing things: states, do and don’t

States. Lists, tables and boards have three more states besides their content: empty (Empty, with the first action inside), loading (Skeleton) and failed (Alert tone="danger"). A chosen row shows in ink, never in the brand colour.

Do

  • Put numbers, dates and codes in ui-mono (in a table cell, ui-num, which also aligns them).
  • Let a Table turn into blocks on a phone; give it scroll only when it is read down its columns.
  • Show a status in words and colour together (Badge tone="success" with "Paid"), never colour alone.

Don't

  • Don't put a card round a Table, List, Cells, Calendar or Empty: they draw their own box.
  • Don't truncate a name or a price to fit; let it wrap. Truncate only file names and addresses.
  • Don't use the status colours (success, warning, danger, info) for anything but those meanings.