RoundedRect
Rounded rectangle with adjustable width, height, and corner rounding
Rounded rectangle with adjustable width, height, and corner rounding
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| color | color | #ffffff | Fill color of the rectangle |
| center | position | {"x":0.5,"y":0.5} | Center position of the rectangle |
| width | range | 0.35 | Half-width of the rectangle |
| height | range | 0.25 | Half-height of the rectangle |
| rounding | range | 0.05 | Corner rounding radius - set to min(width, height) for a pill shape |
| rotation | range | 0 | Rotation in degrees |
| softness | range | 0 | Edge softness for antialiasing |
| strokeThickness | range | 0 | Stroke thickness. Zero means no stroke. |
| strokeColor | color | #000000 | Color of the stroke outline |
| strokePosition | "outside" | "center" | "inside" | center | Position of the stroke relative to the shape edge |
| colorSpace | "linear" | "oklch" | "oklab" | "hsl" | "hsv" | "lch" | linear | Color space for blending fill and stroke colors |
Usage
vue
<Shader>
<RoundedRect
color="#ffffff"
/>
</Shader>