TextRun class
A block of text inside a RichTextBlock element.
Constructors
| Text |
Properties
| color | The color of the text. |
| fallback | An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property. |
| font |
The type of font to use for rendering. |
| grid. |
The area of a Layout.AreaGrid layout in which an element should be displayed. |
| highlight | Controls if the text should be highlighted. |
| id | A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot. |
| is |
Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements. |
| is |
Controls whether the text should be renderer using a subtler variant of the select color. |
| is |
Controls the visibility of the element. |
| italic | Controls if the text should be italicized. |
| lang | The locale associated with the element. |
| select |
An Action that will be invoked when the text is tapped or clicked. Action.ShowCard is not supported. |
| size | The size of the text. |
| strikethrough | Controls if the text should be struck through. |
| text | The text to display. A subset of markdown is supported. |
| type | Must be TextRun. |
| underline | Controls if the text should be underlined. |
| weight | The weight of the text. |
Methods
Constructor Details
TextRun(string, TextRunOptions)
Property Details
color
fallback
An alternate element to render if the type of this one is unsupported or if the host application doesn't support all the capabilities specified in the requires property.
fallback?: FallbackElement
Property Value
fontType
grid.area
The area of a Layout.AreaGrid layout in which an element should be displayed.
grid.area?: string
Property Value
string
highlight
Controls if the text should be highlighted.
highlight?: boolean
Property Value
boolean
id
A unique identifier for the element or action. Input elements must have an id, otherwise they will not be validated and their values will not be sent to the Bot.
id?: string
Property Value
string
isSortKey
Controls whether the element should be used as a sort key by elements that allow sorting across a collection of elements.
isSortKey?: boolean
Property Value
boolean
isSubtle
Controls whether the text should be renderer using a subtler variant of the select color.
isSubtle?: boolean
Property Value
boolean
isVisible
Controls the visibility of the element.
isVisible?: boolean
Property Value
boolean
italic
Controls if the text should be italicized.
italic?: boolean
Property Value
boolean
lang
The locale associated with the element.
lang?: string
Property Value
string
selectAction
An Action that will be invoked when the text is tapped or clicked. Action.ShowCard is not supported.
selectAction?: IExecuteAction | IOpenUrlAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction
Property Value
size
strikethrough
Controls if the text should be struck through.
strikethrough?: boolean
Property Value
boolean
text
The text to display. A subset of markdown is supported.
text: string
Property Value
string
type
Must be TextRun.
type: "TextRun" = "TextRun"
Property Value
"TextRun"
underline
Controls if the text should be underlined.
underline?: boolean
Property Value
boolean
weight
Method Details
from(Omit<ITextRun, "type">)
withColor(TextColor)
withFallback(FallbackElement)
function withFallback(fallback: FallbackElement): TextRun
Parameters
- fallback
- FallbackElement
Returns
withFontType(FontType)
withHighlight(boolean)
withId(string)
withIsSortKey(boolean)
withIsSubtle(boolean)
withIsVisible(boolean)
withItalic(boolean)
withLang(string)
withSelectAction(IExecuteAction | IOpenUrlAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction)
function withSelectAction(selectAction: IExecuteAction | IOpenUrlAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction): TextRun
Parameters
- selectAction
-
IExecuteAction | IOpenUrlAction | IResetInputsAction | ISubmitAction | IToggleVisibilityAction
Returns
withSize(TextSize)
withStrikethrough(boolean)
function withStrikethrough(strikethrough?: boolean): TextRun
Parameters
- strikethrough
-
boolean