🌐 Expo UI Card matches the official Jetpack Compose Card API and displays content inside a styled surface container with optional elevation and outline. The Card component renders a filled card, while ElevatedCard and OutlinedCard provide raised and bordered variants respectively.
import{Host,Card,Text}from'@expo/ui/jetpack-compose';import{ paddingAll }from'@expo/ui/jetpack-compose/modifiers';exportdefaultfunctionBasicCardExample(){return(<HostmatchContents><Card><Textmodifiers={[paddingAll(16)]}>
This is a basic card with default styling.
</Text></Card></Host>);}
卡片类型
🌐 Card types
使用 Card(填充)、ElevatedCard 或 OutlinedCard 来表示不同的样式。
🌐 Use Card (filled), ElevatedCard, or OutlinedCard for different styles.
🌐 Use the elevation prop (in dp) to control shadow depth. Elevation is most meaningful on ElevatedCard, which uses shadow elevation. Filled Card uses tonal elevation by default, so changes may be subtle.
ElevatedCardExample.tsx
import{Host,ElevatedCard,Text}from'@expo/ui/jetpack-compose';import{ paddingAll }from'@expo/ui/jetpack-compose/modifiers';exportdefaultfunctionElevatedCardExample(){return(<HostmatchContents><ElevatedCardelevation={8}><Textmodifiers={[paddingAll(16)]}>
Card with 8dp elevation
</Text></ElevatedCard></Host>);}