<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.15.0 -",
    "tvOS: 13.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 6.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "SwiftUI",
  "identifier" : "/documentation/SwiftUI/Capsule",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "SwiftUI"
    ],
    "preciseIdentifier" : "s:7SwiftUI7CapsuleV"
  },
  "title" : "Capsule"
}
-->

# Capsule

A capsule shape aligned inside the frame of the view containing it.

```
@frozen struct Capsule
```

## Overview

A capsule shape is equivalent to a rounded rectangle where the corner radius
is chosen as half the length of the rectangle’s smallest edge.

## Topics

### Creating a capsule

[`init(style:)`](/documentation/SwiftUI/Capsule/init(style:))

Creates a new capsule shape.

### Getting the shape’s characteristics

[`style`](/documentation/SwiftUI/Capsule/style)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)