TextBlockComponent Class @beta

Abstract representation of any of the building blocks that make up a TextBlock document - namely Runs, Paragraphs, and TextBlock itself. The TextBlock can specify an AnnotationTextStyle that formats its contents. Each component can specify an optional styleOverrides to customize that formatting.

Extended by

Methods

Name Description
clearStyleOverrides(_options?: ClearTextStyleOptions): void Reset any styleOverrides applied to this component.  
clone(): TextBlockComponent Abstract Create a deep copy of this component.  
equals(other: TextBlockComponent): boolean Returns true if this is equivalent to other.  
stringify(options?: TextBlockStringifyOptions): string Abstract Compute a string representation of the contents of this component and all of its sub-components.  
toJSON(): TextBlockComponentProps Convert this component to its JSON representation.  

Properties

Name Type Description
isWhitespace Accessor ReadOnly boolean Returns true if the string representation of this component consists only of whitespace characters.  
overridesStyle Accessor ReadOnly boolean Returns true if styleOverrides specifies any deviations from the TextBlock's AnnotationTextStyle.  
styleOverrides Accessor TextStyleSettingsProps Deviations in individual properties of the TextStyleSettings in the AnnotationTextStyle specified by styleId on the TextBlock.  
styleOverrides Setter styleOverrides(overrides: TextStyleSettingsProps): void    

Defined in

Last Updated: 29 July, 2025