Reference version

Modifiers

Jetpack Compose layout modifiers for @expo/ui components.

Android
Included in Expo Go
Bundled version:
~57.0.1

Jetpack Compose modifiers allow you to customize the layout, appearance, and behavior of UI components. Modifiers are the Compose equivalent of style properties — they control sizing, padding, backgrounds, interactions, and more.

Installation

Terminal
npx expo install @expo/ui

If you are installing this in an existing React Native app, make sure to install expo in your project.

Usage

Modifiers are applied to components using the modifiers prop with an array syntax. You can combine multiple modifiers to create complex styling and behavior. Modifiers are applied in the order they appear in the array, which can affect the final result (for example, applying padding before background produces different results than the reverse).

import { Button, Host } from '@expo/ui/jetpack-compose'; import { paddingAll, fillMaxWidth, background, border, shadow, clickable, } from '@expo/ui/jetpack-compose/modifiers'; function ModifiersExample() { return ( <Host style={{ flex: 1 }}> {/* Basic styling modifiers */} <Button modifiers={[paddingAll(16), fillMaxWidth(), background('#FF6B6B')]}> Full-width padded button </Button> {/* Complex combination with border and shadow */} <Button modifiers={[paddingAll(12), background('#4ECDC4'), border(2, '#2C3E50'), shadow(4)]}> Styled with border and shadow </Button> </Host> ); }

Padding

Control the spacing around a component's content.

paddingAll(all)

Applies equal padding on all four sides.

ParameterTypeDescription
allnumberPadding value in dp.
import { paddingAll } from '@expo/ui/jetpack-compose/modifiers'; <Button modifiers={[paddingAll(16)]}>Padded button</Button>;

padding(start, top, end, bottom)

Applies individual padding to each side.

ParameterTypeDescription
startnumberLeft/start padding in dp.
topnumberTop padding in dp.
endnumberRight/end padding in dp.
bottomnumberBottom padding in dp.
import { padding } from '@expo/ui/jetpack-compose/modifiers'; <Button modifiers={[padding(16, 8, 16, 8)]}>Custom padding</Button>;

Size

Control the dimensions of a component.

size(width, height)

Sets exact dimensions for the component.

ParameterTypeDescription
widthnumberWidth in dp.
heightnumberHeight in dp.
import { size } from '@expo/ui/jetpack-compose/modifiers'; <Button modifiers={[size(200, 48)]}>Fixed size</Button>;

fillMaxSize(fraction?)

Fills all available space in both dimensions.

ParameterTypeDescription
fractionnumberFraction of available space (0.0–1.0). Default 1.0.
import { fillMaxSize } from '@expo/ui/jetpack-compose/modifiers'; <Button modifiers={[fillMaxSize()]}>Fill all space</Button> <Button modifiers={[fillMaxSize(0.5)]}>Fill half</Button>

fillMaxWidth(fraction?)

Fills available width.

ParameterTypeDescription
fractionnumberFraction of available width (0.0–1.0). Default 1.0.
import { fillMaxWidth } from '@expo/ui/jetpack-compose/modifiers'; <Button modifiers={[fillMaxWidth()]}>Full width</Button>;

fillMaxHeight(fraction?)

Fills available height.

ParameterTypeDescription
fractionnumberFraction of available height (0.0–1.0). Default 1.0.

width(value)

Sets an exact width.

ParameterTypeDescription
valuenumberWidth in dp.

height(value)

Sets an exact height.

ParameterTypeDescription
valuenumberHeight in dp.

wrapContentWidth(alignment?)

Sizes the component to wrap its content width.

ParameterTypeDescription
alignmentstringHorizontal alignment of the content.

wrapContentHeight(alignment?)

Sizes the component to wrap its content height.

ParameterTypeDescription
alignmentstringVertical alignment of the content.

Position

Control the position of a component relative to its natural placement.

offset(x, y)

Offsets the component from its natural position without affecting the layout of surrounding components.

ParameterTypeDescription
xnumberHorizontal offset in dp.
ynumberVertical offset in dp.
import { offset } from '@expo/ui/jetpack-compose/modifiers'; <Button modifiers={[offset(10, 5)]}>Offset button</Button>;

Appearance

Control the visual appearance of a component.

background(color)

Sets the background color.

