The Canva Apps SDK, Connect APIs, and MCP are now unified in the Canva Developers SDK. Learn more⁠(opens in a new tab or window).
Canva Developers SDK
The Canva Apps SDK, Connect APIs, and MCP are now unified in the Canva Developers SDK. Learn more⁠(opens in a new tab or window).

Stroke

API reference for the Stroke type.

Represents an outline, such as the border of an element.

Properties

weightnumber
Required

The weight (thickness) of the stroke.

Minimum: 0

Maximum: 100

colorContainerobjectRead-only
Required

The color of the stroke.

refColorFill
Required

A solid color that fills an interior.

typestringRead-only
Required

The type of color.

The only valid value is "solid".

colorstring
Required

The color of the fill. This must be a valid, six-digit hex code, prefixed with a # symbol.

  • Must be six characters long.
  • Must start with a #.
  • Must use lowercase letters.

Example

"#ff0099"
TS

Represents design content that the SDK doesn't support.

typestringRead-only
Required

The only valid value is "unsupported".

setfunction
Required

Parameters

stateSolidFillState
Required

A state that creates a solid color fill.

typestringRead-only
Required

The type of color.

The only valid value is "solid".

colorstring
Required

The color of the fill. This must be a valid, six-digit hex code, prefixed with a # symbol.

  • Must be six characters long.
  • Must start with a #.
  • Must use lowercase letters.

Example

"#ff0099"
TS

Returns

void