Interactive previews iPhone

EditButton

A button that toggles the edit mode environment value

EditButton - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview

Platform Compatibility

iOS 13.0+ iPadOS 13.0+ visionOS 1.0+

Tags

SwiftUI Code

Docs
@Environment(\.editMode) private var editMode
@State private var name = "Foo"

var body: some View {
    HStack {
        if editMode?.wrappedValue.isEditing == true {
            TextField("Name", text: $name)
        } else {
            Text(name)
        }
        EditButton()
    }
}

Found an issue or have a suggestion?

Created: June 3, 2025Updated: December 27, 2025

More Button Components

View all
Button Sizing - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Button Sizing

The preferred sizing behavior of buttons in the view hierarchy.

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.

Glass Button Styles - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

Glass Button Styles

A button style that applies glass border artwork based on the button’s context

RenameButton - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
TextField

RenameButton

A button that triggers a standard rename action

PasteButton - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
type

PasteButton

A system button that reads items from the pasteboard and delivers it to a closure.

Button Tint - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

Button Tint

Sets the buttons tint color

Button Roles - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

Button Roles

A value that describes the purpose of a button.

Button Border Shape - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview

Button Border Shape

A shape used to draw a button’s border.

Explore Other Components

Browse all
Tab View Side Bar Bottom Bar - iPadOS - Landscape - Liquid Glass - Light Mode - Preview
modifier

Tab View Side Bar Bottom Bar

Adds a custom bottom bar to the sidebar of a tab view.

CircularProgressViewStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

CircularProgressViewStyle

The style of a progress view that uses a circular gauge to indicate the partial completion of an activity

Content Unavailable Search - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
type

Content Unavailable Search

A pre-built placeholder for empty search results

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

Vertical Divider

A vertical visual element that can be used to separate other content

 LinearGaugeStyle - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview
style

LinearGaugeStyle

A gauge style that displays a bar with a marker that appears at a point along the bar to indicate the gauge’s current value

TabsPickerStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

TabsPickerStyle

A picker style that presents options as segmented tabs. On macOS, this style produces a segmented picker with a visual treatment that distinguishes tab navigation from value selection. On iOS, tvOS, and visionOS, the visual appearance matches that of the standard standard .segmented style. On all supported platforms, VoiceOver announces options as tabs.

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

ProgressView

The different ProgressView initializers

InsetGroupedListStyle - iOS on iPhone - Portrait - Flat Design - Light Mode - Preview
style

InsetGroupedListStyle

The list style that describes the behavior and appearance of an inset grouped list.