ParameterTypeDescription
colorstringBackground color (hex string).
import { background } from '@expo/ui/jetpack-compose/modifiers'; <Button modifiers={[background('#3498DB')]}>Blue background</Button>;

border(borderWidth, borderColor)

Adds a border around the component.

ParameterTypeDescription
borderWidthnumberBorder width in dp.
borderColorstringBorder color (hex string).
import { border } from '@expo/ui/jetpack-compose/modifiers'; <Button modifiers={[border(2, '#E74C3C')]}>Bordered button</Button>;

shadow(elevation)

Adds an elevation shadow beneath the component.

ParameterTypeDescription
elevationnumberShadow elevation in dp.
import { shadow } from '@expo/ui/jetpack-compose/modifiers'; <Button modifiers={[shadow(8)]}>Elevated button</Button>;

dropShadow(shape, config?)

Draws a shadow behind the component with control over the blur radius, spread, offset, and color. Unlike shadow, it does not require an elevation value.

ParameterTypeDescription
shapeShapeThe shape of the shadow (see the shapes table below).
config.radiusnumberBlur radius in dp.
config.spreadnumberAmount to expand (positive) or contract (negative) in dp.
config.colorstringShadow color (hex string). Defaults to black.
config.offsetXnumberHorizontal offset in dp.
config.offsetYnumberVertical offset in dp.
config.alphanumberShadow opacity (0.0–1.0).
import { dropShadow, Shapes } from '@expo/ui/jetpack-compose/modifiers'; <Button modifiers={[ dropShadow(Shapes.RoundedCorner(24), { radius: 16, spread: 4, color: '#6200EE', offsetY: 8 }), ]}> Drop shadow </Button>;

innerShadow(shape, config?)

Draws a shadow inside the component to create an inset effect. Apply the background modifier before innerShadow so the shadow renders.

ParameterTypeDescription
shapeShapeThe shape of the shadow (see the shapes table below).
config.radiusnumberBlur radius in dp.
config.spreadnumberAmount to expand (positive) or contract (negative) in dp.
config.colorstringShadow color (hex string). Defaults to black.
config.offsetXnumberHorizontal offset in dp.
config.offsetYnumberVertical offset in dp.
config.alphanumberShadow opacity (0.0–1.0).
import { innerShadow, background, Shapes } from '@expo/ui/jetpack-compose/modifiers'; <Button modifiers={[ background('#FFFFFF'), innerShadow(Shapes.RoundedCorner(24), { radius: 16, spread: 2, offsetY: 6 }), ]}> Inner shadow </Button>;

alpha(alpha)

Controls the opacity of the component.

ParameterTypeDescription
alphanumberOpacity value (0.0–1.0).
import { alpha } from '@expo/ui/jetpack-compose/modifiers'; <Button modifiers={[alpha(0.5)]}>Semi-transparent</Button>;

blur(radius)

Applies a blur effect to the component.

ParameterTypeDescription
radiusnumberBlur radius in dp.
import { blur } from '@expo/ui/jetpack-compose/modifiers'; <Button modifiers={[blur(4)]}>Blurred button</Button>;

Shadow recipes

Common shadow styles are combinations of the dropShadow and innerShadow modifiers rather than separate APIs. Because the modifiers prop takes an array, you stack and tune the shadow modifiers to build each style.

Neobrutalist shadow

A neobrutalist shadow is a hard-edged drop shadow with no blur and a thick border. Set radius and spread to 0, then offset the shadow.

import { dropShadow, border, background, Shapes } from '@expo/ui/jetpack-compose/modifiers'; <Box modifiers={[ dropShadow(Shapes.Rectangle, { radius: 0, spread: 0, offsetX: 8, offsetY: 8, color: '#000000', }), border(8, '#000000'), background('#FFFFFF'), ]} />;

Neumorphic shadow

A neumorphic shadow layers two drop shadows on a surface that shares its background color: a light shadow toward the light source and a darker shadow on the opposite side. Apply both before the background.

import { dropShadow, background, Shapes } from '@expo/ui/jetpack-compose/modifiers'; const shape = Shapes.RoundedCorner(24); <Box modifiers={[ dropShadow(shape, { radius: 15, offsetX: -10, offsetY: -10, color: '#FFFFFF' }), dropShadow(shape, { radius: 15, offsetX: 10, offsetY: 10, color: '#B1B1B1' }), background('#E0E0E0'), ]} />;

