radio.py 762 B

12345678910111213141516171819202122232425262728293031
  1. """Radio component from Radix Themes."""
  2. from typing import Literal
  3. from reflex.vars import Var
  4. from ..base import LiteralAccentColor, RadixThemesComponent
  5. class Radio(RadixThemesComponent):
  6. """A radio component."""
  7. tag = "Radio"
  8. # The size of the radio: "1" | "2" | "3"
  9. size: Var[Literal["1", "2", "3"]]
  10. # Variant of button: "classic" | "surface" | "soft"
  11. variant: Var[Literal["classic", "surface", "soft"]]
  12. # Override theme color for button
  13. color_scheme: Var[LiteralAccentColor]
  14. # Uses a higher contrast color for the component.
  15. high_contrast: Var[bool]
  16. # Change the default rendered element for the one passed as a child, merging their props and behavior.
  17. as_child = Var[bool]
  18. radio = Radio.create