Text

Text is a control for displaying text.

Properties#

NameTypeDefaultDescription
valuestringThe text displayed.
markdownboolfalseTreat value as markdown. GitHub Flavored Markdown is supported.
alignstringleftleft, center, right, justify
verticalAlignstringtop, center, bottom
sizestringtiny, xSmall, small, smallPlus, medium, mediumPlus, large, xLarge, xxLarge, superLarge, mega
boldboolfalseWhether font weight is bold.
italicboolfalseWhether font style is italic.
preboolfalsePreformatted text in monospace font.
nowrapboolfalseWhether the text is not wrapped.
blockboolfalseWhether the text is displayed as a block element.
colorstringFont color.
bgcolorstringText background color.
borderstringBorder around text in <width> <style> <color> format, e.g. 1px solid #550000
borderStylestringBorder style: dotted, dashed, solid, double, groove, ridge, inset, outset
borderWidthstringBorder width, e.g. 1.
borderColorstringBorder color.
borderRadiusstringBorder radius.
borderLeftstringBorder of the left side of text in <width> <style> <color> format, e.g. 1px solid #550000
borderRightstringBorder of the right side of text in <width> <style> <color> format, e.g. 1px solid #550000
borderTopstringBorder of the top side of text in <width> <style> <color> format, e.g. 1px solid #550000
borderBottomstringBorder of the bottom side of text in <width> <style> <color> format, e.g. 1px solid #550000

Examples#

Adding a new text control onto the page:

t1 = page.add(Text(value="Hello, world!"))

Updating just added text:

t1.value = "Running step A..."
page.update(t1)

or shorter:

page.set_value(t1, "Running step A...")