To create the pressed, recessed variant, use two innerShadow modifiers instead and place them after the background.

Transform

Apply visual transformations to a component.

rotate(degrees)

Rotates the component.

ParameterTypeDescription
degreesnumberRotation angle in degrees.
import { rotate } from '@expo/ui/jetpack-compose/modifiers'; <Button modifiers={[rotate(45)]}>Rotated</Button>;

zIndex(index)

Controls the drawing order of overlapping components.

ParameterTypeDescription
indexnumberLayer index.
import { zIndex } from '@expo/ui/jetpack-compose/modifiers'; <Button modifiers={[zIndex(10)]}>On top</Button>;

Animation

Animate layout changes within a component.

animateContentSize(dampingRatio?, stiffness?)

Animates size changes of the component's content using a spring animation.

ParameterTypeDescription
dampingRationumberSpring damping ratio. Controls bounciness.
stiffnessnumberSpring stiffness. Controls animation speed.
import { animateContentSize } from '@expo/ui/jetpack-compose/modifiers'; <Button modifiers={[animateContentSize()]}>Animated size</Button> <Button modifiers={[animateContentSize(0.5, 200)]}>Custom spring</Button>

Layout

Control how a component is sized and positioned within its parent container.

weight(weight)

Assigns a flexible weight to a component inside a Row or Column, distributing available space proportionally among weighted children.

ParameterTypeDescription
weightnumberWeight factor.
import { weight } from '@expo/ui/jetpack-compose/modifiers'; // In a Row, the first button takes 2/3 and the second takes 1/3 <Button modifiers={[weight(2)]}>Wider</Button> <Button modifiers={[weight(1)]}>Narrower</Button>

align(alignment)

Sets the alignment of the component within its parent container.

ParameterTypeDescription
alignmentstringAlignment within the container.

matchParentSize()

Sizes the component to match the size of its parent Box. Unlike fillMaxSize, this does not affect the parent's measurement.

import { matchParentSize } from '@expo/ui/jetpack-compose/modifiers'; <Button modifiers={[matchParentSize()]}>Match parent</Button>;

Interaction

Add user interaction handlers to a component.

clickable(handler)

Makes the component respond to click events.

ParameterTypeDescription
handler() => voidCallback invoked on click.
import { clickable } from '@expo/ui/jetpack-compose/modifiers'; <Button modifiers={[clickable(() => console.log('Clicked!'))]}>Clickable</Button>;

combinedClickable(handlers, options?)

Makes the component respond to both short-tap and long-press gestures. Wraps Compose's Modifier.combinedClickable. Useful for opening a DropdownMenu on long-press while keeping a separate short-tap action on the same view.

ParameterTypeDescription
handlers.onClick() => voidOptional callback invoked on a short tap.
handlers.onLongClick() => voidOptional callback invoked on a long press.
options.indicationbooleanWhether to show a ripple indication. Defaults to true.
import { combinedClickable } from '@expo/ui/jetpack-compose/modifiers'; <Text modifiers={[ combinedClickable({ onClick: () => console.log('Tapped'), onLongClick: () => setMenuExpanded(true), }), ]}> Long-press me </Text>;

selectable(selected, handler)

Makes the component selectable, similar to a radio button.

ParameterTypeDescription
selectedbooleanWhether the component is currently selected.
handler() => voidCallback invoked when selection state changes.
import { selectable } from '@expo/ui/jetpack-compose/modifiers'; <Button modifiers={[selectable(isSelected, () => setIsSelected(!isSelected))]}> Selectable option </Button>;

Clipping

Clip a component's content to a specific shape.

clip(shape)

Clips the component to the given shape. Content outside the shape boundary is not drawn.

ParameterTypeDescription
shapeShapeThe shape to clip to.

Available shapes

