---
title: Capsule
framework: swiftui
role: symbol
role_heading: Structure
path: swiftui/capsule
---

# Capsule

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

## Declaration

```swift
@frozen struct Capsule
```

## Mentioned in

Applying Liquid Glass to custom views

## Overview

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:)](swiftui/capsule/init(style:).md)

### Getting the shape’s characteristics

- [style](swiftui/capsule/style.md)

## Relationships

### Conforms To

- [Animatable](swiftui/animatable.md)
- [Copyable](swift/copyable.md)
- [Escapable](swift/escapable.md)
- [InsettableShape](swiftui/insettableshape.md)
- [RoundedRectangularShape](swiftui/roundedrectangularshape.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
- [Shape](swiftui/shape.md)
- [View](swiftui/view.md)

## See Also

### Creating circular shapes

- [Circle](swiftui/circle.md)
- [Ellipse](swiftui/ellipse.md)
