DocsComponentsTemplatesThemesGitHub

TabBar

Floating glass tab bar for phone layouts.

Code

import * as React from 'react';
import { TabBar } from '@fruit-labs/design';

export default function Demo() {
  return (
    <div
      style={{
        position: 'relative',
        padding: 24,
        borderRadius: 22,
        overflow: 'hidden',
        background: 'var(--bg)',
      }}
    >
      <TabBar
        items={[
          {
            value: 'home',
            label: 'Home',
            icon: 'home',
          },
          {
            value: 'browse',
            label: 'Browse',
            icon: 'compass',
          },
          {
            value: 'library',
            label: 'Library',
            icon: 'photo',
          },
          {
            value: 'me',
            label: 'Profile',
            icon: 'person',
          },
        ]}
      />
    </div>
  );
}

Install

From npm:

npm install @fruit-labs/design

import { TabBar } from '@fruit-labs/design';

Or copy the TypeScript source into your project:

npx shadcn@latest add https://design.fruitlabs.online/r/tab-bar.json

Guidelines

  • 3–5 destinations. Float 16px above the bottom safe area.

Props

PropTypeRequired
itemsArray<{ value: string; label: string; icon: string }>Yes
valuestringNo
defaultValuestringNo
onChange(value: string) => voidNo
labelstringNo
classNamestringNo

Edit this example on GitHub