Function: rule()
rule(
options?:object):ElementDecorator
Decorates an element with an accent rule / divider line or curved bracket.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | { borderStyle?: "solid" | "dashed" | "dotted"; bracket?: number | boolean; className?: string; color?: string | string[]; inset?: number; radius?: string | number; side?: "top" | "left" | "right" | "bottom"; thickness?: string | number; } | - |
options.borderStyle? | "solid" | "dashed" | "dotted" | Stroke style following standard CSS border-style (default: "solid"). |
options.bracket? | number | boolean | Curves the rule around adjacent corners, creating a stylized bracket / corner-hugging accent. Pass true or an explicit bracket extension length in pixels (default: 10px). |
options.className? | string | Additional CSS class name. |
options.color? | string | string[] | Stroke color (single CSS color) or gradient color stops (array of colors). |
options.inset? | number | Inset from both endpoints in stage units (default: 0). |
options.radius? | string | number | Corner radius for bracket corners or straight line caps in pixels (default: 8 when bracketed, 2 for straight). |
options.side? | "top" | "left" | "right" | "bottom" | Which side the rule sits on or faces ("left" |
options.thickness? | string | number | Rule stroke thickness in canvas pixels or a CSS length (default: 2). |