ShapeDescription
Shapes.RectangleA rectangle with no rounded corners.
Shapes.CircleA perfect circle.
Shapes.RoundedCorner(radius)A rectangle with uniform rounded corners. Pass a number for equal radius or an object { topStart, topEnd, bottomStart, bottomEnd } for individual corner radii.
Shapes.CutCorner(radius)A rectangle with cut (chamfered) corners. Accepts the same radius options as RoundedCorner.
Shapes.Material.Cookie4SidedMaterial Design cookie shape with 4 sides.
Shapes.Material.Cookie6SidedMaterial Design cookie shape with 6 sides.
import { clip } from '@expo/ui/jetpack-compose/modifiers'; import { Shapes } from '@expo/ui/jetpack-compose/modifiers'; // Circular clipping <Button modifiers={[clip(Shapes.Circle)]}>Circle</Button> // Rounded corners with uniform radius <Button modifiers={[clip(Shapes.RoundedCorner(12))]}>Rounded</Button> // Rounded corners with individual radii <Button modifiers={[ clip(Shapes.RoundedCorner({ topStart: 16, topEnd: 16, bottomStart: 0, bottomEnd: 0 })), ]}> Top rounded only </Button> // Cut corners <Button modifiers={[clip(Shapes.CutCorner(8))]}>Cut corners</Button>

Utility

testID(tag)

Assigns a test identifier to the component for use in UI testing.

ParameterTypeDescription
tagstringThe test ID.
import { testID } from '@expo/ui/jetpack-compose/modifiers'; <Button modifiers={[testID('submit-button')]}>Submit</Button>;

API

import { paddingAll, padding, size, fillMaxWidth, background, clickable, clip, Shapes } from '@expo/ui/jetpack-compose/modifiers';

Constants

Shapes

Type: { Circle: BuiltinShape, CutCorner: (params: number | CornerRadii) => BuiltinShape, Material: { Arch: BuiltinShape, Boom: BuiltinShape, Bun: BuiltinShape, Clover4Leaf: BuiltinShape, Clover8Leaf: BuiltinShape, Cookie12Sided: BuiltinShape, Cookie4Sided: BuiltinShape, Cookie6Sided: BuiltinShape, Cookie7Sided: BuiltinShape, Cookie9Sided: BuiltinShape, Diamond: BuiltinShape, Fan: BuiltinShape, Ghostish: BuiltinShape, Heart: BuiltinShape, Oval: BuiltinShape, Pentagon: BuiltinShape, Pill: BuiltinShape, PixelCircle: BuiltinShape, PixelTriangle: BuiltinShape, Puffy: BuiltinShape, PuffyDiamond: BuiltinShape, Slanted: BuiltinShape, SoftBurst: BuiltinShape, Sunny: BuiltinShape, Triangle: BuiltinShape, VerySunny: BuiltinShape }, Rectangle: BuiltinShape, RoundedCorner: (params: number | CornerRadii) => BuiltinShape }

Predefined shapes for use with the clip modifier.

Example

clip(Shapes.Circle) clip(Shapes.RoundedCorner(16)) clip(Shapes.RoundedCorner({ topStart: 8, bottomEnd: 16 })) clip(Shapes.Material.Heart)

Methods

align(alignment)

ParameterType
alignmentAlignment

Aligns the view within its container.

Returns:
ModifierConfig

alpha(alpha)

ParameterTypeDescription
alphanumber

Opacity value (0.0 to 1.0).


Sets the opacity/alpha of the view.

Returns:
ModifierConfig

animateContentSize(dampingRatio, stiffness)

ParameterTypeDescription
dampingRatio(optional)number

Spring damping ratio. Default is DampingRatioNoBouncy.

stiffness(optional)number

Spring stiffness. Default is StiffnessMedium.


Animates size changes with spring animation.

Returns:
ModifierConfig

animated(targetValue, spec)

ParameterType
targetValuenumber
spec(optional)AnimationSpec

Returns:
{ $animated: true, animationSpec: AnimationSpec, targetValue: number }

background(color, options)

ParameterTypeDescription
colorColorValue

A color string (hex, e.g., '#FF0000').

options(optional){ animationSpec: AnimationSpec }
-

Sets the background color. Pass an animationSpec to smoothly animate between colors when the prop changes (backed by animateColorAsState).

Returns:
ModifierConfig

blur(radius)

ParameterTypeDescription
radiusnumber

Blur radius in dp.


Applies a blur effect.

Returns:
ModifierConfig

border(borderWidth, borderColor)

ParameterTypeDescription
borderWidthnumber

Border width in dp.

borderColorColorValue

Border color string (hex).


Adds a border around the view.

Returns:
ModifierConfig

clickable(handler, options)

ParameterTypeDescription
handler() => void

Function to call when clicked.

options(optional){ indication: boolean }

Optional configuration.


Makes the view clickable.

