ComponentsShape

Capsule

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

Example

Requires React 18.2+ or 19 and shared styles. See setup.

Default

Loading preview…

Code
'use client';
import { Capsule } from '@swiftuijs/ui';
export default function Example() {
    return (<Capsule fill="#007aff" style={{ width: 180, height: 64 }}></Capsule>);
}

More examples

With Stroke

API reference

PropTypeRequiredDescription
fillstringNo—
strokestringNo—
strokeWidthnumberNo—

Inherits additional props from IBaseComponent.