Chip

A compact chip for a filter, an action or a removable tag, with an optional symbol.

import { Chip } from "@plexui/react-native"

The web has no chip; a filter chip does what Toggle Group does with items of text.

Examples

Overview

Filters

Removable

Disabled

Platforms

iOS 26Android
Native componentNone: drawn as the filter capsules of iOS appsChip (assist, filter, input)
LookA 40pt gray capsule (tag) or a 44pt glass one (glass), filled in the accent when selected; in a Toolbar.Row its label is the segmented control's there, 15pt MediumA 32dp capsule in a light gray fill, or Material's elevated chip (glass: surfaceContainerLow under a level 1 shadow), filled in the Plex primary when selected

API

PropTypeDefaultDescription
childrenReactNode—The label. Without it a chip of an `icon` alone is a circle, named by `accessibilityLabel`
selectedboolean—A filter chip's state (controlled). Leave it, defaultSelected and onSelectedChange out for an action chip
defaultSelectedboolean—A filter chip's initial state (uncontrolled)
onSelectedChange(selected: boolean) => void—Called when a filter chip is toggled
onPress() => void—Called on a press: an action chip's action
onLongPress() => void—A touch and hold on the chip (half a second): what a word means, say. Screen readers reach it as a named action
longPressLabelstring—The name of the touch and hold for screen readers
iconReactNode—A symbol before the label
trailingIconReactNode—A symbol after the label; it takes the chevron's place on a menu chip
menuboolean | "menu" | "listbox" | "dialog"—The chip opens a menu: a chevron after the label and aria-haspopup for screen readers; true is a menu, "listbox" and "dialog" name what it opens. A menu chip is read as a button
expandedboolean—Whether the chip's menu is open (aria-expanded)
accessibilityLabelstring—Name of the chip for screen readers, in place of its label
appearance"tag" | "glass""tag"iOS: a 40pt capsule of the gray fill, or a 44pt glass capsule for filters over content. In a Toolbar.Row its label is the segmented control's there, 15pt Medium (Calendar's segments), at the same 44pt, so a bar's rows of segments and of filters read alike. Android draws its chip with either, a glass one as Material's elevated chip (surfaceContainerLow under a level 1 shadow), which stands apart from what is under it
selectionColor"accent" | "primary""accent"iOS: the color a chosen chip takes, the app's accent (its tint) or the Plex primary. Android keeps Material's selected chip in the primary
size"md" | "sm""md"iOS: `sm` is a 36pt chip with 15/20 type, for a row of filters under a bar. Android keeps Material's 32dp chip
removeStyle"token" | "button""token"iOS: how an input chip is removed: as Apple's tokens, with no cross (a press selects it, a second press or Delete on the web removes it), or by a cross drawn as the field's clear button. Android keeps its cross
onRemove() => void—An input chip: called when the reader takes it back (Android's cross; on iOS see `removeStyle`)
removeLabelstring"Remove"The name of the remove action: the cross's name, or a token's VoiceOver action on iOS
disabledbooleanfalseDims the chip and takes no presses
testIDstring—Test id
styleStyleProp<ViewStyle>—Style of the chip's outer box (its touch target)

useChipMetrics

useChipMetrics({ size, appearance }) returns { height, target, gap } for a part of the app's own beside a chip:

  • height: the chip as drawn. On Android it is 32 (Material's chip). On iOS it is 40 for a tag, 44 for a glass capsule and 36 for size="sm".
  • target: the touch target the chip lays out in, centered: 48 on Android, 44 on iOS. A tip anchored to the chip as drawn stands (target - height) / 2 in from the chip's box.
  • gap: 8 between two chips in a row, Material's chip spacing. iOS has no chips of its own, and the kit spaces them the same.