Skip to main content

text

Text

from dara.components.common.text import Text

class Text(ContentComponent)

A Text component is the basic component for adding text to an app.

A Text component is created via:


from dara.components.common import Text

Text('A bold string', bold=True)
Text('A string with larger font size', font_size='1.2rem')

Additionally, a Text component can have its value set with a Variable via:


from dara.core import Variable
from dara.components.common import Text

Text(Variable('A Variable string'))

Arguments:

  • text: The text to display
  • formatted: Whether to display the text with existing formatting intact or not, default False

Attributes

  • text: Union[str, NonDataVariable]
  • align: str
  • formatted: bool