Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Components
  2. Shape
  3. API and Development

Shape

API and Development

View SourceOpens in a new tabSubmit IssueOpens in a new tab
Import Shape, ShapeStrokeAlignment, ShapeStrokeWidth, toSvgPathData, and type SvgViewBox from @prepared911/ui/shape. Brand path data with toSvgPathData; use type SvgPathData for branded path values. There is no className, style, or as. Consumers may pass data-* attributes the same way as on Image.
Props
NameTypeDefaultDescription
labelLocalizedMessage—Accessible name; renders role="img" and aria-label.
pathSvgPathData—Branded path data for the d attribute.
viewBoxSvgViewBox—User-space view box; rendered as "minX minY width height".
decorativeboolean—When omitted or false, the shape is meaningful and must supply label. Marks the graphic as decorative. Renders aria-hidden="true" and focusable="false".
fillVectorPaint—Fill paint. Defaults to none when omitted.
idstring—Element id forwarded to the svg.
refRef<SVGSVGElement>—Ref to the root svg.
sizeShapeSize—Space-scale box for the root svg.
strokeVectorPaint—Stroke paint. Defaults to none when omitted.
strokeAlignmentShapeStrokeAlignmentShapeStrokeAlignment.CenterStroke alignment relative to the path. Inside and Outside are meaningful only for closed paths.
strokeWidthShapeStrokeWidthShapeStrokeWidth.HairlineStroke width in viewBox user units.
ShapeStrokeWidth
MemberValue (user units)
Hairline1
Thin2
Regular3
Thick4
ShapeStrokeAlignment
MemberSerialized value
Centercenter
Insideinside
Outsideoutside
ShapeSize
PropTypeDescription
blockSpaceOptionBlock size from the space scale; omitted keeps intrinsic block size.
inlineSpaceOptionInline size from the space scale; omitted keeps intrinsic inline size.
VectorPaint (fill, stroke)
Foreground token (except Inherit) | ChartColor | DataColor. Defaults to none when omitted.
Figma
The Shape component set in the Axon 911 Design System file maps to this component through packages/ui/src/components/shape/shape.figma.ts. The set draws a sample closed path as two layers, Fill and Stroke, and exposes Show fill, Show stroke, Stroke width, Stroke alignment and Size as component properties. Stroke alignment uses Figma's native inside, center and outside stroke placement, and size steps use the space variables. Fill and stroke paint come from each layer's Text Foreground variable mode; ChartColor and DataColor paint, path, viewBox and the accessible name are code-only. See Figma Code Connect.
Storybook
The registry links the root `Default` story. Open the `Shape/Props` and `Shape/Composition` groups in Storybook for stroke width, alignment, paint, label vs decorative, and map marker fixtures.
DefaultOpens in a new tab
Previous
Shape / Usage
Next
Shape / Accessibility
On this page
Props
ShapeStrokeWidth
ShapeStrokeAlignment
ShapeSize
VectorPaint (fill, stroke)
Figma
Storybook