Reference version

This is documentation for the next SDK version. For up-to-date documentation, see the latest version (SDK 54).

Modifiers

SwiftUI view modifiers for customizing component appearance and behavior.

iOS
tvOS

SwiftUI view modifiers that allow you to customize the appearance and behavior of UI components.

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.

import { Text, Host, VStack } from '@expo/ui/swift-ui'; import { background, cornerRadius, padding, shadow, foregroundColor, onTapGesture, } from '@expo/ui/swift-ui/modifiers'; function ModifiersExample() { const [isEnabled, setIsEnabled] = useState(false); return ( <Host style={{ flex: 1 }}> <VStack spacing={20}> {/* Basic styling modifiers */} <Text modifiers={[ background('#FF6B6B'), cornerRadius(12), padding({ all: 16 }), foregroundColor('#FFFFFF'), ]}> Basic styled text </Text> {/* Complex combination with shadow and interaction */} <Text modifiers={[ background('#4ECDC4'), cornerRadius(16), padding({ horizontal: 20, vertical: 12 }), shadow({ radius: 4, x: 0, y: 2, color: '#4ECDC440' }), onTapGesture(() => console.log('Tapped!')), ]}> Styled with shadow and tap gesture </Text> {/* Conditional modifiers using spread operator */} <Text modifiers={[ background('#9B59B6'), cornerRadius(8), padding({ all: 14 }), ...(isEnabled ? [shadow({ radius: 6, y: 3 }), scaleEffect(1.02)] : [grayscale(0.5), opacity(0.7)]), ]}> Conditional styling </Text> </VStack> </Host> ); }

API

Constants

Animation

iOS
tvOS

Type: { default: ChainableAnimationType, easeIn: (params: TimingAnimationParams) => ChainableAnimationType, easeInOut: (params: TimingAnimationParams) => ChainableAnimationType, easeOut: (params: TimingAnimationParams) => ChainableAnimationType, interpolatingSpring: (params: InterpolatingSpringAnimationParams) => ChainableAnimationType, linear: (params: TimingAnimationParams) => ChainableAnimationType, spring: (params: SpringAnimationParams) => ChainableAnimationType }

shapes

iOS
tvOS

Type: { capsule: (params: { roundedCornerStyle: 'circular' | 'continuous' }) => { roundedCornerStyle: undefined | 'circular' | 'continuous', shape: string }, circle: () => { shape: string }, ellipse: () => { shape: string }, rectangle: () => { shape: string }, roundedRectangle: (params: { cornerRadius: number, cornerSize: { height: number, width: number }, roundedCornerStyle: 'circular' | 'continuous' }) => { cornerRadius: undefined | number, cornerSize: undefined | { height: number, width: number }, roundedCornerStyle: undefined | 'circular' | 'continuous', shape: string } }

Methods

accessibilityHint(hint)

iOS
tvOS
ParameterTypeDescription
hintstring

The accessibility hint.


Sets accessibility hint for the view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

accessibilityLabel(label)

iOS
tvOS
ParameterTypeDescription
labelstring

The accessibility label.


Sets accessibility label for the view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

accessibilityValue(value)

iOS
tvOS
ParameterTypeDescription
valuestring

The accessibility value.


Sets accessibility value for the view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

allowsTightening(value)

iOS
tvOS
ParameterType
valueboolean

Sets whether text in this view can compress the space between characters when necessary to fit text in a line

Returns:
ModifierConfig

See: Official SwiftUI documentation.

animation(animationObject, animatedValue)

iOS
tvOS
ParameterType
animationObjectChainableAnimationType
animatedValuenumber | boolean

Returns:
ModifierConfig

aspectRatio(params)

iOS
tvOS
ParameterTypeDescription
params{ contentMode: 'fill' | 'fit', ratio: number }

Width/height aspect ratio and content mode.


Sets aspect ratio constraint.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

background(color, shape)

iOS
tvOS
ParameterTypeDescription
colorColor

The background color (hex string). For example, #FF0000.

shape(optional)Shape

