FilterChip
A Jetpack Compose FilterChip component for displaying toggleable filter options.
Android
Expo UI FilterChip matches the official Jetpack Compose FilterChip API and displays a compact, toggleable element used to filter content.
Installation
Terminal
- npx expo install @expo/uiIf you are installing this in an existing React Native app, make sure to install expo in your project.
Usage
Basic filter chip
BasicFilterChipExample.tsx
import { useState } from 'react'; import { Host, FilterChip } from '@expo/ui/jetpack-compose'; export default function BasicFilterChipExample() { const [selected, setSelected] = useState(false); return ( <Host matchContents> <FilterChip label="Favorites" selected={selected} onPress={() => setSelected(!selected)} /> </Host> ); }
With leading icon
Use the FilterChip.LeadingIcon slot component to display an icon before the label.
FilterChipWithLeadingIconExample.tsx
import { useState } from 'react'; import { Host, FilterChip, Text } from '@expo/ui/jetpack-compose'; export default function FilterChipWithLeadingIconExample() { const [selected, setSelected] = useState(false); return ( <Host matchContents> <FilterChip label="Images" selected={selected} onPress={() => setSelected(!selected)}> <FilterChip.LeadingIcon> <Text>📷</Text> </FilterChip.LeadingIcon> </FilterChip> </Host> ); }
Disabled chip
Set the enabled prop to false to prevent user interaction.
DisabledFilterChipExample.tsx
import { Host, FilterChip } from '@expo/ui/jetpack-compose'; export default function DisabledFilterChipExample() { return ( <Host matchContents> <FilterChip label="Unavailable" selected={false} enabled={false} onPress={() => console.log('This will not fire')} /> </Host> ); }
API
import { FilterChip } from '@expo/ui/jetpack-compose';
Component
Type: React.Element<FilterChipProps>
A filter chip component following Material 3 design guidelines.
Supports slot-based LeadingIcon and TrailingIcon children.
Optional • Type:
React.ReactNodeChildren containing LeadingIcon and TrailingIcon slots.