Tabs

● Stable · v0.1

Top tabs for sectioning one screen — "Sales" and "Customers" under a single "Records" header. The active tab's label goes teal and bold, and an underline slides beneath it. A quiet, full-width header, not a pill.

In context

9:41

Try it

Purpose

Tabs split one screen into a few peer sections the user moves between in place. They sit at the top, under the screen title, and stay put while the content below them swaps. They keep the sections visible so the user always knows what else is there.

Anatomy

  • Baseline — a hairline the tabs sit on, running the full width.
  • Tabs — equal-width labels; each is at least a 44dp tap target.
  • Indicator — a 2dp underline under the active tab, in the brand color, overlapping the baseline so they read as one line.
  • Labels — the active label is brand-colored and bold; the rest are quiet and medium-weight.

Code

import { Tabs } from '@daytwo/components'
const [section, setSection] = useState('sales')
<Tabs
items={[
{ value: 'sales', label: 'Sales' },
{ value: 'customers', label: 'Customers' },
]}
value={section}
onChange={setSection}
/>

For Burmese labels, pass fontFamily (the Noto Sans Myanmar family) so the labels render in the right script.

Tabs vs segmented control

Both switch between views, so pick by job:

  • Tabs — a quiet, full-width header that sections a screen's content (Sales / Customers / Items). The page is "about" these sections.
  • Segmented control — a compact pill that toggles one value in place (Today / This week). It's a control sitting inside content, not a header for it.

When to use

  • To divide one screen into 2–4 peer sections the user flips between without leaving.
  • When the sections are siblings of equal weight and all worth surfacing.

When NOT to use

  • To navigate between top-level destinations (Home, Records, Settings) — that's a bottom tab bar, not top tabs.
  • For a quick value toggle over a number or chart — use a segmented control.
  • For more than ~4 sections — labels truncate and the bar gets unreadable; use a list or menu.

The correct scenario

The Records screen carries "Sales" and "Customers". Tapping "Customers" swaps the list below in place — the owner stays on Records, sees both sections at all times, and never loses their spot.

Anti-patterns

Do
Two to four peer sections of one screen — 'Sales / Customers' — with short, scannable labels.
Don't
Five-plus tabs crammed into the bar ('Sales / Customers / Items / Reports / Settings') — labels truncate and it turns into navigation.
Keep it to a handful

Tabs only work when every label is readable at a glance. Past four, the bar gets cramped on a small phone — move the extras into a list or a menu.

Edge cases

Long Burmese labels
Keep to two or three tabs; let labels sit on one line
WhyBurmese runs longer — four tabs may not fit on a small screen
Many sections
Use a list or menu instead
WhyTabs must stay tappable and readable side by side
Default selection
Always start with one tab selected
WhyThere's no valid "nothing selected" state
Dark mode
Baseline and indicator follow the theme
WhyThe underline stays visible in both schemes

Tokens used

color.brand.primarycolor.text.secondarycolor.border.subtletypography.callout