React Native · APIs and utilities
Appearance
The library's built-in effects.
BuiltinEffect
typeThe library's built-in effects. Same names as the web effects, and they can be combined as an array (["tilt", "glow"]). All render identically on both platforms; animations run on the native driver.
On press:
scale: presses in slightly.ripple: a wave spreading from the pressed point.pulse: a ring expanding outward from the element and fading.bounce: presses in with a spring and bounces back.
While pressed or active (touch screens have no "hover"; web's hover state is press-and-hold here):
lift: the element rises slightly and its shadow grows.border: the border turns to the accent color.beam: a light beam rotating around the border.glow: a light following the finger; the surface glows under the finger.tilt: the element tilts in 3D toward the corner under the finger (the pressed side sinks).shine: a diagonal shine passes over the element.
none: no effect; turns off theUIProviderappearancedefault.
Colors come from the element's accent color (tone). With "reduce motion" moving effects do not play; when scrolling starts (the finger moves more than 10 pixels) the effect is released, so lists do not stutter.
EffectName
typeEffect name: one of the built-in effects (BuiltinEffect) or a custom effect added via UIProvider appearance.effects.
EffectProp
typeType of the effect prop: a single effect or effects that work together. If omitted, the component's UIProvider appearance.defaults setting is used, otherwise the component's own default. "none" turns all off.
Examples
EffectState
interfaceCurrent state of the effect; passed to custom effects' style and layers.
| Name | Type | Description |
|---|---|---|
pressed | boolean | Is the finger pressed on the element. |
active | boolean | Was active given to the component. |
on | boolean | pressed || active: the state in which "hover" effects run. |
accent | string | Accent color (from tone; an rgba() string). |
width | number | Element width (pixels; 0 before the first measurement). |
height | number | Element height (pixels; 0 before the first measurement). |
radius | number | Border radius (pixels). |
reducedMotion | boolean | Is the "reduce motion" preference on. |
ui | UIContextValue | Theme values (useUI). |
EffectPress
interfacePress info; passed to a custom effect's onPressIn.
| Name | Type | Description |
|---|---|---|
x | number | Horizontal position of the pressed point relative to the element (pixels). |
y | number | Vertical position of the pressed point relative to the element (pixels). |
width | number | Element width (pixels). |
height | number | Element height (pixels). |
EffectDefinition
interfaceCustom effect definition. One or more of three ways are used together:
- Style:
styleis added to the element's own style; given a function it changes with the state (EffectState) (e.g. a neon shadow while pressed). - Layer:
layeris drawn below the content in a layer clipped to the element's corners that does not block touches. UseAnimatedfor your own animation. - On press:
onPressInis called on every press (also with "reduce motion"; skip the animation yourself).
| Name | Type | Description |
|---|---|---|
style? | StyleProp<ViewStyle> | ((state: EffectState) => StyleProp<ViewStyle>) | Style to add to the element, or a function producing style from the state. |
layer? | ComponentType<EffectState> | Component drawn in the clipped effect layer. |
onPressIn? | (press: EffectPress) => void | Called on every press. |
Examples
VariantContext
interfaceInfo passed to a custom variant's style function.
| Name | Type | Description |
|---|---|---|
ui | UIContextValue | Theme values (useUI). |
tone | Tone | The component's color. |
accent | string | Accent color (from tone; an rgba() string). |
VariantViewStyle
typeStyle of the variant. Besides View style, color can be given: the text and icon color (for components with text like buttons, badges, alerts; the equivalent of web's text-* class).
Extends: ViewStyle
| Name | Type | Description |
|---|---|---|
color? | string | Text and icon color of the content. |
VariantStyle
typeVariant style: a fixed style or a function producing style from the theme.
VariantEntry
typeCustom variant definition. A style is used directly; an object can derive from a built-in variant and take separate styles per color (tone). If a built-in variant name is used (e.g. view: { outline: … }), the style is added on top of that variant.
Examples
VariantComponent
typeKeys of components that take custom variants (same names as web's VariantComponent).
view→View,card→Card.button:Button,IconButton,ButtonGroupand everything that uses buttons (Dialog, Form buttons…).field: all form fields (TextField,Textarea,Select,NumberInput,DatePicker…).- The others are the component of the same name (
emptyState→EmptyState,otpInput→OtpInput).
EffectComponent
typeKeys of components that take effects; AppearanceConfig.defaults uses these keys (same names as web's EffectComponent).
ComponentDefaults
interfaceA component's default appearance settings.
| Name | Type | Description |
|---|---|---|
variant? | string | Default variant name: built-in or added via variants. |
effect? | EffectProp | Default effect or effects. |
tone? | Tone | Default color (if the component supports it). |
size? | Size | Default size (if the component supports it). |
shape? | string | Default corner shape (buttons only: rounded, pill, sharp). |
AppearanceConfig
interfaceThe app's appearance settings: component defaults, custom effects and custom variants. Passed to the UIProvider appearance prop; same structure as web's UIProvider appearance (styles instead of classes).
Define the object outside components (a new object on every render defeats the cache).
| Name | Type | Description |
|---|---|---|
defaults? | Partial<Record<EffectComponent, ComponentDefaults>> | Default variant, effect, tone, size, shape per component. A prop given to the component always wins. |
effects? | Readonly<Record<string, EffectDefinition>> | Custom effects: name → definition. See EffectDefinition. |
variants? | Partial<Record<VariantComponent, Readonly<Record<string, VariantEntry>>>> | Custom variants per component: name → style. See VariantEntry. |