text.py 473 B

123456789101112131415161718
  1. """A text component."""
  2. from __future__ import annotations
  3. from reflex.components.chakra import ChakraComponent
  4. from reflex.vars import Var
  5. class Text(ChakraComponent):
  6. """Render a paragraph of text."""
  7. tag = "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]