Skip to content
caliper ui docs

Pro

Swipe tabs

Tabs for touch: swipe the content and the next panel follows the finger while the indicator slides in step.

Pro
pnpm dlx shadcn@latest add @caliper/swipe-tabs

Sales inbox

Maya Chen’s threads for the week of 19 October

  • Ostra: security review
  • Kestrel: DPA signed
  • Tide Physio: demo booked
  • Priya mentioned you in Halberd renewal
  • Tomás mentioned you in Q4 forecast
  • Price the second Palisade property
  • Send Lumen the annual quote
  • Ostra order form sent
Installs components/ui/swipe-tabs.tsxDepends on none beyond ReactMotion honours reduced motion

When to use

Use it for

  • Phone screens with a few sibling views.
  • Feeds and filters people flick between.

Skip it when

  • Desktop settings with many tabs; use tabs.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/swipe-tabs

Adds its 2 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

Usage

Import it from your copy of the source. The example behind the preview comes with the source.

example.tsx
import { SwipeTabs } from "@/components/ui/swipe-tabs"

The worked example comes with Pro

The 36-line example behind the preview opens here, ready to copy.

  • 626 Pro parts, blocks and page templates, all with source
  • $149 once, with lifetime updates. No renewal
  • A full refund within 14 days if it is not for you
Checking your licence…

API reference

SwipeTabs

component
PropTypeDefault
tabs *readonly SwipeTab[]—
label *string—
defaultValuestring—
onValueChange((id: string) => void)—
classNamestring—

Accessibility

It exposes tab, tablist and tabpanel semantics, with aria-label, aria-selected, aria-controls, aria-hidden and aria-labelledby kept in step with state.

KeyBehaviour
→Moves to the next item or value.
←Moves to the previous item or value.
HomeJumps to the first item or the minimum.
EndJumps to the last item or the maximum.

Motion

It checks prefers-reduced-motion itself and settles immediately instead of travelling. Every state is still reachable.

All Compare & browse examples