Expo UI Surface matches the official Jetpack Compose Surface API and provides a container that applies Material Design surface styling including color, elevation, and content color.
import{Host,Surface,Text}from'@expo/ui/jetpack-compose';import{ paddingAll }from'@expo/ui/jetpack-compose/modifiers';exportdefaultfunctionBasicSurfaceExample(){return(<HostmatchContents><Surface><Textmodifiers={[paddingAll(16)]}>
Content on a surface
</Text></Surface></Host>);}
Surface with elevation
Use tonalElevation and shadowElevation to control the visual depth of the surface.
The color of the content inside the surface.
Defaults to contentColorFor(color).
enabled
Android
Optional • Type: boolean • Default: true
Whether the surface is enabled and responds to user interaction.
modifiers
Android
Optional • Type: ModifierConfig[]
Modifiers for the component.
onCheckedChange
Android
Optional • Type: (checked: boolean) => void
Called when the checked state of a toggleable surface changes.
Providing this callback together with checked enables the toggleable variant.
onClick
Android
Optional • Type: () => void
Called when the surface is clicked. Providing this callback makes the surface clickable.
When combined with selected, the surface becomes a selectable variant.
selected
Android
Optional • Type: boolean
Whether the surface is in a selected state. When provided together with onClick,
the surface becomes a selectable surface that visually reflects its selection state.