vyaz-monorepo / core/src / ParagraphStyle
Interface: ParagraphStyle
Defined in: core/src/types/Document.ts:492
Block-level style for a paragraph.
Controls alignment, spacing, indentation, and line-breaking rules for all runs inside the paragraph.
See
Properties
alignment
alignment:
TextAlignment
Defined in: core/src/types/Document.ts:494
Horizontal text alignment.
hyphenBreak?
optionalhyphenBreak?:boolean
Defined in: core/src/types/Document.ts:561
Whether a line may break after a hyphen (- U+002D, ‐ U+2010) inside a word or number — well-│known, 2024-│10-06. Default true, which is what browsers and PowerPoint do. false keeps hyphenated words and codes (TEST-1234, dates, phone numbers) on one line, like U+2011. Unrelated to ParagraphStyle.hyphens (automatic hyphenation).
hyphens?
optionalhyphens?:boolean
Defined in: core/src/types/Document.ts:553
Experimental
Whether hyphenation is allowed. Accepted in the type but ignored by the layout engine (no-op until implemented).
indent?
optionalindent?:number
Defined in: core/src/types/Document.ts:512
Left indent (first-line indent / "red line") in px. Applies only to the first line of the paragraph.
Todo
Rename or alias as textIndent for consistency with CSS.
leftIndent?
optionalleftIndent?:number
Defined in: core/src/types/Document.ts:514
Left margin for the whole paragraph in px.
leftRule?
optionalleftRule?:object
Defined in: core/src/types/Document.ts:597
A vertical rule drawn along the paragraph's left edge, e.g. <blockquote>'s indent bar. Painted per-line (one short vertical segment per laid-out Line, at that line's left edge) rather than as one shape spanning the whole paragraph — consecutive lines sit flush against each other, so the segments read as a single continuous bar without the layout engine having to track a paragraph's overall bounding box.
color
color:
string
width
width:
number
See
Paragraph.rule for a full-width horizontal rule (<hr>) — a different construct: that one replaces a paragraph's content, this one decorates a paragraph that still has normal text content.
letterSpacing?
optionalletterSpacing?:number
Defined in: core/src/types/Document.ts:525
Letter-spacing (tracking) for the whole paragraph in px.
lineBreak?
optionallineBreak?:LineBreak
Defined in: core/src/types/Document.ts:543
Experimental
Line-break strictness (CJK). Accepted in the type but ignored by the layout engine (no-op until implemented).
lineHeight
lineHeight:
number
Defined in: core/src/types/Document.ts:501
Line height as a multiplier relative to the font size. E.g. 1.4 means 1.4× the computed font height.
Todo
Support for absolute px values via a lineHeightUnit field.
listRestart?
optionallistRestart?:boolean
Defined in: core/src/types/Document.ts:583
Whether to restart numbering for this paragraph. Only has effect when listStyle.type === 'number'. When true, the auto-numbering counter resets to listStyle.startNumber || 1 for this paragraph and subsequent ones in the same sequence.
listStyle?
optionallistStyle?:ListStyle
Defined in: core/src/types/Document.ts:575
List marker configuration (bullet or numbered). When set, the paragraph is treated as a list item.
overflowWrap?
optionaloverflowWrap?:OverflowWrap
Defined in: core/src/types/Document.ts:548
Overflow-wrap / word-wrap behaviour. See OverflowWrap. Defaults to 'normal' when unset.
rightIndent?
optionalrightIndent?:number
Defined in: core/src/types/Document.ts:516
Right margin for the whole paragraph in px.
spaceAfter
spaceAfter:
number
Defined in: core/src/types/Document.ts:505
Space after this paragraph (bottom margin) in px.
spaceBefore
spaceBefore:
number
Defined in: core/src/types/Document.ts:503
Space before this paragraph (top margin) in px.
textAlignLast?
optionaltextAlignLast?:TextAlignLast
Defined in: core/src/types/Document.ts:530
Experimental
Alignment of the last line of a justified paragraph. Accepted in the type but ignored by the layout engine (no-op until implemented).
textIndent?
optionaltextIndent?:number
Defined in: core/src/types/Document.ts:523
Experimental
Indentation of the first line in px. If set, overrides the generic indent for the first line.
Accepted in the type but ignored by the layout engine (no-op until implemented).
whiteSpace?
optionalwhiteSpace?:WhiteSpace
Defined in: core/src/types/Document.ts:569
CSS white-space behaviour:
'normal': collapse whitespace, auto-wrap.'nowrap': collapse whitespace, no wrap.'pre': preserve whitespace, wrap on newline only.'pre-line': collapse whitespace, wrap on newline and auto-wrap.
wordBreak?
optionalwordBreak?:WordBreak
Defined in: core/src/types/Document.ts:538
Experimental
Word-break rules (CJK / non-CJK). 'keep-all' keeps Chinese, Japanese and Korean words whole, breaking only where non-CJK text would (spaces, punctuation), like CSS word-break: keep-all. Only 'normal' (default) and 'keep-all' are laid out; 'break-all' / 'break-word' are accepted and laid out as 'normal'.
