Skip to content

Interface: ShapeProps ​

Extends ​

Extended by ​

Properties ​

adjustHandles? ​

optional adjustHandles?: ShapeAdjustHandle[]

Adjust handles (<a:ahLst>) for a custGeom shape — draggable handles (XY or polar), optionally bound to guides via gdRef*.


align? ​

optional align?: HAlign

Horizontal alignment

Default ​

ts
'left'

altText? ​

optional altText?: string

Alt Text value ("How would you describe this object and its contents to someone who is blind?")

  • serialized to the generated object's p:cNvPr descr attribute
  • PowerPoint: [right-click on the object] > "Edit Alt Text..."

Example ​

ts
'Quarterly revenue bar chart'

Inherited from ​

ObjectNameProps.altText


angleRange? ​

optional angleRange?: [number, number]

Radius (only for ShapeType.pie, ShapeType.arc, ShapeType.blockArc)

  • In the case of ShapeType.blockArc you have to setup the arcThicknessRatio
  • values: [0-359, 0-359]

Default ​

ts
[270, 0]

arcThicknessRatio? ​

optional arcThicknessRatio?: number

Radius (only for ShapeType.blockArc)

  • You have to setup the angleRange values too
  • values: 0.0-1.0

Default ​

ts
0.5

connectionSites? ​

optional connectionSites?: ShapeConnectionSite[]

Connection sites (<a:cxnLst>) for a custGeom shape — the points a connector can attach to. Positions are absolute in the object's own space (like points); a startShapeIdx/endShapeIdx on an addConnector indexes into this list.

Example ​

ts
[{ ang: 0, x: 1, y: 0 }, { ang: 180, x: 0, y: 1 }]

fill? ​

optional fill?: FillOption

Shape fill color properties, or a bare Color as shorthand for a solid fill (FillOption).

Examples ​

ts
'FF0000' // hex color (red), shorthand for { color:'FF0000' }
ts
{ color:'FF0000' } // hex color (red)
ts
{ color:'0088CC', transparency:50 } // hex color, 50% transparent
ts
{ color:SchemeColor.accent1 } // Theme color Accent1

flipH? ​

optional flipH?: boolean

Flip shape horizontally?

Default ​

ts
false

flipV? ​

optional flipV?: boolean

Flip shape vertical?

Default ​

ts
false

guides? ​

optional guides?: ShapeGuide[]

Geometry guides (<a:gdLst>) for a custGeom shape — named construction formulas that connection sites / adjust handles can reference. Advanced: each formula is emitted verbatim.

Example ​

ts
[{ name: 'w2', formula: 'val 10800' }]

h? ​

optional h?: Coord

Height

  • inches or percentage

Examples ​

ts
10.25 // height in inches
ts
'75%' // height as percentage of slide size

Inherited from ​

PositionProps.h


optional hyperlink?: HyperlinkProps

Add hyperlink to shape

Example ​

ts
hyperlink: { url: "https://example.com", tooltip: "Visit Homepage" },

line? ​

optional line?: ShapeLineProps

Line options


objectLock? ​

optional objectLock?: ObjectLockProps

Object lock flags (DrawingML a:spLocks / a:picLocks / a:graphicFrameLocks)

  • restrict how the object can be manipulated in PowerPoint (e.g. prevent moving, resizing, or grouping)
  • each flag maps 1:1 to the OOXML attribute of the same name; only flags set to true are emitted
  • PowerPoint UI: Selection Pane / right-click protections (most locks are honored at edit time, not as a password)
  • flags only apply to the object types that support them (see each flag); flags set on an unsupported object type are ignored with a console warning

Examples ​

ts
{ noMove: true, noResize: true } // pin an object in place
ts
{ noGrp: true } // exclude from grouping

Inherited from ​

ObjectNameProps.objectLock


objectName? ​

optional objectName?: string

Object name

  • used instead of the default name for the object's kind: Text 1, Shape 2, Image 1 and so on, numbered per kind (see docs/reference/object-names.md)
  • PowerPoint: Home > Arrange > Selection Pane...

Example ​

ts
'Antenna Design 9'

Inherited from ​

ObjectNameProps.objectName


points? ​

optional points?: GeometryPoint[]

Points (only for ShapeType.custGeom)

  • type: 'arc' (no end point — it is computed from the pen position, radii and sweep)
  • hR Shape Arc Height Radius
  • wR Shape Arc Width Radius
  • stAng Shape Arc Start Angle (degrees, not wrapped into 0..360)
  • swAng Shape Arc Swing Angle (degrees, not wrapped into 0..360)

See ​

http://www.datypic.com/sc/ooxml/e-a_arcTo-1.html

Example ​

ts
[{ x: 0, y: 0 }, { x: 10, y: 10 }] // draw a line between those two points

rectRadius? ​

optional rectRadius?: number

Corner radius (inches), for 'roundRect' and the other rounded presets

  • resolved against the shorter side of the shape and written as the preset's corner guide
  • not clamped: a radius past half the shorter side is written as given, and PowerPoint draws the corner at its limit
  • omitted, the preset keeps its own radius

rotate? ​

optional rotate?: number

Rotation (degrees)

  • range: -360 to 360

Default ​

ts
0

Example ​

ts
180 // rotate 180 degrees

shadow? ​

optional shadow?: ShadowProps

Shadow options


shapeAdjust? ​

optional shapeAdjust?: ShapeAdjustValue | ShapeAdjustValue[]

Preset-geometry adjustment handles (<a:avLst> guides) for any preset shape.

  • Use this to tune adjustment handles that lack a dedicated shortcut option, e.g. chevron/arrow point depth, callout pointer, bevel/frame thickness.
  • Accepts a single guide or an array; each value is a 0.0–1.0 fraction of the handle's range (see ShapeAdjustValue).
  • rectRadius / angleRange remain friendly shortcuts; any shapeAdjust guide that does not collide with a shortcut name is emitted in addition.

Examples ​

ts
{ name: 'adj', value: 0.25 } // set the single adjust handle to 25%
ts
[{ name: 'adj1', value: 0.5 }, { name: 'adj2', value: 0.25 }] // two handles

w? ​

optional w?: Coord

Width

  • inches or percentage

Examples ​

ts
10.25 // width in inches
ts
'75%' // width as percentage of slide size

Inherited from ​

PositionProps.w


x? ​

optional x?: Coord

Horizontal position

  • inches or percentage

Examples ​

ts
10.25 // position in inches
ts
'75%' // position as percentage of slide size

Inherited from ​

PositionProps.x


y? ​

optional y?: Coord

Vertical position

  • inches or percentage

Examples ​

ts
10.25 // position in inches
ts
'75%' // position as percentage of slide size

Inherited from ​

PositionProps.y