SwiftUI Modifiers

Explore SwiftUI view modifiers with iOS version compatibility information

132 modifiers documented
Filter by Category
Filter by iOS Version

Showing 132 modifiers

.accentColor()
iOS 13+

Sets the accent color.

Environment
Learn more →
.accessibilityAction()
iOS 13+

Adds a custom accessibility action.

Accessibility
Learn more →
.accessibilityActivationPoint()
iOS 13+

Sets the activation point for accessibility.

Accessibility
Learn more →
.accessibilityAddTraits()
iOS 13+

Adds accessibility traits.

Accessibility
Learn more →
.accessibilityAdjustableAction()
iOS 13+

Adds an adjustable action for accessibility.

Accessibility
Learn more →
.accessibilityElement()
iOS 13+

Makes the view an accessibility element.

Accessibility
Learn more →
.accessibilityHidden()
iOS 13+

Hides the view from accessibility.

Accessibility
Learn more →
.accessibilityHint()
iOS 13+

Adds a hint for accessibility.

Accessibility
Learn more →
.accessibilityIdentifier()
iOS 13+

Sets an identifier for UI testing.

Accessibility
Learn more →
.accessibilityLabel()
iOS 13+

Adds a label to the view for accessibility.

Accessibility
Learn more →
.accessibilityRemoveTraits()
iOS 13+

Removes accessibility traits.

Accessibility
Learn more →
.accessibilityScrollAction()
iOS 13+

Adds a scroll action for accessibility.

Accessibility
Learn more →
.accessibilitySortPriority()
iOS 13+

Sets the sort priority for accessibility.

Accessibility
Learn more →
.accessibilityValue()
iOS 13+

Adds a value description for accessibility.

Accessibility
Learn more →
.actionSheet()
iOS 13+

Presents an action sheet (deprecated in iOS 15).

Navigation
Learn more →
.alert()
iOS 13+

Presents an alert.

Navigation
Learn more →
.allowsHitTesting()
iOS 13+

Controls whether the view participates in hit testing.

Interaction
Learn more →
.allowsTightening()
iOS 13+

Allows text tightening.

Text
Learn more →
.animation()
iOS 13+

Applies an animation to all animatable values.

Animation
Learn more →
.aspectRatio()
iOS 13+

Constrains the view's dimensions to the specified aspect ratio.

Layout
Learn more →
.autocapitalization()
iOS 13+

Sets the autocapitalization behavior.

Form
Learn more →
.backgroundExtensionEffect()
iOS 26+

Duplicates a view into mirrored copies around its edges, creating an extended background effect.

Visual Effects
Learn more →
.background()
iOS 13+

Layers a view behind the current view, useful for adding colors, gradients, images, or custom views as backgrounds.

Visual Effects
Learn more →
.baselineOffset()
iOS 13+

Offsets text from its baseline.

Text
Learn more →
.blendMode()
iOS 13+

Sets the blend mode for the view.

Visual Effects
Learn more →
.blur()
iOS 13+

Applies a Gaussian blur effect to a view with a specified radius.

Visual Effects
Learn more →
.bold()
iOS 13+

Makes text bold.

Text
Learn more →
.border()
iOS 13+

Adds a border to the view.

Visual Effects
Learn more →
.brightness()
iOS 13+

Brightens the view by the specified amount.

Visual Effects
Learn more →
.buttonStyle()
iOS 13+

Sets the style for buttons.

Form
Learn more →
.clipShape()
iOS 13+

Clips the view to a shape.

Visual Effects
Learn more →
.clipped()
iOS 13+

Clips the view to its bounding rectangle.

Visual Effects
Learn more →
.colorInvert()
iOS 13+

Inverts the colors of the view.

Visual Effects
Learn more →
.colorMultiply()
iOS 13+

Multiplies the view colors by a color.

Visual Effects
Learn more →
.compositingGroup()
iOS 13+

Wraps the view in a compositing group.

Visual Effects
Learn more →
.confirmationDialog()
iOS 15+

Presents a confirmation dialog.

Navigation
Learn more →
.contentShape()
iOS 13+

Defines the content shape for hit testing.

Interaction
Learn more →
.contextMenu()
iOS 13+

Adds a context menu to the view.

Interaction
Learn more →
.contrast()
iOS 13+

Sets the contrast of the view.

Visual Effects
Learn more →
.coordinateSpace()
iOS 13+

Assigns a name to the view's coordinate space.

Layout
Learn more →
.cornerRadius()
iOS 13+

Clips the view to a rounded rectangle.

Visual Effects
Learn more →
.datePickerStyle()
iOS 13+

Sets the style for date pickers.

Form
Learn more →
.disableAutocorrection()
iOS 13+

Disables autocorrection.

Form
Learn more →
.disabled()
iOS 13+

Disables user interaction with the view.

Interaction
Learn more →
.drawingGroup()
iOS 13+

