This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
卡片
一个用于在样式化容器中显示内容的 Jetpack Compose 卡片组件。
Expo UI Card 与官方 Jetpack Compose Card API 保持一致,并在带样式的 surface 容器内显示内容,可选支持阴影高度和轮廓。Card 组件渲染的是一个填充卡片,而 ElevatedCard 和 OutlinedCard 分别提供带提升效果和带边框的变体。


安装
If you are installing this in an existing React Native app, make sure to install expo in your project.
用法
基础卡片
卡片类型
使用 Card(填充)、ElevatedCard 或 OutlinedCard 来获得不同样式。
自定义高程
使用 elevation 属性(单位为 dp)来控制阴影深度。高程在 ElevatedCard 上最有意义,因为它使用阴影高程。填充式 Card 默认使用色调高程,因此变化可能较为细微。
自定义边框
Card 和 OutlinedCard 接受 border 属性,用于自定义描边宽度和颜色。
API
import { Card, ElevatedCard, OutlinedCard, } from '@expo/ui/jetpack-compose';
Components
Type: React.Element<ComponentType<CardProps>>
A card component that renders a filled card surface for content.
Type: React.Element<ComponentType<ElevatedCardProps>>
An elevated card component that provides a raised surface for content.
Type: React.Element<ComponentType<OutlinedCardProps>>
An outlined card component that provides a bordered surface for content.