Skip to main content

Function: Shape()

Call Signature​

Shape(path: PathFunction, options?: object): ShapeElement

Universal shape container supporting multiple geometries and surface treatments.

Parameters​

ParameterTypeDescription
pathPathFunction-
options?{ align?: Align; background?: string; blur?: number; borderColor?: string; brightness?: number; children?: ElementChild; className?: string; color?: string; customPositioned?: boolean; doubleBorder?: boolean; end?: number; enterDelay?: number; enterDuration?: number; exitDelay?: number; exitDuration?: number; flow?: FlowEffect; height?: Size; highlighted?: boolean; id?: string; onActivate?: () => void; onDeactivate?: () => void; onMount?: () => void; onUnmount?: () => void; opacity?: number; origin?: ElementAnchor; position?: Position; rotation?: number; scale?: number; size?: Size; start?: number; strokeWidth?: number; style?: Properties<0 | string & object, string & object>; text?: string; theme?: Partial<ThemeConfig>; variant?: ShapeVariant; width?: Size; x?: PositionCoord; y?: PositionCoord; }-
options.align?Align-
options.background?stringBackground fill color.
options.blur?numberBlur in virtual pixels (default: 0).
options.borderColor?stringBorder stroke color.
options.brightness?numberBrightness multiplier (default: 1).
options.children?ElementChildOptional child elements or text nodes.
options.className?string-
options.color?stringForeground CSS color (default: component/theme color).
options.customPositioned?booleanWhether this element manages its own CSS transform / positioning (disables stage translate3d).
options.doubleBorder?booleanDouble border outline (e.g. for final states, nested rings).
options.end?numberTrim-path end offset from 0.0 to 1.0 (default: 1).
options.enterDelay?numberDelay in seconds before entering scene transition begins.
options.enterDuration?numberDuration in seconds for entering scene transition.
options.exitDelay?numberDelay in seconds before exiting scene transition begins.
options.exitDuration?numberDuration in seconds for exiting scene transition.
options.flow?FlowEffectContinuous ambient stroke animation ("none"
options.height?SizeHeight in stage units or CSS length (default: content size).
options.highlighted?booleanGlowing outline highlight (default: false).
options.id?string-
options.onActivate?() => void-
options.onDeactivate?() => void-
options.onMount?() => void-
options.onUnmount?() => void-
options.opacity?numberWhole-element opacity from 0 to 1 (default: 1).
options.origin?ElementAnchorWhich point of the element sits on its coordinate (default: "top-left").
options.position?Position-
options.rotation?numberRotation in degrees (default: 0).
options.scale?numberScale multiplier (default: 1).
options.size?SizeBoth dimensions in stage units or CSS length (default: unset).
options.start?numberTrim-path start offset from 0.0 to 1.0 (default: 0).
options.strokeWidth?numberStroke outline width in virtual canvas pixels (default: 2).
options.style?Properties<0 | string & object, string & object>-
options.text?stringOptional text content inside the shape container.
options.theme?Partial<ThemeConfig>-
options.variant?ShapeVariantSurface material preset: "surface" (background fill, default), "ghost" (outline), or "solid" (opaque fill).
options.width?SizeWidth in stage units or CSS length (default: content size).
options.x?PositionCoordHorizontal position in stage units (default: 0).
options.y?PositionCoordVertical position in stage units (default: 0).

Returns​

ShapeElement

Call Signature​

Shape(path: PathFunction, children: ElementChild, options?: object): ShapeElement

Universal shape container supporting multiple geometries and surface treatments.

Parameters​

ParameterTypeDescription
pathPathFunction-
childrenElementChild-
options?{ align?: Align; background?: string; blur?: number; borderColor?: string; brightness?: number; children?: ElementChild; className?: string; color?: string; customPositioned?: boolean; doubleBorder?: boolean; end?: number; enterDelay?: number; enterDuration?: number; exitDelay?: number; exitDuration?: number; flow?: FlowEffect; height?: Size; highlighted?: boolean; id?: string; onActivate?: () => void; onDeactivate?: () => void; onMount?: () => void; onUnmount?: () => void; opacity?: number; origin?: ElementAnchor; position?: Position; rotation?: number; scale?: number; size?: Size; start?: number; strokeWidth?: number; style?: Properties<0 | string & object, string & object>; text?: string; theme?: Partial<ThemeConfig>; variant?: ShapeVariant; width?: Size; x?: PositionCoord; y?: PositionCoord; }-
options.align?Align-
options.background?stringBackground fill color.
options.blur?numberBlur in virtual pixels (default: 0).
options.borderColor?stringBorder stroke color.
options.brightness?numberBrightness multiplier (default: 1).
options.children?ElementChildOptional child elements or text nodes.
options.className?string-
options.color?stringForeground CSS color (default: component/theme color).
options.customPositioned?booleanWhether this element manages its own CSS transform / positioning (disables stage translate3d).
options.doubleBorder?booleanDouble border outline (e.g. for final states, nested rings).
options.end?numberTrim-path end offset from 0.0 to 1.0 (default: 1).
options.enterDelay?numberDelay in seconds before entering scene transition begins.
options.enterDuration?numberDuration in seconds for entering scene transition.
options.exitDelay?numberDelay in seconds before exiting scene transition begins.
options.exitDuration?numberDuration in seconds for exiting scene transition.
options.flow?FlowEffectContinuous ambient stroke animation ("none"
options.height?SizeHeight in stage units or CSS length (default: content size).
options.highlighted?booleanGlowing outline highlight (default: false).
options.id?string-
options.onActivate?() => void-
options.onDeactivate?() => void-
options.onMount?() => void-
options.onUnmount?() => void-
options.opacity?numberWhole-element opacity from 0 to 1 (default: 1).
options.origin?ElementAnchorWhich point of the element sits on its coordinate (default: "top-left").
options.position?Position-
options.rotation?numberRotation in degrees (default: 0).
options.scale?numberScale multiplier (default: 1).
options.size?SizeBoth dimensions in stage units or CSS length (default: unset).
options.start?numberTrim-path start offset from 0.0 to 1.0 (default: 0).
options.strokeWidth?numberStroke outline width in virtual canvas pixels (default: 2).
options.style?Properties<0 | string & object, string & object>-
options.text?stringOptional text content inside the shape container.
options.theme?Partial<ThemeConfig>-
options.variant?ShapeVariantSurface material preset: "surface" (background fill, default), "ghost" (outline), or "solid" (opaque fill).
options.width?SizeWidth in stage units or CSS length (default: content size).
options.x?PositionCoordHorizontal position in stage units (default: 0).
options.y?PositionCoordVertical position in stage units (default: 0).

Returns​

ShapeElement