Optional shape to clip the background. If not provided, the background will fill the entire view.


Sets the background of a view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

backgroundOverlay(params)

iOS
tvOS
ParameterTypeDescription
params{ alignment: 'center' | 'top' | 'bottom' | 'leading' | 'trailing', color: Color }

Background color and alignment.


Adds a background behind the view.

Returns:
ModifierConfig

badge(value)

iOS
tvOS
ParameterTypeDescription
value(optional)string

Text view to display as a badge. Set the value to nil to hide the badge.


Generates a badge for the view from a localized string key.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

badgeProminence(badgeType)

iOS
tvOS
ParameterTypeDescription
badgeType'standard' | 'increased' | 'decreased'

Select the type of badge


The prominence to apply to badges associated with this environment.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

blur(radius)

iOS
tvOS
ParameterTypeDescription
radiusnumber

The blur radius.


Applies blur to a view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

border(params)

iOS
tvOS
ParameterTypeDescription
params{ color: Color, width: number }

The border parameters. Color and width.


Adds a border to a view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

brightness(amount)

iOS
tvOS
ParameterTypeDescription
amountnumber

Brightness adjustment (-1 to 1).


Adjusts the brightness of a view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

buttonStyle(style)

iOS
tvOS
ParameterTypeDescription
style'bordered' | 'borderless' | 'automatic' | 'borderedProminent' | 'glass' | 'glassProminent' | 'plain'

The button style.


Sets the button style for button views.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

clipped(clipped)

iOS
tvOS
ParameterTypeDescription
clipped(optional)boolean

Whether to clip content.

Default:true

Clips content to bounds.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

clipShape(shape, cornerRadius)

iOS
tvOS
ParameterTypeDescription
shape'circle' | 'rectangle' | 'roundedRectangle'

The clipping shape.

cornerRadius(optional)number

Corner radius for rounded rectangle (default: 8)


Clips the view to a specific shape.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

colorInvert(inverted)

iOS
tvOS
ParameterTypeDescription
inverted(optional)boolean

Whether to invert colors.

Default:true

Inverts the colors of a view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

containerShape(shape)

iOS
tvOS
ParameterTypeDescription
shapeShape

A shape configuration from the shapes API


Sets the container shape for the view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

contrast(amount)

iOS
tvOS
ParameterTypeDescription
amountnumber

Contrast multiplier (0 to infinity, 1 = normal).


Adjusts the contrast of a view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

cornerRadius(radius)

iOS
tvOS
ParameterTypeDescription
radiusnumber

The corner radius value.


Applies corner radius to a view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

disabled(disabled)

iOS
tvOS
ParameterTypeDescription
disabled(optional)boolean

Whether the view should be disabled.

Default:true

Disables or enables a view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

fixedSize(params)

iOS
tvOS
ParameterTypeDescription
params(optional){ horizontal: boolean, vertical: boolean }

Whether the view should use its ideal width or height.


Controls fixed size behavior.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

font(params)

iOS
tvOS
ParameterTypeDescription
params{ design: 'rounded' | 'default' | 'serif' | 'monospaced', family: string, size: number, weight: 'bold' | 'black' | 'regular' | 'ultraLight' | 'thin' | 'light' | 'medium' | 'semibold' | 'heavy' }

The font configuration. When family is provided, it uses Font.custom(). When family is not provided, it uses Font.system() with the specified weight and design.


Sets the font properties of a view. Supports both custom font families and system fonts with weight and design options.

Returns:
ModifierConfig

Example

// Custom font family <Text modifiers={[font({ family: 'Helvetica', size: 18 })]}>Custom Font Text</Text> // System font with weight and design <Text modifiers={[font({ weight: 'bold', design: 'rounded', size: 16 })]}>System Font Text</Text>

foregroundColor(color)

iOS
tvOS
ParameterTypeDescription
colorColor

The foreground color (hex string).


Sets the foreground color/tint of a view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

foregroundStyle(style)

