Interactive previews iPhone

Text Tightening

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

Text Tightening - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview

Platform Compatibility

iOS 13.0+ iPadOS 13.0+ macOS 10.15+ watchOS 6.0+ tvOS 13.0+ visionOS 1.0+

Tags

SwiftUI Code

Docs
VStack {
    Text("FooBar FooBar")
        .lineLimit(1)
        .allowsTightening(true)
        .frame(width: width, alignment: .leading)
        .background(.red)

    Text("FooBar FooBar")
        .lineLimit(1)
        .allowsTightening(false)
        .frame(width: width, alignment: .leading)
        .background(.red)
}

Found an issue or have a suggestion?

Created: December 3, 2026Updated: December 3, 2026

More View Components

View all
Scroll Gesture Axis Lock - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Scroll Gesture Axis Lock

Sets whether scrollable views within this view lock each scroll gesture to its predominant axis. On macOS, scroll gestures lock to their predominant axis by default. On iOS, iPadOS, Mac Catalyst, visionOS, and watchOS, scroll gestures move along both axes at once.

VisionOS background materials - visionOS - Liquid Glass - Light Mode - Preview
type

VisionOS background materials

All background materials on visionOS

Container Content Margins - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Container Content Margins

Adds the margins of the container the view is in.

Toolbar Vertical Edge - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
environment

Toolbar Vertical Edge

This value reflects the system’s preferred edge for the vertical bar in the current context, regardless of whether a vertical bar is currently visible. Use it to position custom bars or other UI relative to the system’s bar placement.

Hinge State - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview
structure

Hinge State

A type encapsulating the state of a single hinge.

Disabled Toolbar Vertical Behavior - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview
modifier

Disabled Toolbar Vertical Behavior

Disables the vertical bar.

Music Picker - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Music Picker

Presents a music picker to select items from the Apple Music catalog and the user’s music library.

App Store Overlay - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

App Store Overlay

Presents a StoreKit overlay when a given condition is true.

Explore Other Components

Browse all
Async URL Image - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Async URL Image

Loads and displays an image from the specified URL load request.

Label Icon To Title Spacing - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Label Icon To Title Spacing

Set the spacing between the icon and title in labels.

Upgrade Only Subscription Store View - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Upgrade Only Subscription Store View

Creates a view that loads all subscriptions from a subscription group but displays only the higher-level ones. In this case, the VIP Kitty Pass is already active, which is why only the higher-tier Royal Kitty Pass is displayed.

Divider Height - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

Divider Height

Customizing the height of the Divider

Role Button With Default Label - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Role Button With Default Label

Creates a button that displays a default label.

Icon Phase Store View - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Icon Phase Store View

Creates a view to load a collection of products from the App Store using product identifiers, and merchandise them using their promotional images and a custom placeholder icon.

Menu - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Menu

A control for presenting a menu of actions.

Overlay Arrangement ZIndex - iOS on iPhone Duo - Landscape - Fully Open - Liquid Glass - Light Mode - Preview
environment

Overlay Arrangement ZIndex

The z-index for a view within an overlay arrangement view.