Usage

Draw a rectangle.

This type is used by Rectangle

tsx
// Draw a rectangle.
import { Drawing, Rectangle } from 'kuito';

<Drawing label="Card" viewBox={[0, 0, 40, 24]} width={80} height={48}>
  <Rectangle x={1} y={1} width={38} height={22} rx={4} fill="#5b5bd6" stroke="#3e3e9f" />
</Drawing>;

Type declaration

ts
export interface RectangleProps extends ShapePaint {
  x?: number;
  y?: number;
  width: number;
  height: number;
  /** Corner radii; each defaults to the other, as SVG's do. */
  rx?: number;
  ry?: number;
}

Members 20

NameTypeRequiredDescription
xnumberNo—
ynumberNo—
widthnumberYes—
heightnumberYes—
rxnumberNoCorner radii; each defaults to the other, as SVG's do.
rynumberNo—
fillstringNoA hex color, or none; black by default.
fillRuleFillRuleNo—
strokestringNoA hex color, or none, the default.
strokeWidthnumberNoIn user units; 1 by default.
strokeLinecapStrokeLinecapNo—
strokeLinejoinStrokeLinejoinNo—
strokeMiterlimitnumberNo—
strokeDasharrayreadonly number[]NoDash and gap lengths in user units, repeated.
strokeDashoffsetnumberNo—
opacitynumberNoMultiplies with its Groups' opacity.
translateXnumberNoIn user units, then rotate in degrees and scale, about the origin.
translateYnumberNo—
scalenumberNo—
rotatenumberNo—
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.