SwiftUI.js
ComponentsShape

Capsule

Capsule renders a pill-shaped surface with fully rounded ends, aligned with SwiftUI's `Capsule` mental model.

Capsule renders a pill-shaped surface with fully rounded ends, aligned with SwiftUI's `Capsule` mental model.

Examples

Default

Preview unavailable for this example in the static docs build.

Show code
<Capsule fill="#007aff" style={{ width: 180, height: 64 }}></Capsule>

Variants

Preview unavailable for this example in the static docs build.

Show code
<Capsule fill="#e0f2fe" stroke="#0284c7" strokeWidth={2} style={{ width: 200, height: 72 }}></Capsule>

API

PropTypeRequiredDescription
fillstringNoNo description yet.
strokestringNoNo description yet.
strokeWidthnumberNoNo description yet.

Inherits additional props from IBaseComponent.

Overview

Capsule renders a pill-shaped surface with fully rounded ends, aligned with SwiftUI's Capsule mental model.

On this page