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.jsonGuidelines
- 3–5 destinations. Float 16px above the bottom safe area.
Props
| Prop | Type | Required |
|---|---|---|
items | Array<{ value: string; label: string; icon: string }> | Yes |
value | string | No |
defaultValue | string | No |
onChange | (value: string) => void | No |
label | string | No |
className | string | No |