Expo UI and Router for iOS
Modifiers

createModifier

Factory function to create modifier configuration objects. This is used by all built-in modifier functions and can be used by 3rd party libraries to create custom modifiers.

createModifier(type, params)

ParameterTypeDescription
typestringThe modifier type string that maps to a registered native modifier.
params(optional)Record<string, any>Additional parameters to pass to the modifier. Default: {}

Factory function to create modifier configuration objects. This is used by all built-in modifier functions and can be used by 3rd party libraries to create custom modifiers.

Returns: ModifierConfig

A ModifierConfig object that can be passed in the modifiers prop array.

Example

// In a 3rd party package
import { createModifier } from '@expo/ui/swift-ui/modifiers';

export const blurEffect = (params: { radius: number; style?: string }) =>
  createModifier('blurEffect', params);

Works with

This modifier works with any view. These components accept it:

Sources

The original Expo docs for this page:

On this page