TextRun Class @beta
The most common type of Run, containing a sequence of characters to be displayed using a single style.
Extends
Methods
Name | Description | |
---|---|---|
clone(): TextRun | Create a deep copy of this component. | |
equals(other: TextBlockComponent): boolean | Returns true if this is equivalent to other . |
|
stringify(): string | Simply returns content. | |
toJSON(): TextRunProps | Convert this component to its JSON representation. | |
create(props?: Omit<TextRunProps, "type">): TextRun Static |
Inherited methods
Name | Inherited from | Description |
---|---|---|
clearStyleOverrides(_options?: ClearTextStyleOptions): void Inherited | TextBlockComponent | Reset any styleOverrides applied to this component. |
Properties
Name | Type | Description | |
---|---|---|---|
baselineShift | BaselineShift | Whether to display content as a subscript, superscript, or normally. | |
content | string | The sequence of characters to be displayed by the run. | |
isEmpty Accessor ReadOnly | boolean | Returns true if this component has no content or children. | |
type Readonly | "text" | Discriminator field for the Run union. |
Inherited properties
Name | Type | Inherited from | Description |
---|---|---|---|
isWhitespace Accessor Inherited ReadOnly | boolean | TextBlockComponent | Returns true if the string representation of this component consists only of whitespace characters. Useful for checking if the component is visually empty (producing no graphics) or contains only spaces, tabs, or line breaks. |
overridesStyle Accessor Inherited ReadOnly | boolean | TextBlockComponent | Returns true if styleOverrides specifies any deviations from the TextBlock's AnnotationTextStyle. |
styleOverrides Accessor Inherited | TextStyleSettingsProps | TextBlockComponent | Deviations in individual properties of the TextStyleSettings in the AnnotationTextStyle. For example, if the style uses the "Arial" font, you can override that by settings styleOverrides.font.name to "Comic Sans". |
Defined in
Last Updated: 07 October, 2025
Found something wrong, missing, or unclear on this page? Raise an issue in our repo.