iOS
tvOS
ParameterTypeDescription
stylestring | { color: string, type: 'color' } | { style: 'primary' | 'secondary' | 'tertiary' | 'quaternary' | 'quinary', type: 'hierarchical' } | { colors: string[], endPoint: { x: number, y: number }, startPoint: { x: number, y: number }, type: 'linearGradient' } | { center: { x: number, y: number }, colors: string[], endRadius: number, startRadius: number, type: 'radialGradient' } | { center: { x: number, y: number }, colors: string[], type: 'angularGradient' }

The foreground style configuration. Can be:

Simple Color (string):

  • Hex colors: '#FF0000', '#RGB', '#RRGGBB', '#AARRGGBB'
  • Named colors: 'red', 'blue', 'green', and so on.

Explicit Color Object:

{ type: 'color', color: '#FF0000' }

Hierarchical Styles (Semantic): Auto-adapting semantic styles that respond to light/dark mode and accessibility settings:

{ type: 'hierarchical', style: 'primary' } // Most prominent (main content, headlines) { type: 'hierarchical', style: 'secondary' } // Supporting text, subheadlines { type: 'hierarchical', style: 'tertiary' } // Less important text, captions { type: 'hierarchical', style: 'quaternary' } // Subtle text, disabled states { type: 'hierarchical', style: 'quinary' } // Most subtle (iOS 16+, fallback to quaternary)

Linear Gradient:

