suiss/ui · Component
Tab Bar
A floating bottom navigation bar whose overflow and extra sections expand from a More button.
Tab Bar is an open-source component from suiss/ui for React, React Native, SwiftUI and Jetpack Compose. The @esuiss/ui CLI copies its source into your project, so you own the code.
TabBar renders a fixed nav centered at the bottom of the screen. TabBarList holds the primary TabBarItem buttons. TabBarTrigger is the More button: pressing it expands TabBarContent above the list, with a spring animation, to show TabBarSection columns. Each section has a TabBarSectionTitle and a set of TabBarLink entries.
The list measures itself and moves items that don't fit into the expanded content, where they appear as links. When every item fits and there are no sections, the More button is hidden. Use TabBar for top-level navigation on any screen size; for in-page panels, use Tabs, and for an app's side navigation, use Sidebar.
Installation
Works in any project with a components.json. See Installation for the one-line registry setup. Or use the suiss/ui CLI:
Usage
Composition
Use the following composition to build a TabBar:
Examples
Open
Set defaultOpen on TabBar to render with the sections expanded on mount; an outside click closes them.
Fits without more
Hides the More button because every item fits and there are no sections.
Overflow into more
Holds more items than fit, so the extra items move behind More and appear there as links. Choosing an overflowed item closes the bar.
Links
Use the render prop to render a TabBarItem as a link or router link. Set isActive to mark the current page.
Set asChild on a TabBarItem and pass a link or router link as the child. Set isActive to mark the current page.
Pass a render function to a TabBarItem that returns a link or router link with the props it receives. Set isActive to mark the current page.
Disabled item
Set disabled on a TabBarItem to disable one item in the list.
Accessibility
TabBaris anavigationlandmark; name it witharia-label.- Active items and links set
aria-current="page". - The More button sets
aria-expandedandaria-controlsto point to the content. Escapecloses the open bar and returns focus to the More button. A pointer press outside the bar also closes it.- While open, the list is
inert. Items moved into the overflow are hidden from assistive technologies and removed from the tab order in the list, and appear as links in the content instead. - When the More button isn't needed, it's hidden and removed from the tab order.
API Reference
TabBar
The floating nav container that holds the open state.
| Prop | Type | Default |
|---|---|---|
open | boolean | - |
defaultOpen | boolean | false |
onOpenChange | (open: boolean) => void | - |
Also accepts the props of React.ComponentProps<"nav">.
Use defaultOpen for an uncontrolled bar, or open with onOpenChange to control it; onOpenChange is called when the More panel opens or closes. Give the nav a name with aria-label. The bar sits above the safe-area inset at the bottom of the screen, and animations are removed when reduced motion is preferred. Child components can read the bar's state with the useTabBar hook, which throws if it's used outside a TabBar.
TabBarList
The row of primary items; items that don't fit move into the content.
Also accepts the props of React.ComponentProps<"div">.
TabBarItem
A primary destination in the list, rendered as a button by default.
| Prop | Type | Default |
|---|---|---|
isActive | boolean | false |
Also accepts the props of useRender.ComponentProps<"button">, React.ComponentProps<"button">.
Also accepts the props of React.ComponentProps<"button">, plus asChild.
Also accepts the props of React.ComponentProps<"button">, plus a render function.
isActive marks the item as the current page with aria-current="page". An item can render as a link or router link, as in the Links example.
TabBarTrigger
The More button that expands and collapses the content.
Also accepts the props of React.ComponentProps<typeof Button>.
TabBarContent
The expandable area above the list that holds overflowed items and sections.
Also accepts the props of React.ComponentProps<"div">.
TabBarSection
A column of related links in the content.
Also accepts the props of React.ComponentProps<"div">.
TabBarSectionTitle
The heading of a section, marked with a small dot.
Also accepts the props of React.ComponentProps<"div">.
TabBarLink
A link inside a section that closes the bar when chosen.
| Prop | Type | Default |
|---|---|---|
isActive | boolean | false |
Also accepts the props of useRender.ComponentProps<"a">, React.ComponentProps<"a">.
Also accepts the props of React.ComponentProps<"a">, plus asChild.
Also accepts the props of React.ComponentProps<"a">, plus a render function.
isActive marks the link as the current page with aria-current="page".
Each part sets a data-slot, such as tab-bar-item or tab-bar-content, for styling. TabBar sets data-open, data-overflowing and data-sections, the trigger sets data-idle when it's hidden, and items and links set data-active.
Web preview
TabBar is built on the tabs primitive and sits at the bottom of a screen. TabBarList is a rounded capsule with a shadow, inset from the screen edges, so the bar floats above the page. The root adds bottom padding for the safe area, minus any inset an enclosing Screen already handles, and never less than 12 points. TabBarItem stacks an icon over a short label; the active tab sits on a bg-secondary pill and uses text-primary and a filled icon weight.
Use it for switching between the top-level sections of an app. For switching views within a screen, use Tabs.
Installation
- Install the following dependencies:
-
Copy the primitives it uses into
components/primitives:
- Copy and paste the following code into
components/ui/tab-bar.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
-
Copy the primitives it uses into
components/primitives:
- Copy and paste the following code into
components/ui/tab-bar.tsx:
- Update the import paths to match your project setup.
- Install the following dependencies:
-
Copy the primitives it uses into
components/primitives:
- Copy and paste the following code into
components/ui/tab-bar.tsx:
- Update the import paths to match your project setup.
-
Target iOS 17 or later.
-
Add the Swift package to your app:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Add the files to your app target.
- Apply the Compose compiler plugin, enable Compose, set
compileSdkto 37 or higher andminSdkto 24 or higher, and add the dependencies:
- Copy the theme files every view uses:
- Copy the source and every file it uses:
- Update the
com.esuiss.uipackage names to match your project.
Usage
Examples
Without badges
The tab bar without badges.

