SearchCtrlK

  • ↑↓navigate
  • ↵open
  • escclose

Can’t find it? Contact us

TabBar

A phone's bottom tab bar.

InboxWeekly digestYour order shippedReading list: 3 new
View code
tsx
<TabBar label="Primary">
	<TabBar.Item href="/" icon={<HouseIcon />} label="Home" />
	<TabBar.Item href="/search" icon={<SearchIcon />} label="Search" />
	<TabBar.Item href="/inbox" icon={<InboxIcon />} label="Inbox" current />
	<TabBar.Item href="/alerts" icon={<BellIcon />} label="Alerts" count={3} countLabel="3 new" />
</TabBar>

Demo apps

Whole pages built only from @sdxc/ui, each for an invented product with its own palette and type. They open in a new tab.

Every demo, landings and docs sites alike, is listed in the demo gallery.

Installation

An ordinary dependency: install it, import the theme once, and import the component where it is used.

Terminal
npm add @sdxc/ui remix
typescript
import "@sdxc/ui/theme.css";

Usage

typescript
import { TabBar } from "@sdxc/ui/app";

Renders the bar. The outer box keeps the bar's height in the flow while the bar itself is fixed to the viewport's foot, so it reads as one more block at the end of the page; a screen at or above hideFrom draws neither.

Composition

The parts the component publishes, each a static property of the host.

  • TabBar
  • TabBar.ItemOne destination: the whole column is the link, at least 44px square.

Examples

Icons only

View code
tsx
<TabBar label="Primary" showLabels={false}>
	<TabBar.Item href="/" icon={<HouseIcon />} label="Home" current />
	<TabBar.Item href="/explore" icon={<SearchIcon />} label="Explore" />
	<TabBar.Item href="/notifications" icon={<BellIcon />} label="Notifications" count={12} countLabel="12 unread" />
	<TabBar.Item href="/messages" icon={<MailIcon />} label="Messages" />
</TabBar>

Props

Read from the component's own types, so every prop, every default and every allowed value is listed.

PropTypeRequiredDescription
labelstringYesThe landmark's name, such as "Primary".
hideFrom"30rem" | "40rem" | "48rem" | "64rem" | "never"No
showLabelsbooleanNoShows each item's name under its icon; false keeps names for assistive tech alone. @default true
childrenRemixNodeYesFour or five TabBar.Items.

Also accepts everything in TagProps<"nav">.

TabBar.Item

Types

NameValuesWhat it decides
HideFrom"30rem" | "40rem" | "48rem" | "64rem" | "never"The width from which the bar is gone, matching where the app's sidebar appears; never keeps it at every width, for an app made for phones alone.
@sdxc/ui

Can’t find it? Contact us