123456789101112131415161718192021222324252627282930313233343536373839 |
- """Interactive components provided by @radix-ui/themes."""
- from typing import Literal
- from reflex import el
- from reflex.vars import Var
- from ..base import (
- CommonMarginProps,
- LiteralAccentColor,
- LiteralRadius,
- LiteralVariant,
- RadixThemesComponent,
- )
- LiteralButtonSize = Literal[1, 2, 3, 4]
- class Button(el.Button, CommonMarginProps, RadixThemesComponent):
- """Trigger an action or event, such as submitting a form or displaying a dialog."""
- tag = "Button"
- # Change the default rendered element for the one passed as a child, merging their props and behavior.
- as_child: Var[bool]
- # Button size "1" - "4"
- size: Var[LiteralButtonSize]
- # Variant of button: "solid" | "soft" | "outline" | "ghost"
- variant: Var[LiteralVariant]
- # Override theme color for button
- color: Var[LiteralAccentColor]
- # Whether to render the button with higher contrast color against background
- high_contrast: Var[bool]
- # Override theme radius for button: "none" | "small" | "medium" | "large" | "full"
- radius: Var[LiteralRadius]
|