Large badge
Set badge to a number or text. A count above 99 shows as 99+, and a string shows as a text badge.

Disabled item
A tab bar with one disabled tab.
Web preview
Accessibility
- The list has the
tablistrole and each item has thetabrole, with selected and disabled states. - A badge with a count or text is exposed as the tab's accessibility value, so VoiceOver and TalkBack read it after the label.
- A dot badge is visual only and is not announced.
API Reference
TabBar
Root that holds the active tab, the side inset and the safe area padding.
Also accepts the props of React.ComponentProps<typeof TabsPrimitive.Root>.
Control the active tab with value and onValueChange, or set defaultValue. A selection haptic plays whenever the tab changes, when a haptics adapter is provided through HapticsContext. The bottom padding is the remaining safe area inset minus 8 points, and never less than 12 points.
TabBarList
Capsule that holds the tabs.
Also accepts the props of React.ComponentProps<typeof TabsPrimitive.List>.
Put TabBarItem entries inside a TabBarList, inside TabBar.
TabBarItem
One tab with an icon, a label and an optional badge.
| Prop | Type | Default |
|---|---|---|
icon | PhosphorIcon | - |
badge | TabBarBadgeValue | - |
Also accepts the props of React.ComponentProps<typeof TabsPrimitive.Tab>.
Give each item a value, an icon and a label as children. The Phosphor icon sits above the label and uses the fill weight when active. badge sits on the icon's corner and takes a number, text or true: numbers above 99 show as 99+, 0 and empty strings show nothing, and true shows a small dot. The TabBarBadgeValue type is also exported.
TabBarBadge
| Value | Parameters |
|---|---|
.dot | - |
.count | Int |
.text | String |
TabBar
Root that holds the active tab, the side inset and the safe area padding.
| Parameter | Type | Default |
|---|---|---|
selection | Binding<Value> | - |
content | () -> Content | - |
TabBarItem
One tab with an icon, a label and an optional badge.
| Parameter | Type | Default |
|---|---|---|
_Â title | LocalizedStringKey | - |
value | Value | - |
icon | Image | - |
activeIcon | Image? | nil |
badge | TabBarBadge? | nil |
verbatim | String | - |
Overloads: init(_:value:icon:activeIcon:badge:), init(verbatim:value:icon:activeIcon:badge:).
TabBar
Root that holds the active tab, the side inset and the safe area padding.
| Parameter | Type | Default |
|---|---|---|
value | String | - |
onValueChange | (String) -> Unit | - |
modifier | Modifier | Modifier |
content | @Composable RowScope.() -> Unit | - |
TabBarItem
One tab with an icon, a label and an optional badge.
Receiver: RowScope.
| Parameter | Type | Default |
|---|---|---|
value | String | - |
label | String | - |
icon | ImageVector | - |
modifier | Modifier | Modifier |
selectedIcon | ImageVector? | null |
badge | String? | null |
enabled | Boolean | true |

