# SwiftUI Vertical Divider

Using the standard `Divider` view and setting its width to `1` will create a vertical divider: `Divider().frame(width: 1)`

Example in action:

```swift
struct VerticalDividerExample: View {
    var body: some View {
        HStack(spacing: 20) {
           Text("Left")
           Divider().frame(width: 1)
           Text("Right")
        }
        .padding()
        .frame(width: 200, height: 75)
    }
}
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1673387934176/50d88bbd-ad79-46ab-ae86-e76fd429c40e.png align="center")

Setting its width to anything greater than 1 will also produce the vertical effect but it will not render greater than one pixel wide and instead just add padding on each side.

We use vertical dividers in the stats view in our [time tracking app, Tim](https://tim.neat.software).

[![](https://cdn.hashnode.com/res/hashnode/image/upload/v1673388728854/269b0f35-caec-41bf-8df6-514a7e697cca.png align="center")](https://tim.neat.software)
