This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
Chip
用于显示紧凑元素的 Jetpack Compose Chip 组件。
Expo UI Chips 与官方 Jetpack Compose Chip API 匹配。每种芯片都是单独的组件:AssistChip、FilterChip、InputChip 和 SuggestionChip。


安装
If you are installing this in an existing React Native app, make sure to install expo in your project.
用法
辅助芯片
辅助芯片可帮助用户执行操作或开始任务,例如预订航班或打开地图。它们通常作为临时 UI 元素,在用户输入后显示。
筛选芯片
筛选芯片允许用户从一组选项中筛选内容。它们支持选中状态,常用于搜索栏或内容筛选。
输入芯片
输入芯片表示用户输入的独立信息片段,例如文本字段中的标签。它们支持头像、尾随图标,也可以关闭。
建议芯片
建议芯片通过动态生成的建议帮助用户明确意图,例如聊天中的快速回复选项或搜索筛选条件。
API
import { AssistChip, FilterChip, InputChip, SuggestionChip, } from '@expo/ui/jetpack-compose';
Components
Type: React.Element<AssistChipProps>
An assist chip that helps users complete actions and primary tasks.
boolean • Default: trueWhether the chip is enabled and can be clicked.
Type: React.Element<FilterChipProps>
A filter chip component for refining content with selection/deselection.
FilterChipColorsColors for the chip's container, label, icon, and selected states.
Type: React.Element<InputChipProps>
An input chip that represents user input and can be dismissed.
InputChipColorsColors for the chip's container, label, icons, and selected states.
boolean • Default: trueWhether the chip is enabled and can be interacted with.
Type: React.Element<SuggestionChipProps>
A suggestion chip that offers contextual suggestions and recommendations.
boolean • Default: trueWhether the chip is enabled and can be clicked.