# SwiftUI forms: Stepper

> Learn how to use the Stepper control in SwiftUI to pick a number with minus and plus buttons, and how the in parameter limits the range of values.

Author: Flavio Copes | Published: 2021-09-29 | Canonical: https://flaviocopes.com/swiftui-forms-stepper/

Another useful control we can use in forms is the `Stepper` view, which lets us select a number and gives a `-` and `+` button to decrease or increase it.

We link it to the value of a property with a `@State` property wrapper, in this case `counter`:

```swift
struct ContentView: View {
    @State private var counter = 0

    var body: some View {
        Form {
            Stepper("The counter is \(counter)", value: $counter)
        }
    }
}
```

![Xcode showing SwiftUI code and iPhone simulator with a form containing a stepper control displaying The counter is 0](https://flaviocopes.com/images/swiftui-forms-stepper/Screen_Shot_2021-09-23_at_18.41.15.png)

You can use the `in` parameter of `Stepper` to limit the range of values it can accept:

```swift
Stepper("The counter is \(counter)", value: $counter, in: 0...10)
```

When you reach a limit, the control to increase or decrease will be gray and non-interactive.