{ type: 'linearGradient', colors: ['#FF0000', '#0000FF', '#00FF00'], startPoint: { x: 0, y: 0 }, // Top-left endPoint: { x: 1, y: 1 } // Bottom-right }

Radial Gradient:

{ type: 'radialGradient', colors: ['#FF0000', '#0000FF'], center: { x: 0.5, y: 0.5 }, // Center of view startRadius: 0, // Inner radius endRadius: 100 // Outer radius }

Angular Gradient (Conic):

{ type: 'angularGradient', colors: ['#FF0000', '#00FF00', '#0000FF'], center: { x: 0.5, y: 0.5 } // Rotation center }

Sets the foreground style of a view with comprehensive styling options.

Replaces the deprecated foregroundColor modifier with enhanced capabilities including colors, gradients, and semantic hierarchical styles that adapt to system appearance.

Returns:
ModifierConfig

A view modifier that applies the specified foreground style

See: Official SwiftUI documentation.

Example

// Simple usage <Text modifiers={[foregroundStyle('#FF0000')]}>Red Text</Text> // Adaptive hierarchical styling <Text modifiers={[foregroundStyle({ type: 'hierarchical', style: 'secondary' })]}> Supporting Text </Text> // Linear gradient <Text modifiers={[foregroundStyle({ type: 'linearGradient', colors: ['#FF6B35', '#F7931E', '#FFD23F'], startPoint: { x: 0, y: 0 }, endPoint: { x: 1, y: 0 } })]}> Gradient Text </Text>

frame(params)

iOS
tvOS
ParameterTypeDescription
params{ alignment: 'center' | 'top' | 'bottom' | 'leading' | 'trailing' | 'topLeading' | 'topTrailing' | 'bottomLeading' | 'bottomTrailing', height: number, idealHeight: number, idealWidth: number, maxHeight: number, maxWidth: number, minHeight: number, minWidth: number, width: number }

The frame parameters. Width, height, minWidth, maxWidth, minHeight, maxHeight, idealWidth, idealHeight and alignment.


Sets the frame properties of a view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

glassEffect(params)

iOS
tvOS
ParameterTypeDescription
params(optional){ cornerRadius: number, glass: { interactive: boolean, tint: Color, variant: 'clear' | 'regular' | 'identity' }, shape: 'circle' | 'rectangle' | 'roundedRectangle' | 'capsule' | 'ellipse' }

The glass effect parameters. Variant, interactive, tint and shape.


Applies a glass effect to a view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

glassEffectId(id, namespaceId)

iOS
tvOS
ParameterTypeDescription
idstring

The id of the glass effect.

namespaceIdstring

The namespace id of the glass effect. Use Namespace component to create a namespace.


Associates an identity value to Liquid Glass effects defined within a GlassEffectContainer.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

grayscale(amount)

iOS
tvOS
ParameterTypeDescription
amountnumber

Grayscale amount (0 to 1).


Makes a view grayscale.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

gridCellAnchor(anchor)

iOS
tvOS
ParameterTypeDescription
anchor{ anchor: 'center' | 'top' | 'bottom' | 'leading' | 'trailing' | 'topLeading' | 'topTrailing' | 'bottomLeading' | 'bottomTrailing' | 'zero', type: 'preset' } | { points: { x: number, y: number }, type: 'custom' }

The unit point that defines how to align the view within the bounds of its grid cell.


Specifies a custom alignment anchor for a view that acts as a grid cell.

Returns:
ModifierConfig

A view that uses the specified anchor point to align its content.

Example

// Using a preset anchor <Rectangle modifiers={[ gridCellAnchor({ type: 'preset', anchor: 'center' }), ]} /> // Using a custom anchor point <Rectangle modifiers={[ gridCellAnchor({ type: 'custom', points: { x: 0.3, y: 0.8 } }), ]} />

gridCellColumns(count)

iOS
tvOS
ParameterTypeDescription
count(optional)number

The number of columns that the view should consume when placed in a grid row.


Tells a view that acts as a cell in a grid to span the specified number of columns.

Returns:
ModifierConfig

A view that occupies the specified number of columns in a grid row.

gridCellUnsizedAxes(axes)

iOS
tvOS
ParameterTypeDescription
axes(optional)'horizontal' | 'vertical'

The dimensions in which the grid shouldn’t offer the view a share of any available space. This prevents a flexible view like a Spacer, Divider, or Color from defining the size of a row or column.


Asks grid layouts not to offer the view extra size in the specified axes.

Returns:
ModifierConfig

A view that doesn’t ask an enclosing grid for extra size in one or more axes.

gridColumnAlignment(alignment)

iOS
tvOS
ParameterTypeDescription
alignment(optional)'center' | 'leading' | 'trailing'

The HorizontalAlignment guide to use for the grid column that the view appears in.


Overrides the default horizontal alignment of the grid column that the view appears in.

Returns:
ModifierConfig

A view that uses the specified horizontal alignment, and that causes all cells in the same column of a grid to use the same alignment.

headerProminence(prominence)

iOS
tvOS
ParameterTypeDescription
prominence'standard' | 'increased'

The prominence to apply.


Sets the header prominence for this view.

Returns:
ModifierConfig

hidden(hidden)

iOS
tvOS
ParameterTypeDescription
hidden(optional)boolean

Whether the view should be hidden.

Default:true

Hides or shows a view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

hueRotation(angle)

iOS
tvOS
ParameterTypeDescription
anglenumber

Hue rotation angle in degrees.


Applies a hue rotation to a view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

ignoreSafeArea(params)

iOS
tvOS
ParameterTypeDescription
params(optional){ edges: 'top' | 'bottom' | 'leading' | 'trailing' | 'all' | 'horizontal' | 'vertical', regions: 'all' | 'container' | 'keyboard' }

The safe area regions to ignore and the edges to expand into.


Allows a view to ignore safe area constraints.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

kerning(value)

iOS
tvOS
ParameterType
value(optional)number

Sets the spacing, or kerning, between characters for the text in this view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

layoutPriority(priority)

iOS
tvOS
ParameterTypeDescription
prioritynumber

Layout priority value.


Sets layout priority for the view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

lineSpacing(value)

iOS
tvOS
ParameterTypeDescription
valuenumber

The amount of space between the bottom of one line and the top of the next line in points. This value is always nonnegative. Otherwise, the default value will be used.


The distance in points between the bottom of one line fragment and the top of the next.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

listRowBackground(color)

iOS
tvOS
ParameterTypeDescription
colorColor

The row color (hex string). For example, #FF0000.


Sets the background of a row.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

listRowInsets(params)

iOS
tvOS
ParameterTypeDescription
params{ bottom: number, leading: number, top: number, trailing: number }

The inset to apply to the rows in a list.


Applies an inset to the rows in a list.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

listRowSeparator(visibility, edges)

iOS
tvOS
ParameterTypeDescription
visibility'automatic' | 'visible' | 'hidden'

The visibility to apply.

edges(optional)'top' | 'bottom' | 'all'

The edges where the separator visibility applies.


Controls the visibility of the separator for a list row.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

listSectionMargins(params)

iOS
tvOS
ParameterTypeDescription
params(optional){ edges: 'top' | 'bottom' | 'leading' | 'trailing' | 'all' | 'horizontal' | 'vertical', length: number }

The margins to apply to the section in a list.


Allows a view to ignore safe area constraints.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

listSectionSpacing(spacing)

iOS
tvOS
ParameterTypeDescription
spacingnumber | 'default' | 'compact'

The spacing to apply.


Sets the spacing between adjacent sections.

Returns:
ModifierConfig

mask(shape, cornerRadius)

iOS
tvOS
ParameterTypeDescription
shape'circle' | 'rectangle' | 'roundedRectangle'

The masking shape.

cornerRadius(optional)number

Corner radius for rounded rectangle (default: 8).


Applies a mask to the view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

matchedGeometryEffect(id, namespaceId)

iOS
tvOS
ParameterTypeDescription
idstring

The id of the view.

namespaceIdstring

The namespace id of the view. Use Namespace component to create a namespace.


Adds a matched geometry effect to a view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

menuActionDismissBehavior(behavior)

iOS
tvOS
ParameterTypeDescription
behavior'enabled' | 'disabled' | 'automatic'

The menu action dismiss behavior.


Controls the dismissal behavior of menu actions.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

multilineTextAlignment(alignment)

iOS
tvOS
ParameterTypeDescription
alignment'center' | 'leading' | 'trailing'

A value that you use to align multiple lines of text within a view.


An alignment position for text along the horizontal axis.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

offset(params)

iOS
tvOS
ParameterTypeDescription
params{ x: number, y: number }

The offset parameters: x and y.


Applies an offset (translation) to a view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

onAppear(handler)

iOS
tvOS
ParameterTypeDescription
handler() => void

Function to call when the view appears.


Adds an onAppear modifier that calls a function when the view appears.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

onDisappear(handler)

iOS
tvOS
ParameterTypeDescription
handler() => void

Function to call when the view disappears.


Adds an onDisappear modifier that calls a function when the view disappears.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

onLongPressGesture(handler, minimumDuration)

iOS
tvOS
ParameterTypeDescription
handler() => void

Function to call when long pressed.

minimumDuration(optional)number

Minimum duration for long press (default: 0.5s)


Adds a long press gesture recognizer.

Returns:
ModifierConfig

onTapGesture(handler)

iOS
tvOS
ParameterTypeDescription
handler() => void

Function to call when tapped.


Adds a tap gesture recognizer.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

opacity(value)

iOS
tvOS
ParameterTypeDescription
valuenumber

Opacity value between 0 and 1.


Sets the opacity of a view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

overlay(params)

iOS
tvOS
ParameterTypeDescription
params{ alignment: 'center' | 'top' | 'bottom' | 'leading' | 'trailing', color: Color }

Overlay color and alignment.


Overlays another view on top.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

padding(params)

iOS
tvOS
ParameterTypeDescription
params(optional){ all: number, bottom: number, horizontal: number, leading: number, top: number, trailing: number, vertical: number }

The padding parameters: top, bottom, leading, trailing, horizontal, vertical and all.


Sets padding on a view. Supports individual edges or shorthand properties.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

pickerStyle(style)

iOS
tvOS
ParameterTypeDescription
stylePickerStyleType

The style for the picker.


Sets the style for the picker.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

refreshable(handler)

iOS
tvOS
ParameterTypeDescription
handler() => Promise<void>

Async function to call when refresh is triggered.


Marks a view as refreshable. Adds pull-to-refresh functionality.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

rotationEffect(angle)

iOS
tvOS
ParameterTypeDescription
anglenumber

Rotation angle in degrees.


Applies rotation transformation.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

saturation(amount)

iOS
tvOS
ParameterTypeDescription
amountnumber

Saturation multiplier (0 to infinity, 1 = normal).


Adjusts the saturation of a view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

scaleEffect(scale)

iOS
tvOS
ParameterTypeDescription
scalenumber

Scale factor (1.0 = normal size).


Applies scaling transformation.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

scrollContentBackground(visible)

iOS
tvOS
ParameterTypeDescription
visible'automatic' | 'visible' | 'hidden'

The visibility of the background.


Specifies the visibility of the background for scrollable views within this view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

scrollDismissesKeyboard(mode)

iOS
tvOS
ParameterTypeDescription
mode'automatic' | 'never' | 'interactively' | 'immediately'

The keyboard dismiss mode.


Controls how the keyboard is dismissed when scrolling.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

shadow(params)

iOS
tvOS
ParameterTypeDescription
params{ color: Color, radius: number, x: number, y: number }

The shadow parameters: radius, offset (x, y) and color.


Adds a shadow to a view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

strikethrough(params)

iOS
tvOS
ParameterTypeDescription
params{ color: Color, isActive: boolean, pattern: LinePattern }

Controls whether the strikethrough is visible (true to show, false to hide).


Applies a strikethrough to the text.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

submitLabel(submitLabel)

iOS
tvOS
ParameterTypeDescription
submitLabel'join' | 'search' | 'continue' | 'done' | 'go' | 'next' | 'return' | 'route' | 'send'

The label to display in the keyboard's return key.


Specifies the label to display in the keyboard's return key. For example, 'done'.

Returns:
ModifierConfig

A view that uses the specified submit label.

Example

<TextField modifiers={[ submitLabel('search'), ]} />

tag(tag)

iOS
tvOS
ParameterTypeDescription
tagstring | number

The tag to set on the view.


Sets a tag on a view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

textCase(value)

iOS
tvOS
ParameterType
value'lowercase' | 'uppercase'

Sets a transform for the case of the text contained in this view when displayed.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

textFieldStyle(style)

iOS
tvOS
ParameterTypeDescription
style'automatic' | 'plain' | 'roundedBorder'

The text field style.


Sets the text field style for text field views.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

textSelection(value)

iOS
tvOS
ParameterTypeDescription
valueboolean

Enable selection


Controls whether people can select text within this view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

tint(color)

iOS
tvOS
ParameterTypeDescription
colorColor

The tint color (hex string). For example, #FF0000.


Sets the tint color of a view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

truncationMode(mode)

iOS
tvOS
ParameterTypeDescription
mode'head' | 'middle' | 'tail'

The truncation mode that specifies where to truncate the text within the text view, if needed. You can truncate at the beginning, middle, or end of the text view.


Sets the truncation mode for lines of text that are too long to fit in the available space.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

underline(params)

iOS
tvOS
ParameterTypeDescription
params{ color: Color, isActive: boolean, pattern: LinePattern }

Controls whether the underline is visible (true to show, false to hide).


Applies an underline to the text.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

zIndex(index)

iOS
tvOS
ParameterTypeDescription
indexnumber

The z-index value.


Sets the z-index (display order) of a view.

Returns:
ModifierConfig

See: Official SwiftUI documentation.

Types

Color

iOS
tvOS

Literal Type: union

Acceptable values are: string | ColorValue | NamedColor

PickerStyleType

iOS
tvOS

Literal Type: string

Acceptable values are: 'automatic' | 'inline' | 'menu' | 'navigationLink' | 'palette' | 'segmented' | 'wheel'

Shape

iOS
tvOS

Literal Type: ReturnType

Acceptable values are: ReturnType<shapes.roundedRectangle> | ReturnType<shapes.capsule> | ReturnType<shapes.rectangle> | ReturnType<shapes.ellipse> | ReturnType<shapes.circle>