text.py 535 B

12345678910111213141516171819
  1. """A text component."""
  2. from __future__ import annotations
  3. from typing import Optional
  4. from reflex.components.chakra import ChakraComponent
  5. from reflex.vars import Var
  6. class Text(ChakraComponent):
  7. """Render a paragraph of text."""
  8. tag = "Text"
  9. # Override the tag. The default tag is `<p>`.
  10. as_: Optional[Var[str]] = None
  11. # 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.
  12. no_of_lines: Optional[Var[int]] = None