text.py 482 B

1234567891011121314151617
  1. """A text component."""
  2. from __future__ import annotations
  3. from reflex.components.libs.chakra import ChakraComponent
  4. from reflex.vars import Var
  5. class Text(ChakraComponent):
  6. """Render a paragraph of text."""
  7. tag: str = "Text"
  8. # Override the tag. The default tag is `<p>`.
  9. as_: Var[str]
  10. # Truncate text after a specific number of lines. It will render an ellipsis when the text exceeds the width of the viewport or max_width prop.
  11. no_of_lines: Var[int]