Returns:
ModifierConfig

clip(shape)

ParameterTypeDescription
shapeBuiltinShape

A shape from Shapes, e.g. Shapes.Circle or Shapes.Material.Heart.


Clips the view to a built-in Jetpack Compose shape.

Returns:
ModifierConfig

combinedClickable(handlers, options)

ParameterTypeDescription
handlers{ onClick: () => void, onLongClick: () => void }
-
options(optional){ indication: boolean }

Optional configuration.


Makes the view respond to both click and long-click gestures. Wraps Compose's Modifier.combinedClickable. Useful for triggering a DropdownMenu on long-press while keeping a separate short-press action.

Returns:
ModifierConfig

createModifier(type, params)

ParameterType
typestring
params(optional)Record<string, any>

Factory function to create modifier configuration objects.

Returns:
ModifierConfig

defaultMinSize(options)

ParameterType
options{ minHeight: number, minWidth: number }

Constrain the size of the wrapped layout only when it would be otherwise unconstrained: the minWidth and minHeight constraints are only applied when the incoming corresponding constraint is 0.

Returns:
ModifierConfig

dropShadow(shape, config)

ParameterTypeDescription
shapeBuiltinShape

The shape of the shadow, for example Shapes.RoundedCorner(16) or Shapes.Circle.

config(optional)ShadowConfig

Options that control the shadow's appearance.

Default:{}

Draws a shadow behind the view with control over the blur radius, spread, offset, and color. Unlike shadow, it does not require an elevation value.

Returns:
ModifierConfig

fillMaxHeight(fraction)

ParameterTypeDescription
fraction(optional)number

Fraction of max height (0.0 to 1.0). Default is 1.0.


Fills the maximum available height.

Returns:
ModifierConfig

fillMaxSize(fraction)

ParameterTypeDescription
fraction(optional)number

Fraction of max size (0.0 to 1.0). Default is 1.0.


Fills the maximum available size.

Returns:
ModifierConfig

fillMaxWidth(fraction)

ParameterTypeDescription
fraction(optional)number

Fraction of max width (0.0 to 1.0). Default is 1.0.


Fills the maximum available width.

Returns:
ModifierConfig

graphicsLayer(params)

ParameterTypeDescription
params{ alpha: number | { $animated: true, animationSpec: AnimationSpec, targetValue: number }, ambientShadowColor: ColorValue, cameraDistance: number, clip: boolean, compositingStrategy: 'auto' | 'offscreen' | 'modulate', rotationX: number | { $animated: true, animationSpec: AnimationSpec, targetValue: number }, rotationY: number | { $animated: true, animationSpec: AnimationSpec, targetValue: number }, rotationZ: number | { $animated: true, animationSpec: AnimationSpec, targetValue: number }, scaleX: number | { $animated: true, animationSpec: AnimationSpec, targetValue: number }, scaleY: number | { $animated: true, animationSpec: AnimationSpec, targetValue: number }, shadowElevation: number | { $animated: true, animationSpec: AnimationSpec, targetValue: number }, shape: BuiltinShape, spotShadowColor: ColorValue, transformOriginX: number, transformOriginY: number, translationX: number | { $animated: true, animationSpec: AnimationSpec, targetValue: number }, translationY: number | { $animated: true, animationSpec: AnimationSpec, targetValue: number } }

Transform and visual effect parameters.


Applies a graphics layer transformation with animation support.

Returns:
ModifierConfig

height(value)

ParameterTypeDescription
valuenumber

Height in dp.


Sets the exact height of the view.

Returns:
ModifierConfig

horizontalScroll()

Makes the view horizontally scrollable. Wraps Modifier.horizontalScroll(rememberScrollState()). Use on a Row to create a non-lazy scrollable container.

Returns:
ModifierConfig

imePadding()

Adds padding to avoid the software keyboard (IME). When the keyboard is visible, padding is added to keep content above it.

Returns:
ModifierConfig

innerShadow(shape, config)

ParameterTypeDescription
shapeBuiltinShape

The shape of the shadow, for example Shapes.RoundedCorner(16) or Shapes.Circle.

config(optional)ShadowConfig

Options that control the shadow's appearance.

Default:{}

Draws a shadow inside the view to create an inset effect. The view's background must come before this modifier for the shadow to render.

Returns:
ModifierConfig

keyframes(params)

