Interface: ShapeLineProps
Line (stroke) options.
A stroke is painted much like a fill: in addition to a solid color, it accepts the inherited gradient and pattern fill options. Setting gradient (or type: 'gradient') paints a gradient stroke, e.g. line: { width: 1, gradient: { kind: 'linear', angle: 0, stops: [{ position: 0, color: 'accent3' }, { position: 100, color: 'accent4' }] } }.
A picture stroke is not one of them, which is why image and type: 'image' are subtracted from the inherited fill props rather than carried. <a:ln>'s paint child is EG_LineFillProperties (a:noFill, a:solidFill, a:gradFill, a:pattFill and nothing else), so unlike a shape interior a stroke has no a:blipFill slot to put a bitmap in, and a package that emitted one is what PowerPoint answers with a repair prompt. The interface carried image from ShapeFillProps regardless, and no call site ever registered the media for it, so a picture stroke reached the emitter with no rel and painted nothing. It is now spelled out as unsupported: a JS caller who sets it anyway gets line/image-fill-unsupported.
A stroke also does not take the bare-colour shorthand a fill does (see FillOption for why). Spell it line: { color: 'FF0000' }.
Extends
Omit<ShapeFillProps,"type"|"image">
Properties
beginArrowType?
optionalbeginArrowType?:"none"|"triangle"|"diamond"|"stealth"|"oval"|"arrow"
Begin arrow type: the ST_LineEndType set (a:headEnd/@type).
cap?
optionalcap?:LineCap
Line end cap style
Default
ts
'flat'color?
optionalcolor?:string
Fill color
HexColororThemeColor
Examples
ts
'FF0000' // hex color (red)ts
SchemeColor.text1 // Theme color (Text1)Inherited from
dashType?
optionaldashType?:"dash"|"solid"|"dot"|"lgDash"|"dashDot"|"lgDashDot"|"lgDashDotDot"|"sysDash"|"sysDot"|"sysDashDot"|"sysDashDotDot"
Dash type: the full ST_PresetLineDashVal set, so any dash a source deck can carry can also be authored and replicated.
Default
'solid', or inherited when type is 'inherit'
endArrowType?
optionalendArrowType?:"none"|"triangle"|"diamond"|"stealth"|"oval"|"arrow"
End arrow type: the ST_LineEndType set (a:tailEnd/@type).
gradient?
optionalgradient?:GradientFillProps
Native PPTX gradient fill options. Setting this (or type: 'gradient') paints the shape interior with a gradient instead of a color.
Inherited from
pattern?
optionalpattern?:PatternFillProps
Native PPTX pattern fill options. Setting this (or type: 'pattern') paints the shape interior with a two-color preset pattern instead of a color.
Inherited from
transparency?
optionaltransparency?:number
Transparency (percent)
- MS-PPT > Format Shape > Fill & Line > Fill > Transparency
- range: 0-100
Default
ts
0Inherited from
type?
optionaltype?:"none"|"inherit"|"pattern"|"solid"|"gradient"
Stroke paint kind. The same vocabulary as ShapeFillProps.type minus 'image', which <a:ln> cannot express (see the note on this interface).
'inherit' leaves the whole outline to p:style/a:lnRef or the placeholder: no paint, and no 1pt or solid defaults for width and dashType. A width, dash, cap or arrowhead you state is still written over what is inherited.
Example
ts
{ type: 'inherit' } // an empty <a:ln>: paint, width and dash all inheritedDefault
ts
'solid'width?
optionalwidth?:number
Line width (pt)
Default
1, or inherited when type is 'inherit'