React Native · Components
View
A surface tied to the theme and the appearance system: lays out like a plain View, and optionally takes a card surface (variant), an accent color (tone) and effects (effect).
Import
View
componentA surface tied to the theme and the appearance system: lays out like a plain View, and optionally takes a card surface (variant), an accent color (tone) and effects (effect). Same colors, shadows and effect names as the web Card surface; drawn the same on iOS and Android (platform-independent boxShadow and backgroundImage styles, animations on the native driver).
Defaults are given via UIProvider appearance.defaults.view, new variants via appearance.variants.view and new effects via appearance.effects.
Effects listen to raw touch events and do not take the touch: buttons and scrolling inside work as usual; the effect is released when the finger slides more than 10 pixels. Transform effects (scale, bounce, lift, tilt) write on top of style.transform.
Examples
SurfaceVariant
typeBuilt-in surface variants (same names and colors as Card variant on web; plain and soft exist only on View).
plain: no surface is drawn; like a plainView(View's default).outline: a bordered card surface with a light shadow.elevated: a surface with a pronounced shadow and a faint border.filled: borderless, muted background (muted).soft: a light-tinted background and border by color (tone).ghost: no background or border; corners and padding are kept.dashed: dashed border, no background (drop zone, empty state).gradient: a diagonal blend from the accent color into the card.glass: a translucent glass surface with a glowing top edge. React Native has no backdrop blur, so there is no blur; the surface is drawn with the same translucency on both platforms.
ViewRadius
typeView corner radius: a name from the theme scale or pixels.
ViewProps
interfaceView props.
Extends: RNViewProps
| Name | Type | Default | Description |
|---|---|---|---|
ref? | Ref<ViewRef> | Ref of the underlying native element. | |
variant? | SurfaceVariant | (string & {}) | "plain" | Surface variant: one of the built-in variants (SurfaceVariant) or a name added via UIProvider appearance.variants.view. Defaults to appearance.defaults.view.variant, then "plain". |
tone? | Tone | "primary" | Accent color: the color of the effects and the tone of the soft/gradient variants. |
effect? | EffectProp | Effect or effects ("ripple", ["tilt", "glow"]…). See BuiltinEffect. Defaults to appearance.defaults.view.effect; if that is not set either, "scale" when onPress is given, otherwise no effect. "none" disables all of them. | |
active? | boolean | false | Keeps the effects on as if pressed (a selected card, a featured plan): beam rotates, border stays in the accent color, lift stays raised, glow shines in the middle. |
radius? | ViewRadius | Corner radius: a name from the theme scale (useUI().radius), "full" or pixels. If omitted, the plain variant has no corners and the others use "xl" (like Card on web). | |
padding? | number | Padding in spacing units (space(n); p-4 on web → padding={4}). Follows density. Padding inside style overrides it. | |
gap? | number | Gap between children in spacing units (gap-2 → gap={2}). Follows density. | |
onPress? | (event: GestureResponderEvent) => void | When given the surface becomes pressable (role button); buttons inside keep receiving their own presses. | |
onLongPress? | (event: GestureResponderEvent) => void | Called on long press; when given the surface becomes pressable. | |
disabled? | boolean | false | Disables presses and effects and fades the surface. |
style? | StyleProp<ViewStyle> | Container style; added on top of the variant's style. |