Composites the view's contents into an offscreen image.

Visual Effects
Learn more →
.edgesIgnoringSafeArea()
iOS 13+

Extends the view beyond the safe area.

Layout
Learn more →
.environmentObject()
iOS 13+

Supplies an observable object to the environment.

Environment
Learn more →
.environment()
iOS 13+

Sets an environment value.

Environment
Learn more →
.fill()
iOS 13+

Fills a shape with a style.

Drawing
Learn more →
.fixedSize()
iOS 13+

Fixes the view's size to its ideal size.

Layout
Learn more →
.fontWeight()
iOS 13+

Sets the font weight.

Text
Learn more →
.font()
iOS 13+

Sets the font for text.

Text
Learn more →
.foregroundColor()
iOS 13+

Sets the color of the foreground elements.

Visual Effects
Learn more →
.foregroundStyle()
iOS 15+

Sets the color, gradient, or material for text and symbols in a view hierarchy.

Visual Effects
Learn more →
.frame()
iOS 13+

Sets the size and alignment of a view using width, height, and alignment parameters.

Layout
Learn more →
.fullScreenCover()
iOS 14+

Presents a full-screen cover.

Navigation
Learn more →
.gaugeStyle()
iOS 16+

Sets the style for gauges.

Form
Learn more →
.gesture()
iOS 13+

Attaches a gesture to the view.

Interaction
Learn more →
.glassEffect()
iOS 26+

Applies the Liquid Glass effect to a view, creating a translucent, frosted-glass appearance that adapts to light and dark mode.

Visual Effects
Learn more →
.grayscale()
iOS 13+

Adds a grayscale effect to the view.

Visual Effects
Learn more →
.help()
iOS 14+

Adds a help tooltip.

Accessibility
Learn more →
.hidden()
iOS 13+

Hides the view.

Layout
Learn more →
.highPriorityGesture()
iOS 13+

Attaches a high-priority gesture.

Interaction
Learn more →
.hueRotation()
iOS 13+

Rotates the hue of the view.

Visual Effects
Learn more →
.italic()
iOS 13+

Makes text italic.

Text
Learn more →
.kerning()
iOS 13+

Sets the spacing between characters.

Text
Learn more →
.keyboardType()
iOS 13+

Sets the keyboard type for text input.

Form
Learn more →
.labelStyle()
iOS 14+

Sets the style for labels.

Form
Learn more →
.layoutPriority()
iOS 13+

Sets the priority by which a parent layout should allocate space.

Layout
Learn more →
.lineLimit()
iOS 13+

Limits the number of lines.

Text
Learn more →
.lineSpacing()
iOS 13+

Sets the spacing between lines.

Text
Learn more →
.listRowBackground()
iOS 13+

Sets the background for list rows.

List
Learn more →
.listRowInsets()
iOS 13+

Sets the insets for list rows.

List
Learn more →
.listSectionMargins()
iOS 26+

Sets the section margins for specific edges in a List view, allowing precise control over spacing.

Layout
Learn more →
.listStyle()
iOS 13+

Sets the style for lists.

List
Learn more →
.luminanceToAlpha()
iOS 13+

Converts luminance to alpha values.

Visual Effects
Learn more →
.mask()
iOS 13+

Masks the view using another view.

Visual Effects
Learn more →
.minimumScaleFactor()
iOS 13+

Sets the minimum scale factor for text.

Text
Learn more →
.multilineTextAlignment()
iOS 13+

Sets text alignment for multiline text.

Text
Learn more →
.navigationBarBackButtonHidden()
iOS 13+

Hides the back button in the navigation bar.

Navigation
Learn more →
.navigationBarHidden()
iOS 13+

Hides the navigation bar.

Navigation
Learn more →
.navigationBarItems()
iOS 13+

Sets navigation bar items (deprecated).

Navigation
Learn more →
.navigationBarTitle()
iOS 13+

Sets the navigation bar title (deprecated).

Navigation
Learn more →
.navigationTitle()
iOS 14+

Sets the title in the navigation bar.

Navigation
Learn more →
.offset()
iOS 13+

Offsets the view by the specified amount.

Layout
Learn more →
.onAppear()
iOS 13+

Adds an action to perform when the view appears.

Lifecycle
Learn more →
.onChange()
iOS 14+

Adds an action to perform when a value changes.

Lifecycle
Learn more →
.onDelete()
iOS 13+

Adds delete functionality to list rows.

List
Learn more →
.onDisappear()
iOS 13+

Adds an action to perform when the view disappears.

Lifecycle
Learn more →
.onLongPressGesture()
iOS 13+

Adds an action to perform when the view is long-pressed.

Interaction
Learn more →
.onMove()
iOS 13+

Adds move functionality to list rows.

List
Learn more →
.onReceive()
iOS 13+

Adds an action to perform when a publisher emits a value.