ParameterType
params{ delayMillis: number, durationMillis: number, keyframes: Record<number, number> }

Returns:
{ $type: 'keyframes', delayMillis: number, durationMillis: number, keyframes: Record<number, number> }

matchParentSize()

Makes the view match the parent Box size. Only works when used inside Box.

Returns:
ModifierConfig
ParameterTypeDescription
type(optional)'primaryNotEditable'

Anchor type. Currently only 'primaryNotEditable' is supported.

enabled(optional)boolean

Whether the anchor is enabled. Defaults to true.


Marks a composable as the anchor for an ExposedDropdownMenuBox. Only works when used inside ExposedDropdownMenuBox.

Returns:
ModifierConfig

offset(x, y)

ParameterTypeDescription
xnumber

Horizontal offset in dp.

ynumber

Vertical offset in dp.


Offsets the view from its natural position.

Returns:
ModifierConfig

onGloballyPositioned(handler)

ParameterTypeDescription
handler(layout: { height: number, width: number, x: number, y: number }) => void

Function called with the new layout.


Calls the handler whenever the composable is positioned, with its position and size. x and y are relative to the window. All values are in dp.

Returns:
ModifierConfig

onSizeChanged(handler)

ParameterTypeDescription
handler(size: { height: number, width: number }) => void

Function called with the new size.


Calls the handler whenever the composable's measured size changes. Sizes are in dp.

Returns:
ModifierConfig

onVisibilityChanged(handler, options)

ParameterTypeDescription
handler(isVisible: boolean) => void

Function called with true when visible, false when not.

options(optional){ minDurationMs: number, minFractionVisible: number }

Optional configuration.


Calls the handler when the composable's visibility changes (for example, enters or leaves the viewport in a lazy list).

Returns:
ModifierConfig

padding(start, top, end, bottom)

ParameterTypeDescription
startnumber

Left padding in dp (or right in RTL).

topnumber

Top padding in dp.

endnumber

Right padding in dp (or left in RTL).

bottomnumber

Bottom padding in dp.


Applies padding with individual values for each side.

Returns:
ModifierConfig

paddingAll(all)

ParameterTypeDescription
allnumber

Padding value in dp.


Applies equal padding on all sides.

Returns:
ModifierConfig

rotate(degrees)

ParameterTypeDescription
degreesnumber

Rotation angle in degrees.


Rotates the view.

Returns:
ModifierConfig

selectable(selected, handler, role)

ParameterTypeDescription
selectedboolean

Whether the item is currently selected.

handler() => void

Function to call when the item is clicked.

role(optional)'switch' | 'checkbox' | 'tab' | 'radioButton'

Optional semantic role for accessibility: 'radioButton', 'checkbox', 'switch', or 'tab'.


Makes the view selectable, like a radio button row.

Returns:
ModifierConfig

selectableGroup()

Marks a column/row as a selectable group for accessibility. Screen readers will treat the children as a group of selectable items.

Returns:
ModifierConfig

semantics(params)

ParameterType
params{ contentType: string }

Applies semantic properties. Wraps Modifier.semantics { ... }.

Returns:
ModifierConfig

shadow(elevation)

ParameterTypeDescription
elevationnumber

Shadow elevation in dp.


Adds a shadow/elevation effect.

Returns:
ModifierConfig

size(width, height)

ParameterTypeDescription
widthnumber

Width in dp.

heightnumber

Height in dp.


Sets exact width and height.

Returns:
ModifierConfig

snap(params)

ParameterType
params(optional){ delayMillis: number }

Returns:
{ $type: 'snap', delayMillis: number }

spring(params)

ParameterType
params(optional){ dampingRatio: number, stiffness: number, visibilityThreshold: number }

Returns:
{ $type: 'spring', dampingRatio: number, stiffness: number, visibilityThreshold: number }

testID(tag)

ParameterTypeDescription
tagstring

Test ID string.


Sets the test ID for testing frameworks.

Returns:
ModifierConfig

toggleable(value, handler, options)

ParameterTypeDescription
valueboolean

The current toggle state.

handler() => void

Function to call when toggled.

options(optional){ role: 'switch' | 'checkbox' | 'tab' | 'radioButton' }

Optional configuration.


Makes the view toggleable with accessibility semantics. Use this to make a row containing a checkbox or switch tappable as a whole.

Returns:
ModifierConfig

