Kinetik UI

Dock Bar

.md

A floating bottom navigation bar whose items swell under the finger like a dock.

v1.0.0Live on webreact-native-gesture-handlerreact-native-reanimatedreact-native-worklets
Component preview

Installation

Kinetik CLI
npx kinetik-ui add dock-bar

The CLI copies the source and installs native dependencies with npx expo install, so versions match your Expo SDK. With shadcn: npx shadcn@latest add https://kinetik-ui.dev/r/dock-bar.json

Install manually

  1. Install dependencies
    npx expo install react-native-gesture-handler react-native-reanimated react-native-worklets
  2. Copy the source files
    • components/kinetik/dock-bar.tsx
    View source files

Usage

import { DockBar } from '@/components/kinetik/dock-bar';

<DockBar
  accessibilityLabel="Main"
  value={tab}
  onChange={setTab}
  items={[
    { key: 'home', label: 'Home', icon: ({ color }) => <HomeIcon color={color} /> },
    { key: 'search', label: 'Search', icon: ({ color }) => <SearchIcon color={color} /> },
    { key: 'profile', label: 'Profile', icon: ({ color }) => <ProfileIcon color={color} /> },
  ]}
/>;

Place it at the bottom of the screen above the safe area. icon receives the active state and a colour so your icons follow the theme.

When to use

  • Primary navigation with three to six destinations.
  • Apps with personality where the bar itself is part of the brand.

When not to use

  • More than six items; the dock gets cramped and the magnification overlaps.
  • Screens that need every pixel; a floating dock covers content beneath it.

Notes

  • A tap chooses an item; sliding previews items with a label bubble and a tick per item, and releasing chooses the one under the finger.
  • The bar claims the touch as soon as the finger lands, so it should not sit inside a horizontal scroll view.
  • Under reduced motion the items keep their size; the label still shows while sliding.

Props

DockBarProps

PropTypeDefaultDescription
itemsrequiredreadonly DockItem[]—
valuerequiredstring—Key of the active item.
onChangerequired(key: string) => void—
magnificationnumber1.6Size of the item under the finger relative to rest. Defaults to 1.6.
itemSizenumber48Item size at rest, in pt. Defaults to 48.
hapticsbooleantrueTicks as the finger crosses items. Defaults to true.
accessibilityLabelstring—Accessible name of the bar.
styleStyleProp<ViewStyle>—

Performance and accessibility

Performance

Budget
While touching, one shared value (finger position) drives one transform per item on the UI thread; React renders only when the hovered item changes.
Measured

Pixel 9 emulator, API 35, release build · interaction median 1.50× the system Settings app on the same emulator (indicative only) · no frames drawn at rest · 153 MB app memory

Real-device measurement pending.

Accessibility

Reduced motion
No magnification; items stay their rest size and the label bubble still shows.
Screen readers
Tab list; each item is a tab with its label and selected state, and 'activate' chooses it.
Touch target
Items are 48 pt square by default (minimum 40).

Source files

components/kinetik/dock-bar.tsx is in the Code tab of the preview above.