How to Style a NavigationLink as a Button in SwiftUI

Written by

in

Quick answer: A NavigationLink inside a List is drawn as a row, so button styles cannot remove the chevron or the full-width hit area. Use a Button that sets state and push the destination with navigationDestination(isPresented:) on iOS 17+, or NavigationLink(isActive:) on older versions.

Why this happens

NavigationLink is not a Button. It is a navigation primitive that happens to be tappable. When you place it inside a List, SwiftUI renders it as a row: full width, with a disclosure chevron on the trailing edge, and the row’s own hit area. .buttonStyle never reaches that chrome because the List row draws it, not the link.

Outside a List the link uses its label as-is, but it still picks up the accent-colour tint and, depending on the container, the full available width. So Text("Starten") wrapped in a NavigationLink reads as a link, not as a button.

The second problem is ordering. A NavigationLink‘s only action is the navigation itself — there is no closure to run code before the push. If you need to start a timer, log an event, or validate input first, the link has nowhere to put that work. That is why the accepted answer binds the link to state instead of wrapping a view in it.

How to fix it

1. Apply a button style to the link itself

If the link is not rendered as a List row, NavigationLink respects button styles. On iOS 16+ use the value-based initializer and register the destination once, higher up the hierarchy:

NavigationLink(value: workout) {
    Text("Starten")
}
.buttonStyle(.borderedProminent)
.navigationDestination(for: Workout.self) { workout in
    TimerView(workout: workout)
}

Workout only needs to conform to Hashable. The link now looks like a real button, keeps the standard push animation, and still shows the workout title and back button in the navigation bar.

This is the closest modern equivalent of the buttonStyle answer. It is also the least code — but it still cannot run anything before navigating, and it does not help inside a List.

2. Drive navigation from a Button instead

When you need to run code first, or when the link sits in a List row, drop the NavigationLink wrapper and use a Button that flips state.

On iOS 17 and later, navigationDestination(isPresented:) is the shortest correct form:

struct WorkoutDetail: View {
    let workout: Workout
    @State private var showTimer = false

    var body: some View {
        VStack {
            Button("Starten") {
                // start logging, warm up the timer, validate, etc.
                showTimer = true
            }
            .buttonStyle(.borderedProminent)
        }
        .navigationTitle(workout.title)
        .navigationDestination(isPresented: $showTimer) {
            TimerView(workout: workout)
        }
    }
}

The Button gets the full button treatment — tint, padding, pressed state — because it really is a button. The push still uses the standard navigation animation, and the back button and title behave exactly as before.

On iOS 13–16, use the isActive initializer with an empty label. The link renders nothing, but it still observes the binding:

struct WorkoutDetail: View {
    let workout: Workout
    @State private var isTimerActive = false

    var body: some View {
        VStack {
            Button("Starten") {
                isTimerActive = true
            }
            .buttonStyle(.borderedProminent)

            NavigationLink(isActive: $isTimerActive) {
                TimerView(workout: workout)
            } label: {
                EmptyView()
            }
        }
        .navigationTitle(workout.title)
    }
}

This is the same idea as the tag/selection answer, with one binding instead of an integer tag. It is simpler when there is only one destination, and it avoids the deprecated tag:selection: initializer.

If you have several destinations on the same screen, keep a path at the NavigationStack level and pass a binding down, rather than scattering booleans across views:

@State private var path = NavigationPath()

// later, from any child view:
path.append(Route.timer(workout))

3. Deal with the List row, or move the button out of it

If the NavigationLink is a row in a List, no button style will remove the chevron. The row draws it, and there is no public API to turn it off. .listRowInsets and .listRowBackground change the padding and background, not the indicator.

You have two honest options:

  • Keep the row as a NavigationLink — that is what a row is for — and put the action button somewhere else: a toolbar item, a section footer, or a view below the List.
  • Replace the row with a Button and push programmatically using the pattern in step 2.

Also note that .navigationBarTitle(Text(...)) is the old spelling. Use .navigationTitle(workout.title) on iOS 14 and later; the old modifier still compiles but is deprecated.

How to prevent it

  • Decide up front whether a control is a row (navigates) or an action (does something). Rows get NavigationLink; actions get Button plus state.
  • Keep navigation state in one place — a single NavigationPath or a single boolean per screen — instead of mixing links and bindings.
  • Register destinations once with .navigationDestination(for:) and pass Hashable values, so you never duplicate destination closures.
  • Do not nest a NavigationStack inside a view that is already pushed onto a stack; it creates a second, independent stack.
  • Prefer built-in styles (.borderedProminent, .bordered, .plain) over hand-rolled padding and background shapes, so pressed and disabled states stay correct.

FAQ

Can I remove the chevron from a NavigationLink inside a List?

No. The disclosure indicator is drawn by the List row, not by the link, and there is no public modifier to hide it. Use a Button with programmatic navigation if the chevron is unacceptable.

Does .buttonStyle work on NavigationLink?

Yes, as long as the link is not being rendered as a List row. .borderedProminent, .bordered, .plain and custom ButtonStyle implementations all apply to the link’s label.

Is NavigationLink(tag:selection:) deprecated?

Yes. iOS 16 deprecated the tag/selection initializer in favour of NavigationStack and navigationDestination(for:). It still compiles and runs, but you will get deprecation warnings, so prefer isActive or a path binding in new code.

Sources & credits

Parts of this guide are adapted from content licensed under CC BY-SA 4.0; this article is shared under the same license.