Lifecycle
Learn more →
.onTapGesture()
iOS 13+

Adds an action to perform when the view is tapped.

Interaction
Learn more →
.opacity()
iOS 13+

Sets the transparency of a view, where 0 is fully transparent and 1 is fully opaque.

Visual Effects
Learn more →
.overlay()
iOS 13+

Layers a view in front of the current view.

Visual Effects
Learn more →
.padding()
iOS 13+

Adds space around a view's content, with options for all edges, specific edges, or custom insets.

Layout
Learn more →
.pickerStyle()
iOS 13+

Sets the style for pickers.

Form
Learn more →
.popover()
iOS 13+

Presents a popover.

Navigation
Learn more →
.position()
iOS 13+

Positions the center of the view at the specified coordinates.

Layout
Learn more →
.preferredColorScheme()
iOS 13+

Sets the preferred color scheme.

Environment
Learn more →
.progressViewStyle()
iOS 14+

Sets the style for progress views.

Form
Learn more →
.projectionEffect()
iOS 13+

Applies a projection transformation.

Animation
Learn more →
.refreshable()
iOS 15+

Marks a view as refreshable.

List
Learn more →
.rotationEffect()
iOS 13+

Rotates the view's rendered output.

Animation
Learn more →
.rotation3DEffect()
iOS 13+

Rotates the view in 3D space.

Animation
Learn more →
.saturation()
iOS 13+

Adjusts the color saturation of the view.

Visual Effects
Learn more →
.scaleEffect()
iOS 13+

Scales the view's rendered output.

Animation
Learn more →
.scaledToFill()
iOS 13+

Scales the view to fill its parent.

Layout
Learn more →
.scaledToFit()
iOS 13+

Scales the view to fit its parent.

Layout
Learn more →
.searchable()
iOS 15+

Adds search functionality.

List
Learn more →
.shadow()
iOS 13+

Adds a shadow effect beneath a view with customizable color, radius, and offset.

Visual Effects
Learn more →
.sheet()
iOS 13+

Presents a sheet when a binding to a Boolean value is true.

Navigation
Learn more →
.simultaneousGesture()
iOS 13+

Attaches a gesture that can run simultaneously with others.

Interaction
Learn more →
.spatialOverlay()
iOS 26+

Overlays SwiftUI views on 3D models using 3D alignment instead of 2D positioning, enabling AR and 3D experiences.

3D & AR
Learn more →
.strikethrough()
iOS 13+

Strikes through text.

Text
Learn more →
.stroke()
iOS 13+

Strokes a shape with a style.

Drawing
Learn more →
.tabItem()
iOS 13+

Sets the tab bar item for a view.

Navigation
Learn more →
.task()
iOS 15+

Adds an async task to perform when the view appears.

Lifecycle
Learn more →
.textCase()
iOS 14+

Sets the text case (uppercase/lowercase).

Text
Learn more →
.textContentType()
iOS 13+

Sets the text content type for autofill.

Form
Learn more →
.textFieldStyle()
iOS 13+

Sets the style for text fields.

Form
Learn more →
.tint()
iOS 15+

Sets the tint color.

Environment
Learn more →
.toggleStyle()
iOS 13+

Sets the style for toggles.

Form
Learn more →
.toolbar()
iOS 14+

Populates the toolbar with views.

Navigation
Learn more →
.tracking()
iOS 13+

Sets the tracking (letter spacing).

Text
Learn more →
.transformEffect()
iOS 13+

Applies an affine transformation.

Animation
Learn more →
.transformEnvironment()
iOS 13+

Transforms an environment value.

Environment
Learn more →
.transition()
iOS 13+

Associates a transition with the view.

Animation
Learn more →
.trim()
iOS 13+

Trims a shape.

Drawing
Learn more →
.truncationMode()
iOS 13+

Sets the truncation mode for text.

Text
Learn more →
.underline()
iOS 13+

Underlines text.

Text
Learn more →
.zIndex()
iOS 13+

Controls the z-order of overlapping views.

Layout
Learn more →

Browse by Category

Visual Effects
25

Modifiers for colors, opacity, blur, shadows, and material effects

.backgroundExtensionEffect().background().blendMode() +22 more
Layout
14

Modifiers for positioning, sizing, and spacing views

.aspectRatio().coordinateSpace().edgesIgnoringSafeArea() +11 more
3D & AR
1

Modifiers for spatial computing and augmented reality

.spatialOverlay()
Animation
7

Modifiers for animating view changes and transitions

.animation().projectionEffect().rotationEffect() +4 more
Interaction
9

Modifiers for gestures, tap actions, and user input

.allowsHitTesting().contentShape().contextMenu() +6 more
Accessibility
14

Modifiers for VoiceOver, labels, and accessibility features

.accessibilityAction().accessibilityActivationPoint().accessibilityAddTraits() +11 more

Make Informed Deployment Decisions