# Tab bar

- **[Atoms](/components/)**

An app's main places as a bar at the foot of a phone screen, beside a Sidebar that takes over on wider screens.

## Preview

tab-bar.tsx

```
import { Layers, Library, Sparkles } from 'lucide-react';
import { Theme } from '@/components/klarhimmel/theme/style';
import { TabBar } from '@/components/klarhimmel/ui/tab-bar';

export default function Example() {
  return (
    <Theme theme="brand">
      <TabBar items={[{ href: '/portal', label: 'Assistant', icon: Sparkles, current: true }, { href: '/projects', label: 'Projects', icon: Layers }, { href: '/library', label: 'Library', icon: Library }]} />
    </Theme>
  );
}
```

## Import

- **CLI**

  ```
  npx shadcn add https://ui.klarhimmel.com/r/tab-bar.json
  ```
- **Import**

  ```
  import { TabBar } from '@/components/klarhimmel/ui/tab-bar';
  ```

- **Files**: tab-bar.tsx, in components/klarhimmel/ui/. With it: theme, utils.
- **Render in**: Render it inside <Theme>, once near the root of your app. Tokens and fonts are scoped to it, so outside it the component is unstyled.

## Props

- **items**: Required. Three to five places; icon is a component such as a lucide icon.
- **label**: The nav's accessible name.
- **link**: Renders each tab, for a router's Link; keep className and aria-current.
- **className**: Extra classes, merged after the component's own.

[Previous](/components/page-preview-card)

[Next](/components/board)