tween(params)

ParameterType
params(optional){ delayMillis: number, durationMillis: number, easing: 'linear' | 'ease' | 'fastOutSlowIn' | 'fastOutLinearIn' | 'linearOutSlowIn' }

Returns:
{ $type: 'tween', delayMillis: number, durationMillis: number, easing: 'linear' | 'ease' | 'fastOutSlowIn' | 'fastOutLinearIn' | 'linearOutSlowIn' }

verticalScroll()

Makes the view vertically scrollable. Wraps Modifier.verticalScroll(rememberScrollState()). Use on a Column to create a non-lazy scrollable container.

Returns:
ModifierConfig

weight(weight)

ParameterTypeDescription
weightnumber

Weight value (relative to siblings).


Sets the weight for flexible sizing in Row or Column. Only works when used inside Row or Column.

Returns:
ModifierConfig

width(value)

ParameterTypeDescription
valuenumber

Width in dp.


Sets the exact width of the view.

Returns:
ModifierConfig

wrapContentHeight(alignment)

ParameterTypeDescription
alignment(optional)'top' | 'bottom' | 'centerVertically'

Optional vertical alignment ('top', 'centerVertically', 'bottom').


Wraps the height to the content size.

Returns:
ModifierConfig

wrapContentWidth(alignment)

ParameterTypeDescription
alignment(optional)'start' | 'end' | 'centerHorizontally'

Optional horizontal alignment ('start', 'centerHorizontally', 'end').


Wraps the width to the content size.

Returns:
ModifierConfig

zIndex(index)

ParameterTypeDescription
indexnumber

Z-index value.


Sets the z-index for layering.

Returns:
ModifierConfig

Event Subscriptions

createModifierWithEventListener(type, eventListener, params)

ParameterType
typestring
eventListener(args: any) => void
params(optional)Record<string, any>

Creates a modifier with an event listener.

Returns:
ModifierConfig

createViewModifierEventListener(modifiers)

ParameterType
modifiersModifierConfig[]

Create an event listener for a view modifier.

Returns:
GlobalEvent

Interfaces

ModifierConfig

Modifier configuration for native views. This is the JSON Config pattern used by both iOS (SwiftUI) and Android (Jetpack Compose).

PropertyTypeDescription
$scope(optional)string
-
$typestring
-

Types

Alignment

Literal Type: string

Acceptable values are: 'topStart' | 'topCenter' | 'topEnd' | 'centerStart' | 'center' | 'centerEnd' | 'bottomStart' | 'bottomCenter' | 'bottomEnd' | 'top' | 'centerVertically' | 'bottom' | 'start' | 'centerHorizontally' | 'end'

AnimatedValue

Type: ReturnType<animated>

AnimationSpec

Type: ReturnType<spring | tween | snap | keyframes>

BuiltinShape

Built-in Jetpack Compose shape for the clip modifier.

Type: object shaped as below:

PropertyTypeDescription
type'rectangle'
-

Or object shaped as below:

PropertyTypeDescription
type'circle'
-

Or object shaped as below:

PropertyTypeDescription
bottomEnd(optional)number
-
bottomStart(optional)number
-
radius(optional)number
-
topEnd(optional)number
-
topStart(optional)number
-
type'roundedCorner'
-

Or object shaped as below:

PropertyTypeDescription
bottomEnd(optional)number
-
bottomStart(optional)number
-
radius(optional)number
-
topEnd(optional)number
-
topStart(optional)number
-
type'cutCorner'
-

Or object shaped as below:

PropertyTypeDescription
nameMaterialShapeName
-
type'material'
-

Deprecated: Use ModifierConfig instead. ExpoModifier (SharedRef pattern) has been replaced with JSON Config pattern for better DX and platform consistency.

ExpoModifier

Type: ModifierConfig

ShadowConfig

Options for the dropShadow and innerShadow modifiers.

PropertyTypeDescription
alpha(optional)number

Shadow opacity, from 0.0 to 1.0.

color(optional)ColorValue

Shadow color string (hex). Defaults to black.

offsetX(optional)number

Horizontal offset of the shadow in dp.

offsetY(optional)number

Vertical offset of the shadow in dp.

radius(optional)number

Blur radius of the shadow in dp.

spread(optional)number

Amount to expand (positive) or contract (negative) the shadow geometry in dp.