ComponentsShape
Circle
Circle is a circular shape. Circle is used to create circular visual elements, such as avatars, badges, and indicators.
Circle is a circular shape. Circle is used to create circular visual elements, such as avatars, badges, and indicators.
Examples
Basic Usage
Preview unavailable for this example in the static docs build.
Show code
<Circle fill="#007AFF" style={{ width: '100px', height: '100px' }}></Circle>With Stroke
Preview unavailable for this example in the static docs build.
Show code
<Circle fill="#007AFF" stroke="#0051D5" strokeWidth={3} style={{ width: '100px', height: '100px' }}></Circle>API
| Prop | Type | Required | Description |
|---|---|---|---|
fill | string | No | Fill color |
stroke | string | No | Stroke color |
strokeWidth | number | No | Stroke width |
Inherits additional props from IBaseComponent.
Overview
Circle is a circular shape. Circle is used to create circular visual elements, such as avatars, badges, and indicators.
SwiftUI Correspondence: Similar to SwiftUI's Circle.
With Stroke
Add a stroke to the circle:
Notes
- Circle requires
fillprop for fill color - Circle requires explicit dimensions via
styleprop (width and height should be equal) - Circle supports optional
strokeandstrokeWidthprops - Circle is always perfectly round
- Use Circle for avatars, badges, and circular indicators
Best Practices
- Dimensions: Use equal width and height for perfect circles
- Fill color: Always provide a fill color
- Stroke: Use stroke for borders and outlines
- Consistency: Maintain consistent circle sizes
- Accessibility: Ensure circles have sufficient contrast