SwipeUI

Filter bar

Quick filter chips with inline or sheet-based additional controls.

npx @swipeui/cli add filter-bar
Variant
Preset
Material
Scheme
Feel
Real free component with a browser animation bridge. Native motion, haptics and materials need a device.

When to use it

  • Search results and lists with quick filters like Open now, Under $20 and Free delivery.
  • A Filters button that expands inline choices or opens a sheet for advanced options.
  • Showing which filters are active at a glance.

When not to use it

  • Switching views. Use Segmented control.
  • A single toggle. Use Chip.
  • Complex filter forms with many fields; open a full screen.

Installation

Run this from your app's root. If SwipeUI isn't set up yet, run npx @swipeui/cli init first; it sets up Uniwind, the theme tokens and the cn helper.

npx @swipeui/cli add filter-bar
  • Adds components/swipeui/ui/filter-bar.tsx and 17 shared helpers.
  • Installs react-native-reanimated, react-native-worklets, uniwind, clsx, tailwind-merge, expo-haptics, class-variance-authority, react-native-svg, react-native-gesture-handler, react-native-safe-area-context, @expo/ui, @gorhom/bottom-sheet, expo-blur. In Expo apps it uses npx expo install so versions match your SDK.

Usage

app/(tabs)/index.tsx
import { FilterBar } from '@/components/swipeui/ui/filter-bar';

<FilterBar options={filters} />;

API reference

PropTypeDefaultDescription
filterPresentation?"inline" | "sheet"'sheet'

Present extra filters below the chips or in a sheet.

open?boolean—

Extra filters open state, for either presentation.

defaultOpen?booleanfalse

Initial extra-filter state.

onOpenChange?((open: boolean) => void)—

Extra-filter open intent.

activeCount?numberselected quick-filter count

Total active filters, including caller-owned advanced filters.

showReset?booleantrue

Show an inline reset while filters are active.

onReset?(() => void)—

Reset caller-owned advanced filters; quick filters clear through onValueChange.

messages?object—

Text overrides; filters overrides legacy filterLabel.

optionsreadonly FilterBarOption[]—

Available quick filters.

value?readonly string[]—

Controlled selected identifiers.

defaultValue?readonly string[][]

Initially selected identifiers.

onValueChange?((value: readonly string[]) => void)—

Reports selection intent.

filterContent?ReactNode—

Additional filter controls rendered inline or in the free Sheet.

filterLabel?string'Filters'

Trigger label and optional sheet heading.

sheetEngine?SheetEngine'native'

Sheet engine.

disabled?boolean—

Prevent opening or changing filters.

haptics?boolean—

Feedback.

motion?MotionOverride—

Shared press/overlay character.

className?string—

Root classes.

style?StyleProp<ViewStyle>—

Root layout escape hatch.

testID?string—

Root identifier.

Composition and behavior

  • options are quick filter chips; value holds the active ids.
  • filterContent fills the sheet; filterLabel names it.
  • sheetEngine chooses the native or custom sheet.

Behavior and gestures

  • Quick chips update caller-owned selected filters.
  • Additional controls can open in a sheet (the compatible default) or expand inline.
  • Active count and Reset reflect caller-owned quick and advanced filtering.

Accessibility

  • Each filter is a toggle chip with checked state.
  • The Filters button reports expanded state while additional controls are open.
  • The sheet title matches the button label.

Motion

  • Uses the press and overlay motion roles, so it follows your app's feel. Pass motion to tune this one instance.
  • The sheet uses the overlay role; chips use the press scale.
  • Reduce Motion fades the sheet.

Performance

  • Additional controls mount only when opened.

Notes for AI

  • Put advanced controls in filterContent; apply filtering in your app.

Compatibility

Runs onSupported
Expo SDK 57Yes
Expo SDK 58Yes
React Native CLI (with Expo modules)Yes
Expo GoYes
iOSYes
AndroidYes

This table describes API support and static bundle checks. Native runtime, device accessibility and bare Uniwind compatibility remain pending.

Related items