instruction
stringlengths
0
1k
input
stringlengths
1
1k
output
stringlengths
10
6.51k
"""Custom button component."""
from reflex.components.core.cond import cond from reflex.components.el import Button as BaseButton from reflex.vars.base import Var from reflex_ui.components.component import CoreComponent from reflex_ui.components.icons.others import spinner LiteralButtonVariant = Literal[ "primary", "destructive", "outline", "secondary", "ghost", "link", "dark" ] LiteralButtonSize = Literal[ "xs", "sm", "md", "lg", "xl", "icon-xs", "icon-sm", "icon-md", "icon-lg", "icon-xl" ] DEFAULT_CLASS_NAME = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:border disabled:border-secondary-4/80 disabled:bg-secondary-3 disabled:text-secondary-8 shrink-0 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 text-medium cursor-pointer box-border" BUTTON_VARIANTS = { "variant": { "primary": "bg-primary-9 text-white hover:bg-primary-10", "destructive": "bg-destructive-9 hover:bg-destructive-10 t
from typing import Literal
"""Custom button component.""" from typing import Literal
from reflex.components.el import Button as BaseButton from reflex.vars.base import Var from reflex_ui.components.component import CoreComponent from reflex_ui.components.icons.others import spinner LiteralButtonVariant = Literal[ "primary", "destructive", "outline", "secondary", "ghost", "link", "dark" ] LiteralButtonSize = Literal[ "xs", "sm", "md", "lg", "xl", "icon-xs", "icon-sm", "icon-md", "icon-lg", "icon-xl" ] DEFAULT_CLASS_NAME = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:border disabled:border-secondary-4/80 disabled:bg-secondary-3 disabled:text-secondary-8 shrink-0 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 text-medium cursor-pointer box-border" BUTTON_VARIANTS = { "variant": { "primary": "bg-primary-9 text-white hover:bg-primary-10", "destructive": "bg-destructive-9 hover:bg-destructive-10 text-white", "outline": "border border-
from reflex.components.core.cond import cond
"""Custom button component.""" from typing import Literal from reflex.components.core.cond import cond
from reflex.vars.base import Var from reflex_ui.components.component import CoreComponent from reflex_ui.components.icons.others import spinner LiteralButtonVariant = Literal[ "primary", "destructive", "outline", "secondary", "ghost", "link", "dark" ] LiteralButtonSize = Literal[ "xs", "sm", "md", "lg", "xl", "icon-xs", "icon-sm", "icon-md", "icon-lg", "icon-xl" ] DEFAULT_CLASS_NAME = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:border disabled:border-secondary-4/80 disabled:bg-secondary-3 disabled:text-secondary-8 shrink-0 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 text-medium cursor-pointer box-border" BUTTON_VARIANTS = { "variant": { "primary": "bg-primary-9 text-white hover:bg-primary-10", "destructive": "bg-destructive-9 hover:bg-destructive-10 text-white", "outline": "border border-secondary-a4 bg-secondary-1 hover:bg-secondary-3 text-
from reflex.components.el import Button as BaseButton
"""Custom button component.""" from typing import Literal from reflex.components.core.cond import cond from reflex.components.el import Button as BaseButton
from reflex_ui.components.component import CoreComponent from reflex_ui.components.icons.others import spinner LiteralButtonVariant = Literal[ "primary", "destructive", "outline", "secondary", "ghost", "link", "dark" ] LiteralButtonSize = Literal[ "xs", "sm", "md", "lg", "xl", "icon-xs", "icon-sm", "icon-md", "icon-lg", "icon-xl" ] DEFAULT_CLASS_NAME = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:border disabled:border-secondary-4/80 disabled:bg-secondary-3 disabled:text-secondary-8 shrink-0 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 text-medium cursor-pointer box-border" BUTTON_VARIANTS = { "variant": { "primary": "bg-primary-9 text-white hover:bg-primary-10", "destructive": "bg-destructive-9 hover:bg-destructive-10 text-white", "outline": "border border-secondary-a4 bg-secondary-1 hover:bg-secondary-3 text-secondary-12", "secondary
from reflex.vars.base import Var
"""Custom button component.""" from typing import Literal from reflex.components.core.cond import cond from reflex.components.el import Button as BaseButton from reflex.vars.base import Var
from reflex_ui.components.icons.others import spinner LiteralButtonVariant = Literal[ "primary", "destructive", "outline", "secondary", "ghost", "link", "dark" ] LiteralButtonSize = Literal[ "xs", "sm", "md", "lg", "xl", "icon-xs", "icon-sm", "icon-md", "icon-lg", "icon-xl" ] DEFAULT_CLASS_NAME = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:border disabled:border-secondary-4/80 disabled:bg-secondary-3 disabled:text-secondary-8 shrink-0 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 text-medium cursor-pointer box-border" BUTTON_VARIANTS = { "variant": { "primary": "bg-primary-9 text-white hover:bg-primary-10", "destructive": "bg-destructive-9 hover:bg-destructive-10 text-white", "outline": "border border-secondary-a4 bg-secondary-1 hover:bg-secondary-3 text-secondary-12", "secondary": "bg-secondary-4 text-secondary-12 hover:bg-secondary-5"
from reflex_ui.components.component import CoreComponent
"""Custom button component.""" from typing import Literal from reflex.components.core.cond import cond from reflex.components.el import Button as BaseButton from reflex.vars.base import Var from reflex_ui.components.component import CoreComponent
LiteralButtonVariant = Literal[ "primary", "destructive", "outline", "secondary", "ghost", "link", "dark" ] LiteralButtonSize = Literal[ "xs", "sm", "md", "lg", "xl", "icon-xs", "icon-sm", "icon-md", "icon-lg", "icon-xl" ] DEFAULT_CLASS_NAME = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:border disabled:border-secondary-4/80 disabled:bg-secondary-3 disabled:text-secondary-8 shrink-0 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 text-medium cursor-pointer box-border" BUTTON_VARIANTS = { "variant": { "primary": "bg-primary-9 text-white hover:bg-primary-10", "destructive": "bg-destructive-9 hover:bg-destructive-10 text-white", "outline": "border border-secondary-a4 bg-secondary-1 hover:bg-secondary-3 text-secondary-12", "secondary": "bg-secondary-4 text-secondary-12 hover:bg-secondary-5", "ghost": "hover:bg-secondary-3 text-secondar
from reflex_ui.components.icons.others import spinner
"""Custom button component.""" from typing import Literal from reflex.components.core.cond import cond from reflex.components.el import Button as BaseButton from reflex.vars.base import Var from reflex_ui.components.component import CoreComponent from reflex_ui.components.icons.others import spinner
LiteralButtonSize = Literal[ "xs", "sm", "md", "lg", "xl", "icon-xs", "icon-sm", "icon-md", "icon-lg", "icon-xl" ] DEFAULT_CLASS_NAME = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:border disabled:border-secondary-4/80 disabled:bg-secondary-3 disabled:text-secondary-8 shrink-0 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 text-medium cursor-pointer box-border" BUTTON_VARIANTS = { "variant": { "primary": "bg-primary-9 text-white hover:bg-primary-10", "destructive": "bg-destructive-9 hover:bg-destructive-10 text-white", "outline": "border border-secondary-a4 bg-secondary-1 hover:bg-secondary-3 text-secondary-12", "secondary": "bg-secondary-4 text-secondary-12 hover:bg-secondary-5", "ghost": "hover:bg-secondary-3 text-secondary-11", "link": "text-secondary-12 underline-offset-4 hover:underline", "dark": "bg-secondary-12 t
LiteralButtonVariant = Literal[ "primary", "destructive", "outline", "secondary", "ghost", "link", "dark" ]
"""Custom button component.""" from typing import Literal from reflex.components.core.cond import cond from reflex.components.el import Button as BaseButton from reflex.vars.base import Var from reflex_ui.components.component import CoreComponent from reflex_ui.components.icons.others import spinner LiteralButtonVariant = Literal[ "primary", "destructive", "outline", "secondary", "ghost", "link", "dark" ]
DEFAULT_CLASS_NAME = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:border disabled:border-secondary-4/80 disabled:bg-secondary-3 disabled:text-secondary-8 shrink-0 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 text-medium cursor-pointer box-border" BUTTON_VARIANTS = { "variant": { "primary": "bg-primary-9 text-white hover:bg-primary-10", "destructive": "bg-destructive-9 hover:bg-destructive-10 text-white", "outline": "border border-secondary-a4 bg-secondary-1 hover:bg-secondary-3 text-secondary-12", "secondary": "bg-secondary-4 text-secondary-12 hover:bg-secondary-5", "ghost": "hover:bg-secondary-3 text-secondary-11", "link": "text-secondary-12 underline-offset-4 hover:underline", "dark": "bg-secondary-12 text-secondary-1 hover:bg-secondary-12/80", }, "size": { "xs": "px-1.5 h-7 rounded-ui-xs gap-1.5",
LiteralButtonSize = Literal[ "xs", "sm", "md", "lg", "xl", "icon-xs", "icon-sm", "icon-md", "icon-lg", "icon-xl" ]
"""Custom button component.""" from typing import Literal from reflex.components.core.cond import cond from reflex.components.el import Button as BaseButton from reflex.vars.base import Var from reflex_ui.components.component import CoreComponent from reflex_ui.components.icons.others import spinner LiteralButtonVariant = Literal[ "primary", "destructive", "outline", "secondary", "ghost", "link", "dark" ] LiteralButtonSize = Literal[ "xs", "sm", "md", "lg", "xl", "icon-xs", "icon-sm", "icon-md", "icon-lg", "icon-xl" ]
BUTTON_VARIANTS = { "variant": { "primary": "bg-primary-9 text-white hover:bg-primary-10", "destructive": "bg-destructive-9 hover:bg-destructive-10 text-white", "outline": "border border-secondary-a4 bg-secondary-1 hover:bg-secondary-3 text-secondary-12", "secondary": "bg-secondary-4 text-secondary-12 hover:bg-secondary-5", "ghost": "hover:bg-secondary-3 text-secondary-11", "link": "text-secondary-12 underline-offset-4 hover:underline", "dark": "bg-secondary-12 text-secondary-1 hover:bg-secondary-12/80", }, "size": { "xs": "px-1.5 h-7 rounded-ui-xs gap-1.5", "sm": "px-2 h-8 rounded-ui-sm gap-2", "md": "px-2.5 h-9 rounded-ui-md gap-2", "lg": "px-3 h-10 rounded-ui-lg gap-2.5", "xl": "px-3.5 h-12 rounded-ui-xl gap-3", "icon-xs": "size-7 rounded-ui-xs", "icon-sm": "size-8 rounded-ui-sm", "icon-md": "size-9 rounded-ui-md", "icon-lg": "size-10 rounded-
DEFAULT_CLASS_NAME = "inline-flex items-center justify-center whitespace-nowrap text-sm font-medium transition-colors disabled:cursor-not-allowed disabled:border disabled:border-secondary-4/80 disabled:bg-secondary-3 disabled:text-secondary-8 shrink-0 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 text-medium cursor-pointer box-border"
underline", "dark": "bg-secondary-12 text-secondary-1 hover:bg-secondary-12/80", }, "size": { "xs": "px-1.5 h-7 rounded-ui-xs gap-1.5", "sm": "px-2 h-8 rounded-ui-sm gap-2", "md": "px-2.5 h-9 rounded-ui-md gap-2", "lg": "px-3 h-10 rounded-ui-lg gap-2.5", "xl": "px-3.5 h-12 rounded-ui-xl gap-3", "icon-xs": "size-7 rounded-ui-xs", "icon-sm": "size-8 rounded-ui-sm", "icon-md": "size-9 rounded-ui-md", "icon-lg": "size-10 rounded-ui-lg", "icon-xl": "size-12 rounded-ui-xl", }, } class Button(BaseButton, CoreComponent): """A custom button component.""" # Button variant. Defaults to "primary". variant: Var[LiteralButtonVariant] # Button size. Defaults to "md". size: Var[LiteralButtonSize] # The loading state of the button loading: Var[bool] @classmethod def create(cls, *children, **props) -> BaseButton: """Create the button component."""
cls.validate_variant(variant) size = props.pop("size", "md") cls.validate_size(size) loading = props.pop("loading", False) disabled = props.pop("disabled", False) button_classes = f"{DEFAULT_CLASS_NAME} {BUTTON_VARIANTS['variant'][variant]} {BUTTON_VARIANTS['size'][size]}" cls.set_class_name(button_classes, props) children_list = list(children) if isinstance(loading, Var): props["disabled"] = cond(loading, True, disabled) children_list.insert(0, cond(loading, spinner())) else: props["disabled"] = True if loading else disabled children_list.insert(0, spinner()) if loading else None return super().create(*children_list, **props) @staticmethod def validate_variant(variant: LiteralButtonVariant): """Validate the button variant.""" if variant not in BUTTON_VARIANTS["variant"]: available_variants = ", ".join(BUTTO
variant = props.pop("variant", "primary")
}, "size": { "xs": "px-1.5 h-7 rounded-ui-xs gap-1.5", "sm": "px-2 h-8 rounded-ui-sm gap-2", "md": "px-2.5 h-9 rounded-ui-md gap-2", "lg": "px-3 h-10 rounded-ui-lg gap-2.5", "xl": "px-3.5 h-12 rounded-ui-xl gap-3", "icon-xs": "size-7 rounded-ui-xs", "icon-sm": "size-8 rounded-ui-sm", "icon-md": "size-9 rounded-ui-md", "icon-lg": "size-10 rounded-ui-lg", "icon-xl": "size-12 rounded-ui-xl", }, } class Button(BaseButton, CoreComponent): """A custom button component.""" # Button variant. Defaults to "primary". variant: Var[LiteralButtonVariant] # Button size. Defaults to "md". size: Var[LiteralButtonSize] # The loading state of the button loading: Var[bool] @classmethod def create(cls, *children, **props) -> BaseButton: """Create the button component.""" variant = props.pop("variant", "primary") cls.validate_variant(variant)
cls.validate_size(size) loading = props.pop("loading", False) disabled = props.pop("disabled", False) button_classes = f"{DEFAULT_CLASS_NAME} {BUTTON_VARIANTS['variant'][variant]} {BUTTON_VARIANTS['size'][size]}" cls.set_class_name(button_classes, props) children_list = list(children) if isinstance(loading, Var): props["disabled"] = cond(loading, True, disabled) children_list.insert(0, cond(loading, spinner())) else: props["disabled"] = True if loading else disabled children_list.insert(0, spinner()) if loading else None return super().create(*children_list, **props) @staticmethod def validate_variant(variant: LiteralButtonVariant): """Validate the button variant.""" if variant not in BUTTON_VARIANTS["variant"]: available_variants = ", ".join(BUTTON_VARIANTS["variant"].keys()) message = ( f"Invali
size = props.pop("size", "md")
"sm": "px-2 h-8 rounded-ui-sm gap-2", "md": "px-2.5 h-9 rounded-ui-md gap-2", "lg": "px-3 h-10 rounded-ui-lg gap-2.5", "xl": "px-3.5 h-12 rounded-ui-xl gap-3", "icon-xs": "size-7 rounded-ui-xs", "icon-sm": "size-8 rounded-ui-sm", "icon-md": "size-9 rounded-ui-md", "icon-lg": "size-10 rounded-ui-lg", "icon-xl": "size-12 rounded-ui-xl", }, } class Button(BaseButton, CoreComponent): """A custom button component.""" # Button variant. Defaults to "primary". variant: Var[LiteralButtonVariant] # Button size. Defaults to "md". size: Var[LiteralButtonSize] # The loading state of the button loading: Var[bool] @classmethod def create(cls, *children, **props) -> BaseButton: """Create the button component.""" variant = props.pop("variant", "primary") cls.validate_variant(variant) size = props.pop("size", "md") cls.validate_size(size)
disabled = props.pop("disabled", False) button_classes = f"{DEFAULT_CLASS_NAME} {BUTTON_VARIANTS['variant'][variant]} {BUTTON_VARIANTS['size'][size]}" cls.set_class_name(button_classes, props) children_list = list(children) if isinstance(loading, Var): props["disabled"] = cond(loading, True, disabled) children_list.insert(0, cond(loading, spinner())) else: props["disabled"] = True if loading else disabled children_list.insert(0, spinner()) if loading else None return super().create(*children_list, **props) @staticmethod def validate_variant(variant: LiteralButtonVariant): """Validate the button variant.""" if variant not in BUTTON_VARIANTS["variant"]: available_variants = ", ".join(BUTTON_VARIANTS["variant"].keys()) message = ( f"Invalid variant: {variant}. Available variants: {available_variants}" )
loading = props.pop("loading", False)
"md": "px-2.5 h-9 rounded-ui-md gap-2", "lg": "px-3 h-10 rounded-ui-lg gap-2.5", "xl": "px-3.5 h-12 rounded-ui-xl gap-3", "icon-xs": "size-7 rounded-ui-xs", "icon-sm": "size-8 rounded-ui-sm", "icon-md": "size-9 rounded-ui-md", "icon-lg": "size-10 rounded-ui-lg", "icon-xl": "size-12 rounded-ui-xl", }, } class Button(BaseButton, CoreComponent): """A custom button component.""" # Button variant. Defaults to "primary". variant: Var[LiteralButtonVariant] # Button size. Defaults to "md". size: Var[LiteralButtonSize] # The loading state of the button loading: Var[bool] @classmethod def create(cls, *children, **props) -> BaseButton: """Create the button component.""" variant = props.pop("variant", "primary") cls.validate_variant(variant) size = props.pop("size", "md") cls.validate_size(size) loading = props.pop("loading", False)
button_classes = f"{DEFAULT_CLASS_NAME} {BUTTON_VARIANTS['variant'][variant]} {BUTTON_VARIANTS['size'][size]}" cls.set_class_name(button_classes, props) children_list = list(children) if isinstance(loading, Var): props["disabled"] = cond(loading, True, disabled) children_list.insert(0, cond(loading, spinner())) else: props["disabled"] = True if loading else disabled children_list.insert(0, spinner()) if loading else None return super().create(*children_list, **props) @staticmethod def validate_variant(variant: LiteralButtonVariant): """Validate the button variant.""" if variant not in BUTTON_VARIANTS["variant"]: available_variants = ", ".join(BUTTON_VARIANTS["variant"].keys()) message = ( f"Invalid variant: {variant}. Available variants: {available_variants}" ) raise ValueError(message) @stati
disabled = props.pop("disabled", False)
"lg": "px-3 h-10 rounded-ui-lg gap-2.5", "xl": "px-3.5 h-12 rounded-ui-xl gap-3", "icon-xs": "size-7 rounded-ui-xs", "icon-sm": "size-8 rounded-ui-sm", "icon-md": "size-9 rounded-ui-md", "icon-lg": "size-10 rounded-ui-lg", "icon-xl": "size-12 rounded-ui-xl", }, } class Button(BaseButton, CoreComponent): """A custom button component.""" # Button variant. Defaults to "primary". variant: Var[LiteralButtonVariant] # Button size. Defaults to "md". size: Var[LiteralButtonSize] # The loading state of the button loading: Var[bool] @classmethod def create(cls, *children, **props) -> BaseButton: """Create the button component.""" variant = props.pop("variant", "primary") cls.validate_variant(variant) size = props.pop("size", "md") cls.validate_size(size) loading = props.pop("loading", False) disabled = props.pop("disabled", False)
cls.set_class_name(button_classes, props) children_list = list(children) if isinstance(loading, Var): props["disabled"] = cond(loading, True, disabled) children_list.insert(0, cond(loading, spinner())) else: props["disabled"] = True if loading else disabled children_list.insert(0, spinner()) if loading else None return super().create(*children_list, **props) @staticmethod def validate_variant(variant: LiteralButtonVariant): """Validate the button variant.""" if variant not in BUTTON_VARIANTS["variant"]: available_variants = ", ".join(BUTTON_VARIANTS["variant"].keys()) message = ( f"Invalid variant: {variant}. Available variants: {available_variants}" ) raise ValueError(message) @staticmethod def validate_size(size: LiteralButtonSize): """Validate the button size.""" if size not in B
button_classes = f"{DEFAULT_CLASS_NAME} {BUTTON_VARIANTS['variant'][variant]} {BUTTON_VARIANTS['size'][size]}"
ed-ui-sm", "icon-md": "size-9 rounded-ui-md", "icon-lg": "size-10 rounded-ui-lg", "icon-xl": "size-12 rounded-ui-xl", }, } class Button(BaseButton, CoreComponent): """A custom button component.""" # Button variant. Defaults to "primary". variant: Var[LiteralButtonVariant] # Button size. Defaults to "md". size: Var[LiteralButtonSize] # The loading state of the button loading: Var[bool] @classmethod def create(cls, *children, **props) -> BaseButton: """Create the button component.""" variant = props.pop("variant", "primary") cls.validate_variant(variant) size = props.pop("size", "md") cls.validate_size(size) loading = props.pop("loading", False) disabled = props.pop("disabled", False) button_classes = f"{DEFAULT_CLASS_NAME} {BUTTON_VARIANTS['variant'][variant]} {BUTTON_VARIANTS['size'][size]}" cls.set_class_name(button_classes, props)
if isinstance(loading, Var): props["disabled"] = cond(loading, True, disabled) children_list.insert(0, cond(loading, spinner())) else: props["disabled"] = True if loading else disabled children_list.insert(0, spinner()) if loading else None return super().create(*children_list, **props) @staticmethod def validate_variant(variant: LiteralButtonVariant): """Validate the button variant.""" if variant not in BUTTON_VARIANTS["variant"]: available_variants = ", ".join(BUTTON_VARIANTS["variant"].keys()) message = ( f"Invalid variant: {variant}. Available variants: {available_variants}" ) raise ValueError(message) @staticmethod def validate_size(size: LiteralButtonSize): """Validate the button size.""" if size not in BUTTON_VARIANTS["size"]: available_sizes = ", ".join(BUTTON_VARIANTS["size"].key
children_list = list(children)
unded-ui-md", "icon-lg": "size-10 rounded-ui-lg", "icon-xl": "size-12 rounded-ui-xl", }, } class Button(BaseButton, CoreComponent): """A custom button component.""" # Button variant. Defaults to "primary". variant: Var[LiteralButtonVariant] # Button size. Defaults to "md". size: Var[LiteralButtonSize] # The loading state of the button loading: Var[bool] @classmethod def create(cls, *children, **props) -> BaseButton: """Create the button component.""" variant = props.pop("variant", "primary") cls.validate_variant(variant) size = props.pop("size", "md") cls.validate_size(size) loading = props.pop("loading", False) disabled = props.pop("disabled", False) button_classes = f"{DEFAULT_CLASS_NAME} {BUTTON_VARIANTS['variant'][variant]} {BUTTON_VARIANTS['size'][size]}" cls.set_class_name(button_classes, props) children_list = list(children)
return super().create(*children_list, **props) @staticmethod def validate_variant(variant: LiteralButtonVariant): """Validate the button variant.""" if variant not in BUTTON_VARIANTS["variant"]: available_variants = ", ".join(BUTTON_VARIANTS["variant"].keys()) message = ( f"Invalid variant: {variant}. Available variants: {available_variants}" ) raise ValueError(message) @staticmethod def validate_size(size: LiteralButtonSize): """Validate the button size.""" if size not in BUTTON_VARIANTS["size"]: available_sizes = ", ".join(BUTTON_VARIANTS["size"].keys()) message = f"Invalid size: {size}. Available sizes: {available_sizes}" raise ValueError(message) def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "size", "variant", "loading", ] but
if isinstance(loading, Var): props["disabled"] = cond(loading, True, disabled) children_list.insert(0, cond(loading, spinner())) else: props["disabled"] = True if loading else disabled children_list.insert(0, spinner()) if loading else None
rounded-ui-lg", "icon-xl": "size-12 rounded-ui-xl", }, } class Button(BaseButton, CoreComponent): """A custom button component.""" # Button variant. Defaults to "primary". variant: Var[LiteralButtonVariant] # Button size. Defaults to "md". size: Var[LiteralButtonSize] # The loading state of the button loading: Var[bool] @classmethod def create(cls, *children, **props) -> BaseButton: """Create the button component.""" variant = props.pop("variant", "primary") cls.validate_variant(variant) size = props.pop("size", "md") cls.validate_size(size) loading = props.pop("loading", False) disabled = props.pop("disabled", False) button_classes = f"{DEFAULT_CLASS_NAME} {BUTTON_VARIANTS['variant'][variant]} {BUTTON_VARIANTS['size'][size]}" cls.set_class_name(button_classes, props) children_list = list(children) if isinstance(loading, Var):
children_list.insert(0, cond(loading, spinner())) else: props["disabled"] = True if loading else disabled children_list.insert(0, spinner()) if loading else None return super().create(*children_list, **props) @staticmethod def validate_variant(variant: LiteralButtonVariant): """Validate the button variant.""" if variant not in BUTTON_VARIANTS["variant"]: available_variants = ", ".join(BUTTON_VARIANTS["variant"].keys()) message = ( f"Invalid variant: {variant}. Available variants: {available_variants}" ) raise ValueError(message) @staticmethod def validate_size(size: LiteralButtonSize): """Validate the button size.""" if size not in BUTTON_VARIANTS["size"]: available_sizes = ", ".join(BUTTON_VARIANTS["size"].keys()) message = f"Invalid size: {size}. Available sizes: {available_sizes}" r
props["disabled"] = cond(loading, True, disabled)
mponent.""" # Button variant. Defaults to "primary". variant: Var[LiteralButtonVariant] # Button size. Defaults to "md". size: Var[LiteralButtonSize] # The loading state of the button loading: Var[bool] @classmethod def create(cls, *children, **props) -> BaseButton: """Create the button component.""" variant = props.pop("variant", "primary") cls.validate_variant(variant) size = props.pop("size", "md") cls.validate_size(size) loading = props.pop("loading", False) disabled = props.pop("disabled", False) button_classes = f"{DEFAULT_CLASS_NAME} {BUTTON_VARIANTS['variant'][variant]} {BUTTON_VARIANTS['size'][size]}" cls.set_class_name(button_classes, props) children_list = list(children) if isinstance(loading, Var): props["disabled"] = cond(loading, True, disabled) children_list.insert(0, cond(loading, spinner())) else:
children_list.insert(0, spinner()) if loading else None return super().create(*children_list, **props) @staticmethod def validate_variant(variant: LiteralButtonVariant): """Validate the button variant.""" if variant not in BUTTON_VARIANTS["variant"]: available_variants = ", ".join(BUTTON_VARIANTS["variant"].keys()) message = ( f"Invalid variant: {variant}. Available variants: {available_variants}" ) raise ValueError(message) @staticmethod def validate_size(size: LiteralButtonSize): """Validate the button size.""" if size not in BUTTON_VARIANTS["size"]: available_sizes = ", ".join(BUTTON_VARIANTS["size"].keys()) message = f"Invalid size: {size}. Available sizes: {available_sizes}" raise ValueError(message) def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "
props["disabled"] = True if loading else disabled
he button loading: Var[bool] @classmethod def create(cls, *children, **props) -> BaseButton: """Create the button component.""" variant = props.pop("variant", "primary") cls.validate_variant(variant) size = props.pop("size", "md") cls.validate_size(size) loading = props.pop("loading", False) disabled = props.pop("disabled", False) button_classes = f"{DEFAULT_CLASS_NAME} {BUTTON_VARIANTS['variant'][variant]} {BUTTON_VARIANTS['size'][size]}" cls.set_class_name(button_classes, props) children_list = list(children) if isinstance(loading, Var): props["disabled"] = cond(loading, True, disabled) children_list.insert(0, cond(loading, spinner())) else: props["disabled"] = True if loading else disabled children_list.insert(0, spinner()) if loading else None return super().create(*children_list, **props) @staticmethod
@staticmethod def validate_size(size: LiteralButtonSize): """Validate the button size.""" if size not in BUTTON_VARIANTS["size"]: available_sizes = ", ".join(BUTTON_VARIANTS["size"].keys()) message = f"Invalid size: {size}. Available sizes: {available_sizes}" raise ValueError(message) def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "size", "variant", "loading", ] button = Button.create
def validate_variant(variant: LiteralButtonVariant): """Validate the button variant.""" if variant not in BUTTON_VARIANTS["variant"]: available_variants = ", ".join(BUTTON_VARIANTS["variant"].keys()) message = ( f"Invalid variant: {variant}. Available variants: {available_variants}" ) raise ValueError(message)
: """Create the button component.""" variant = props.pop("variant", "primary") cls.validate_variant(variant) size = props.pop("size", "md") cls.validate_size(size) loading = props.pop("loading", False) disabled = props.pop("disabled", False) button_classes = f"{DEFAULT_CLASS_NAME} {BUTTON_VARIANTS['variant'][variant]} {BUTTON_VARIANTS['size'][size]}" cls.set_class_name(button_classes, props) children_list = list(children) if isinstance(loading, Var): props["disabled"] = cond(loading, True, disabled) children_list.insert(0, cond(loading, spinner())) else: props["disabled"] = True if loading else disabled children_list.insert(0, spinner()) if loading else None return super().create(*children_list, **props) @staticmethod def validate_variant(variant: LiteralButtonVariant): """Validate the button variant."""
@staticmethod def validate_size(size: LiteralButtonSize): """Validate the button size.""" if size not in BUTTON_VARIANTS["size"]: available_sizes = ", ".join(BUTTON_VARIANTS["size"].keys()) message = f"Invalid size: {size}. Available sizes: {available_sizes}" raise ValueError(message) def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "size", "variant", "loading", ] button = Button.create
if variant not in BUTTON_VARIANTS["variant"]: available_variants = ", ".join(BUTTON_VARIANTS["variant"].keys()) message = ( f"Invalid variant: {variant}. Available variants: {available_variants}" ) raise ValueError(message)
nt = props.pop("variant", "primary") cls.validate_variant(variant) size = props.pop("size", "md") cls.validate_size(size) loading = props.pop("loading", False) disabled = props.pop("disabled", False) button_classes = f"{DEFAULT_CLASS_NAME} {BUTTON_VARIANTS['variant'][variant]} {BUTTON_VARIANTS['size'][size]}" cls.set_class_name(button_classes, props) children_list = list(children) if isinstance(loading, Var): props["disabled"] = cond(loading, True, disabled) children_list.insert(0, cond(loading, spinner())) else: props["disabled"] = True if loading else disabled children_list.insert(0, spinner()) if loading else None return super().create(*children_list, **props) @staticmethod def validate_variant(variant: LiteralButtonVariant): """Validate the button variant.""" if variant not in BUTTON_VARIANTS["variant"]:
message = ( f"Invalid variant: {variant}. Available variants: {available_variants}" ) raise ValueError(message) @staticmethod def validate_size(size: LiteralButtonSize): """Validate the button size.""" if size not in BUTTON_VARIANTS["size"]: available_sizes = ", ".join(BUTTON_VARIANTS["size"].keys()) message = f"Invalid size: {size}. Available sizes: {available_sizes}" raise ValueError(message) def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "size", "variant", "loading", ] button = Button.create
available_variants = ", ".join(BUTTON_VARIANTS["variant"].keys())
tton_classes = f"{DEFAULT_CLASS_NAME} {BUTTON_VARIANTS['variant'][variant]} {BUTTON_VARIANTS['size'][size]}" cls.set_class_name(button_classes, props) children_list = list(children) if isinstance(loading, Var): props["disabled"] = cond(loading, True, disabled) children_list.insert(0, cond(loading, spinner())) else: props["disabled"] = True if loading else disabled children_list.insert(0, spinner()) if loading else None return super().create(*children_list, **props) @staticmethod def validate_variant(variant: LiteralButtonVariant): """Validate the button variant.""" if variant not in BUTTON_VARIANTS["variant"]: available_variants = ", ".join(BUTTON_VARIANTS["variant"].keys()) message = ( f"Invalid variant: {variant}. Available variants: {available_variants}" ) raise ValueError(message) @staticmethod
def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "size", "variant", "loading", ] button = Button.create
def validate_size(size: LiteralButtonSize): """Validate the button size.""" if size not in BUTTON_VARIANTS["size"]: available_sizes = ", ".join(BUTTON_VARIANTS["size"].keys()) message = f"Invalid size: {size}. Available sizes: {available_sizes}" raise ValueError(message)
['size'][size]}" cls.set_class_name(button_classes, props) children_list = list(children) if isinstance(loading, Var): props["disabled"] = cond(loading, True, disabled) children_list.insert(0, cond(loading, spinner())) else: props["disabled"] = True if loading else disabled children_list.insert(0, spinner()) if loading else None return super().create(*children_list, **props) @staticmethod def validate_variant(variant: LiteralButtonVariant): """Validate the button variant.""" if variant not in BUTTON_VARIANTS["variant"]: available_variants = ", ".join(BUTTON_VARIANTS["variant"].keys()) message = ( f"Invalid variant: {variant}. Available variants: {available_variants}" ) raise ValueError(message) @staticmethod def validate_size(size: LiteralButtonSize): """Validate the button size."""
def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "size", "variant", "loading", ] button = Button.create
if size not in BUTTON_VARIANTS["size"]: available_sizes = ", ".join(BUTTON_VARIANTS["size"].keys()) message = f"Invalid size: {size}. Available sizes: {available_sizes}" raise ValueError(message)
classes, props) children_list = list(children) if isinstance(loading, Var): props["disabled"] = cond(loading, True, disabled) children_list.insert(0, cond(loading, spinner())) else: props["disabled"] = True if loading else disabled children_list.insert(0, spinner()) if loading else None return super().create(*children_list, **props) @staticmethod def validate_variant(variant: LiteralButtonVariant): """Validate the button variant.""" if variant not in BUTTON_VARIANTS["variant"]: available_variants = ", ".join(BUTTON_VARIANTS["variant"].keys()) message = ( f"Invalid variant: {variant}. Available variants: {available_variants}" ) raise ValueError(message) @staticmethod def validate_size(size: LiteralButtonSize): """Validate the button size.""" if size not in BUTTON_VARIANTS["size"]:
message = f"Invalid size: {size}. Available sizes: {available_sizes}" raise ValueError(message) def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "size", "variant", "loading", ] button = Button.create
available_sizes = ", ".join(BUTTON_VARIANTS["size"].keys())
stance(loading, Var): props["disabled"] = cond(loading, True, disabled) children_list.insert(0, cond(loading, spinner())) else: props["disabled"] = True if loading else disabled children_list.insert(0, spinner()) if loading else None return super().create(*children_list, **props) @staticmethod def validate_variant(variant: LiteralButtonVariant): """Validate the button variant.""" if variant not in BUTTON_VARIANTS["variant"]: available_variants = ", ".join(BUTTON_VARIANTS["variant"].keys()) message = ( f"Invalid variant: {variant}. Available variants: {available_variants}" ) raise ValueError(message) @staticmethod def validate_size(size: LiteralButtonSize): """Validate the button size.""" if size not in BUTTON_VARIANTS["size"]: available_sizes = ", ".join(BUTTON_VARIANTS["size"].keys())
raise ValueError(message) def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "size", "variant", "loading", ] button = Button.create
message = f"Invalid size: {size}. Available sizes: {available_sizes}"
ert(0, cond(loading, spinner())) else: props["disabled"] = True if loading else disabled children_list.insert(0, spinner()) if loading else None return super().create(*children_list, **props) @staticmethod def validate_variant(variant: LiteralButtonVariant): """Validate the button variant.""" if variant not in BUTTON_VARIANTS["variant"]: available_variants = ", ".join(BUTTON_VARIANTS["variant"].keys()) message = ( f"Invalid variant: {variant}. Available variants: {available_variants}" ) raise ValueError(message) @staticmethod def validate_size(size: LiteralButtonSize): """Validate the button size.""" if size not in BUTTON_VARIANTS["size"]: available_sizes = ", ".join(BUTTON_VARIANTS["size"].keys()) message = f"Invalid size: {size}. Available sizes: {available_sizes}" raise ValueError(message)
button = Button.create
def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "size", "variant", "loading", ]
one return super().create(*children_list, **props) @staticmethod def validate_variant(variant: LiteralButtonVariant): """Validate the button variant.""" if variant not in BUTTON_VARIANTS["variant"]: available_variants = ", ".join(BUTTON_VARIANTS["variant"].keys()) message = ( f"Invalid variant: {variant}. Available variants: {available_variants}" ) raise ValueError(message) @staticmethod def validate_size(size: LiteralButtonSize): """Validate the button size.""" if size not in BUTTON_VARIANTS["size"]: available_sizes = ", ".join(BUTTON_VARIANTS["size"].keys()) message = f"Invalid size: {size}. Available sizes: {available_sizes}" raise ValueError(message) def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "size", "variant", "loading", ]
button = Button.create
"""Custom card component."""
from reflex.components.el import Div from reflex.vars.base import Var from reflex_ui.components.component import CoreComponent class ClassNames: """Class names for the card component.""" ROOT = "rounded-ui-xl border border-secondary-a4 bg-secondary-1 shadow-small" HEADER = "flex flex-col gap-2 p-6" TITLE = "text-2xl font-semibold text-secondary-12" DESCRIPTION = "text-sm text-secondary-11 font-[450]" CONTENT = "flex flex-col gap-4 px-6 pb-6" FOOTER = "flex flex-row justify-between items-center px-6 pb-6" class CardComponent(Div, CoreComponent): """Base component for the card component.""" class CardRoot(CardComponent): """A card component that displays content in a card format.""" @classmethod def create(cls, *children, **props): """Create the card component.""" props["data-slot"] = "card" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CardHeader(CardCompo
from reflex.components.component import Component, ComponentNamespace
"""Custom card component.""" from reflex.components.component import Component, ComponentNamespace
from reflex.vars.base import Var from reflex_ui.components.component import CoreComponent class ClassNames: """Class names for the card component.""" ROOT = "rounded-ui-xl border border-secondary-a4 bg-secondary-1 shadow-small" HEADER = "flex flex-col gap-2 p-6" TITLE = "text-2xl font-semibold text-secondary-12" DESCRIPTION = "text-sm text-secondary-11 font-[450]" CONTENT = "flex flex-col gap-4 px-6 pb-6" FOOTER = "flex flex-row justify-between items-center px-6 pb-6" class CardComponent(Div, CoreComponent): """Base component for the card component.""" class CardRoot(CardComponent): """A card component that displays content in a card format.""" @classmethod def create(cls, *children, **props): """Create the card component.""" props["data-slot"] = "card" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CardHeader(CardComponent): """A header component for
from reflex.components.el import Div
"""Custom card component.""" from reflex.components.component import Component, ComponentNamespace from reflex.components.el import Div
from reflex_ui.components.component import CoreComponent class ClassNames: """Class names for the card component.""" ROOT = "rounded-ui-xl border border-secondary-a4 bg-secondary-1 shadow-small" HEADER = "flex flex-col gap-2 p-6" TITLE = "text-2xl font-semibold text-secondary-12" DESCRIPTION = "text-sm text-secondary-11 font-[450]" CONTENT = "flex flex-col gap-4 px-6 pb-6" FOOTER = "flex flex-row justify-between items-center px-6 pb-6" class CardComponent(Div, CoreComponent): """Base component for the card component.""" class CardRoot(CardComponent): """A card component that displays content in a card format.""" @classmethod def create(cls, *children, **props): """Create the card component.""" props["data-slot"] = "card" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CardHeader(CardComponent): """A header component for the card.""" @classmethod
from reflex.vars.base import Var
"""Custom card component.""" from reflex.components.component import Component, ComponentNamespace from reflex.components.el import Div from reflex.vars.base import Var
class ClassNames: """Class names for the card component.""" ROOT = "rounded-ui-xl border border-secondary-a4 bg-secondary-1 shadow-small" HEADER = "flex flex-col gap-2 p-6" TITLE = "text-2xl font-semibold text-secondary-12" DESCRIPTION = "text-sm text-secondary-11 font-[450]" CONTENT = "flex flex-col gap-4 px-6 pb-6" FOOTER = "flex flex-row justify-between items-center px-6 pb-6" class CardComponent(Div, CoreComponent): """Base component for the card component.""" class CardRoot(CardComponent): """A card component that displays content in a card format.""" @classmethod def create(cls, *children, **props): """Create the card component.""" props["data-slot"] = "card" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CardHeader(CardComponent): """A header component for the card.""" @classmethod def create(cls, *children, **props): """Create t
from reflex_ui.components.component import CoreComponent
"""Custom card component.""" from reflex.components.component import Component, ComponentNamespace from reflex.components.el import Div from reflex.vars.base import Var from reflex_ui.components.component import CoreComponent
class CardComponent(Div, CoreComponent): """Base component for the card component.""" class CardRoot(CardComponent): """A card component that displays content in a card format.""" @classmethod def create(cls, *children, **props): """Create the card component.""" props["data-slot"] = "card" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CardHeader(CardComponent): """A header component for the card.""" @classmethod def create(cls, *children, **props): """Create the card header component.""" props["data-slot"] = "card-header" cls.set_class_name(ClassNames.HEADER, props) return super().create(*children, **props) class CardTitle(CardComponent): """A title component for the card.""" @classmethod def create(cls, *children, **props): """Create the card title component.""" props["data-slot"] = "card-title" cls.set
class ClassNames: """Class names for the card component.""" ROOT = "rounded-ui-xl border border-secondary-a4 bg-secondary-1 shadow-small" HEADER = "flex flex-col gap-2 p-6" TITLE = "text-2xl font-semibold text-secondary-12" DESCRIPTION = "text-sm text-secondary-11 font-[450]" CONTENT = "flex flex-col gap-4 px-6 pb-6" FOOTER = "flex flex-row justify-between items-center px-6 pb-6"
"""Custom card component.""" from reflex.components.component import Component, ComponentNamespace from reflex.components.el import Div from reflex.vars.base import Var from reflex_ui.components.component import CoreComponent class ClassNames: """Class names for the card component."""
HEADER = "flex flex-col gap-2 p-6" TITLE = "text-2xl font-semibold text-secondary-12" DESCRIPTION = "text-sm text-secondary-11 font-[450]" CONTENT = "flex flex-col gap-4 px-6 pb-6" FOOTER = "flex flex-row justify-between items-center px-6 pb-6" class CardComponent(Div, CoreComponent): """Base component for the card component.""" class CardRoot(CardComponent): """A card component that displays content in a card format.""" @classmethod def create(cls, *children, **props): """Create the card component.""" props["data-slot"] = "card" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CardHeader(CardComponent): """A header component for the card.""" @classmethod def create(cls, *children, **props): """Create the card header component.""" props["data-slot"] = "card-header" cls.set_class_name(ClassNames.HEADER, props) return super().c
ROOT = "rounded-ui-xl border border-secondary-a4 bg-secondary-1 shadow-small"
"""Custom card component.""" from reflex.components.component import Component, ComponentNamespace from reflex.components.el import Div from reflex.vars.base import Var from reflex_ui.components.component import CoreComponent class ClassNames: """Class names for the card component.""" ROOT = "rounded-ui-xl border border-secondary-a4 bg-secondary-1 shadow-small" HEADER = "flex flex-col gap-2 p-6"
DESCRIPTION = "text-sm text-secondary-11 font-[450]" CONTENT = "flex flex-col gap-4 px-6 pb-6" FOOTER = "flex flex-row justify-between items-center px-6 pb-6" class CardComponent(Div, CoreComponent): """Base component for the card component.""" class CardRoot(CardComponent): """A card component that displays content in a card format.""" @classmethod def create(cls, *children, **props): """Create the card component.""" props["data-slot"] = "card" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CardHeader(CardComponent): """A header component for the card.""" @classmethod def create(cls, *children, **props): """Create the card header component.""" props["data-slot"] = "card-header" cls.set_class_name(ClassNames.HEADER, props) return super().create(*children, **props) class CardTitle(CardComponent): """A title component for the c
TITLE = "text-2xl font-semibold text-secondary-12"
"""Custom card component.""" from reflex.components.component import Component, ComponentNamespace from reflex.components.el import Div from reflex.vars.base import Var from reflex_ui.components.component import CoreComponent class ClassNames: """Class names for the card component.""" ROOT = "rounded-ui-xl border border-secondary-a4 bg-secondary-1 shadow-small" HEADER = "flex flex-col gap-2 p-6" TITLE = "text-2xl font-semibold text-secondary-12"
CONTENT = "flex flex-col gap-4 px-6 pb-6" FOOTER = "flex flex-row justify-between items-center px-6 pb-6" class CardComponent(Div, CoreComponent): """Base component for the card component.""" class CardRoot(CardComponent): """A card component that displays content in a card format.""" @classmethod def create(cls, *children, **props): """Create the card component.""" props["data-slot"] = "card" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CardHeader(CardComponent): """A header component for the card.""" @classmethod def create(cls, *children, **props): """Create the card header component.""" props["data-slot"] = "card-header" cls.set_class_name(ClassNames.HEADER, props) return super().create(*children, **props) class CardTitle(CardComponent): """A title component for the card.""" @classmethod def create(cls, *children,
DESCRIPTION = "text-sm text-secondary-11 font-[450]"
"""Custom card component.""" from reflex.components.component import Component, ComponentNamespace from reflex.components.el import Div from reflex.vars.base import Var from reflex_ui.components.component import CoreComponent class ClassNames: """Class names for the card component.""" ROOT = "rounded-ui-xl border border-secondary-a4 bg-secondary-1 shadow-small" HEADER = "flex flex-col gap-2 p-6" TITLE = "text-2xl font-semibold text-secondary-12" DESCRIPTION = "text-sm text-secondary-11 font-[450]"
FOOTER = "flex flex-row justify-between items-center px-6 pb-6" class CardComponent(Div, CoreComponent): """Base component for the card component.""" class CardRoot(CardComponent): """A card component that displays content in a card format.""" @classmethod def create(cls, *children, **props): """Create the card component.""" props["data-slot"] = "card" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CardHeader(CardComponent): """A header component for the card.""" @classmethod def create(cls, *children, **props): """Create the card header component.""" props["data-slot"] = "card-header" cls.set_class_name(ClassNames.HEADER, props) return super().create(*children, **props) class CardTitle(CardComponent): """A title component for the card.""" @classmethod def create(cls, *children, **props): """Create the card title com
CONTENT = "flex flex-col gap-4 px-6 pb-6"
"""Custom card component.""" from reflex.components.component import Component, ComponentNamespace from reflex.components.el import Div from reflex.vars.base import Var from reflex_ui.components.component import CoreComponent class ClassNames: """Class names for the card component.""" ROOT = "rounded-ui-xl border border-secondary-a4 bg-secondary-1 shadow-small" HEADER = "flex flex-col gap-2 p-6" TITLE = "text-2xl font-semibold text-secondary-12" DESCRIPTION = "text-sm text-secondary-11 font-[450]" CONTENT = "flex flex-col gap-4 px-6 pb-6"
class CardComponent(Div, CoreComponent): """Base component for the card component.""" class CardRoot(CardComponent): """A card component that displays content in a card format.""" @classmethod def create(cls, *children, **props): """Create the card component.""" props["data-slot"] = "card" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CardHeader(CardComponent): """A header component for the card.""" @classmethod def create(cls, *children, **props): """Create the card header component.""" props["data-slot"] = "card-header" cls.set_class_name(ClassNames.HEADER, props) return super().create(*children, **props) class CardTitle(CardComponent): """A title component for the card.""" @classmethod def create(cls, *children, **props): """Create the card title component.""" props["data-slot"] = "card-title" cls.set
FOOTER = "flex flex-row justify-between items-center px-6 pb-6"
"""Custom card component.""" from reflex.components.component import Component, ComponentNamespace from reflex.components.el import Div from reflex.vars.base import Var from reflex_ui.components.component import CoreComponent class ClassNames: """Class names for the card component.""" ROOT = "rounded-ui-xl border border-secondary-a4 bg-secondary-1 shadow-small" HEADER = "flex flex-col gap-2 p-6" TITLE = "text-2xl font-semibold text-secondary-12" DESCRIPTION = "text-sm text-secondary-11 font-[450]" CONTENT = "flex flex-col gap-4 px-6 pb-6" FOOTER = "flex flex-row justify-between items-center px-6 pb-6"
class CardRoot(CardComponent): """A card component that displays content in a card format.""" @classmethod def create(cls, *children, **props): """Create the card component.""" props["data-slot"] = "card" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CardHeader(CardComponent): """A header component for the card.""" @classmethod def create(cls, *children, **props): """Create the card header component.""" props["data-slot"] = "card-header" cls.set_class_name(ClassNames.HEADER, props) return super().create(*children, **props) class CardTitle(CardComponent): """A title component for the card.""" @classmethod def create(cls, *children, **props): """Create the card title component.""" props["data-slot"] = "card-title" cls.set_class_name(ClassNames.TITLE, props) return super().create(*children, **props) cla
class CardComponent(Div, CoreComponent): """Base component for the card component."""
"""Custom card component.""" from reflex.components.component import Component, ComponentNamespace from reflex.components.el import Div from reflex.vars.base import Var from reflex_ui.components.component import CoreComponent class ClassNames: """Class names for the card component.""" ROOT = "rounded-ui-xl border border-secondary-a4 bg-secondary-1 shadow-small" HEADER = "flex flex-col gap-2 p-6" TITLE = "text-2xl font-semibold text-secondary-12" DESCRIPTION = "text-sm text-secondary-11 font-[450]" CONTENT = "flex flex-col gap-4 px-6 pb-6" FOOTER = "flex flex-row justify-between items-center px-6 pb-6" class CardComponent(Div, CoreComponent): """Base component for the card component."""
class CardHeader(CardComponent): """A header component for the card.""" @classmethod def create(cls, *children, **props): """Create the card header component.""" props["data-slot"] = "card-header" cls.set_class_name(ClassNames.HEADER, props) return super().create(*children, **props) class CardTitle(CardComponent): """A title component for the card.""" @classmethod def create(cls, *children, **props): """Create the card title component.""" props["data-slot"] = "card-title" cls.set_class_name(ClassNames.TITLE, props) return super().create(*children, **props) class CardDescription(CardComponent): """A description component for the card.""" @classmethod def create(cls, *children, **props): """Create the card description component.""" props["data-slot"] = "card-description" cls.set_class_name(ClassNames.DESCRIPTION, props) return super().create(*child
class CardRoot(CardComponent): """A card component that displays content in a card format.""" @classmethod def create(cls, *children, **props): """Create the card component.""" props["data-slot"] = "card" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props)
"""Custom card component.""" from reflex.components.component import Component, ComponentNamespace from reflex.components.el import Div from reflex.vars.base import Var from reflex_ui.components.component import CoreComponent class ClassNames: """Class names for the card component.""" ROOT = "rounded-ui-xl border border-secondary-a4 bg-secondary-1 shadow-small" HEADER = "flex flex-col gap-2 p-6" TITLE = "text-2xl font-semibold text-secondary-12" DESCRIPTION = "text-sm text-secondary-11 font-[450]" CONTENT = "flex flex-col gap-4 px-6 pb-6" FOOTER = "flex flex-row justify-between items-center px-6 pb-6" class CardComponent(Div, CoreComponent): """Base component for the card component.""" class CardRoot(CardComponent): """A card component that displays content in a card format.""" @classmethod
class CardHeader(CardComponent): """A header component for the card.""" @classmethod def create(cls, *children, **props): """Create the card header component.""" props["data-slot"] = "card-header" cls.set_class_name(ClassNames.HEADER, props) return super().create(*children, **props) class CardTitle(CardComponent): """A title component for the card.""" @classmethod def create(cls, *children, **props): """Create the card title component.""" props["data-slot"] = "card-title" cls.set_class_name(ClassNames.TITLE, props) return super().create(*children, **props) class CardDescription(CardComponent): """A description component for the card.""" @classmethod def create(cls, *children, **props): """Create the card description component.""" props["data-slot"] = "card-description" cls.set_class_name(ClassNames.DESCRIPTION, props) return super().create(*child
def create(cls, *children, **props): """Create the card component.""" props["data-slot"] = "card" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props)
"""Custom card component.""" from reflex.components.component import Component, ComponentNamespace from reflex.components.el import Div from reflex.vars.base import Var from reflex_ui.components.component import CoreComponent class ClassNames: """Class names for the card component.""" ROOT = "rounded-ui-xl border border-secondary-a4 bg-secondary-1 shadow-small" HEADER = "flex flex-col gap-2 p-6" TITLE = "text-2xl font-semibold text-secondary-12" DESCRIPTION = "text-sm text-secondary-11 font-[450]" CONTENT = "flex flex-col gap-4 px-6 pb-6" FOOTER = "flex flex-row justify-between items-center px-6 pb-6" class CardComponent(Div, CoreComponent): """Base component for the card component.""" class CardRoot(CardComponent): """A card component that displays content in a card format.""" @classmethod def create(cls, *children, **props): """Create the card component."""
cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CardHeader(CardComponent): """A header component for the card.""" @classmethod def create(cls, *children, **props): """Create the card header component.""" props["data-slot"] = "card-header" cls.set_class_name(ClassNames.HEADER, props) return super().create(*children, **props) class CardTitle(CardComponent): """A title component for the card.""" @classmethod def create(cls, *children, **props): """Create the card title component.""" props["data-slot"] = "card-title" cls.set_class_name(ClassNames.TITLE, props) return super().create(*children, **props) class CardDescription(CardComponent): """A description component for the card.""" @classmethod def create(cls, *children, **props): """Create the card description component.""" props["data-slot"] = "card-descri
props["data-slot"] = "card"
ponent, ComponentNamespace from reflex.components.el import Div from reflex.vars.base import Var from reflex_ui.components.component import CoreComponent class ClassNames: """Class names for the card component.""" ROOT = "rounded-ui-xl border border-secondary-a4 bg-secondary-1 shadow-small" HEADER = "flex flex-col gap-2 p-6" TITLE = "text-2xl font-semibold text-secondary-12" DESCRIPTION = "text-sm text-secondary-11 font-[450]" CONTENT = "flex flex-col gap-4 px-6 pb-6" FOOTER = "flex flex-row justify-between items-center px-6 pb-6" class CardComponent(Div, CoreComponent): """Base component for the card component.""" class CardRoot(CardComponent): """A card component that displays content in a card format.""" @classmethod def create(cls, *children, **props): """Create the card component.""" props["data-slot"] = "card" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props)
class CardTitle(CardComponent): """A title component for the card.""" @classmethod def create(cls, *children, **props): """Create the card title component.""" props["data-slot"] = "card-title" cls.set_class_name(ClassNames.TITLE, props) return super().create(*children, **props) class CardDescription(CardComponent): """A description component for the card.""" @classmethod def create(cls, *children, **props): """Create the card description component.""" props["data-slot"] = "card-description" cls.set_class_name(ClassNames.DESCRIPTION, props) return super().create(*children, **props) class CardContent(CardComponent): """A content component for the card.""" @classmethod def create(cls, *children, **props): """Create the card content component.""" props["data-slot"] = "card-content" cls.set_class_name(ClassNames.CONTENT, props) return super().create(*
class CardHeader(CardComponent): """A header component for the card.""" @classmethod def create(cls, *children, **props): """Create the card header component.""" props["data-slot"] = "card-header" cls.set_class_name(ClassNames.HEADER, props) return super().create(*children, **props)
from reflex_ui.components.component import CoreComponent class ClassNames: """Class names for the card component.""" ROOT = "rounded-ui-xl border border-secondary-a4 bg-secondary-1 shadow-small" HEADER = "flex flex-col gap-2 p-6" TITLE = "text-2xl font-semibold text-secondary-12" DESCRIPTION = "text-sm text-secondary-11 font-[450]" CONTENT = "flex flex-col gap-4 px-6 pb-6" FOOTER = "flex flex-row justify-between items-center px-6 pb-6" class CardComponent(Div, CoreComponent): """Base component for the card component.""" class CardRoot(CardComponent): """A card component that displays content in a card format.""" @classmethod def create(cls, *children, **props): """Create the card component.""" props["data-slot"] = "card" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CardHeader(CardComponent): """A header component for the card.""" @classmethod
class CardTitle(CardComponent): """A title component for the card.""" @classmethod def create(cls, *children, **props): """Create the card title component.""" props["data-slot"] = "card-title" cls.set_class_name(ClassNames.TITLE, props) return super().create(*children, **props) class CardDescription(CardComponent): """A description component for the card.""" @classmethod def create(cls, *children, **props): """Create the card description component.""" props["data-slot"] = "card-description" cls.set_class_name(ClassNames.DESCRIPTION, props) return super().create(*children, **props) class CardContent(CardComponent): """A content component for the card.""" @classmethod def create(cls, *children, **props): """Create the card content component.""" props["data-slot"] = "card-content" cls.set_class_name(ClassNames.CONTENT, props) return super().create(*
def create(cls, *children, **props): """Create the card header component.""" props["data-slot"] = "card-header" cls.set_class_name(ClassNames.HEADER, props) return super().create(*children, **props)
es for the card component.""" ROOT = "rounded-ui-xl border border-secondary-a4 bg-secondary-1 shadow-small" HEADER = "flex flex-col gap-2 p-6" TITLE = "text-2xl font-semibold text-secondary-12" DESCRIPTION = "text-sm text-secondary-11 font-[450]" CONTENT = "flex flex-col gap-4 px-6 pb-6" FOOTER = "flex flex-row justify-between items-center px-6 pb-6" class CardComponent(Div, CoreComponent): """Base component for the card component.""" class CardRoot(CardComponent): """A card component that displays content in a card format.""" @classmethod def create(cls, *children, **props): """Create the card component.""" props["data-slot"] = "card" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CardHeader(CardComponent): """A header component for the card.""" @classmethod def create(cls, *children, **props): """Create the card header component."""
cls.set_class_name(ClassNames.HEADER, props) return super().create(*children, **props) class CardTitle(CardComponent): """A title component for the card.""" @classmethod def create(cls, *children, **props): """Create the card title component.""" props["data-slot"] = "card-title" cls.set_class_name(ClassNames.TITLE, props) return super().create(*children, **props) class CardDescription(CardComponent): """A description component for the card.""" @classmethod def create(cls, *children, **props): """Create the card description component.""" props["data-slot"] = "card-description" cls.set_class_name(ClassNames.DESCRIPTION, props) return super().create(*children, **props) class CardContent(CardComponent): """A content component for the card.""" @classmethod def create(cls, *children, **props): """Create the card content component.""" props["data-slot"]
props["data-slot"] = "card-header"
gap-2 p-6" TITLE = "text-2xl font-semibold text-secondary-12" DESCRIPTION = "text-sm text-secondary-11 font-[450]" CONTENT = "flex flex-col gap-4 px-6 pb-6" FOOTER = "flex flex-row justify-between items-center px-6 pb-6" class CardComponent(Div, CoreComponent): """Base component for the card component.""" class CardRoot(CardComponent): """A card component that displays content in a card format.""" @classmethod def create(cls, *children, **props): """Create the card component.""" props["data-slot"] = "card" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CardHeader(CardComponent): """A header component for the card.""" @classmethod def create(cls, *children, **props): """Create the card header component.""" props["data-slot"] = "card-header" cls.set_class_name(ClassNames.HEADER, props) return super().create(*children, **props)
class CardDescription(CardComponent): """A description component for the card.""" @classmethod def create(cls, *children, **props): """Create the card description component.""" props["data-slot"] = "card-description" cls.set_class_name(ClassNames.DESCRIPTION, props) return super().create(*children, **props) class CardContent(CardComponent): """A content component for the card.""" @classmethod def create(cls, *children, **props): """Create the card content component.""" props["data-slot"] = "card-content" cls.set_class_name(ClassNames.CONTENT, props) return super().create(*children, **props) class CardFooter(CardComponent): """A footer component for the card.""" @classmethod def create(cls, *children, **props): """Create the card footer component.""" props["data-slot"] = "card-footer" cls.set_class_name(ClassNames.FOOTER, props) return super().cre
class CardTitle(CardComponent): """A title component for the card.""" @classmethod def create(cls, *children, **props): """Create the card title component.""" props["data-slot"] = "card-title" cls.set_class_name(ClassNames.TITLE, props) return super().create(*children, **props)
xt-secondary-11 font-[450]" CONTENT = "flex flex-col gap-4 px-6 pb-6" FOOTER = "flex flex-row justify-between items-center px-6 pb-6" class CardComponent(Div, CoreComponent): """Base component for the card component.""" class CardRoot(CardComponent): """A card component that displays content in a card format.""" @classmethod def create(cls, *children, **props): """Create the card component.""" props["data-slot"] = "card" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CardHeader(CardComponent): """A header component for the card.""" @classmethod def create(cls, *children, **props): """Create the card header component.""" props["data-slot"] = "card-header" cls.set_class_name(ClassNames.HEADER, props) return super().create(*children, **props) class CardTitle(CardComponent): """A title component for the card.""" @classmethod
class CardDescription(CardComponent): """A description component for the card.""" @classmethod def create(cls, *children, **props): """Create the card description component.""" props["data-slot"] = "card-description" cls.set_class_name(ClassNames.DESCRIPTION, props) return super().create(*children, **props) class CardContent(CardComponent): """A content component for the card.""" @classmethod def create(cls, *children, **props): """Create the card content component.""" props["data-slot"] = "card-content" cls.set_class_name(ClassNames.CONTENT, props) return super().create(*children, **props) class CardFooter(CardComponent): """A footer component for the card.""" @classmethod def create(cls, *children, **props): """Create the card footer component.""" props["data-slot"] = "card-footer" cls.set_class_name(ClassNames.FOOTER, props) return super().cre
def create(cls, *children, **props): """Create the card title component.""" props["data-slot"] = "card-title" cls.set_class_name(ClassNames.TITLE, props) return super().create(*children, **props)
flex-row justify-between items-center px-6 pb-6" class CardComponent(Div, CoreComponent): """Base component for the card component.""" class CardRoot(CardComponent): """A card component that displays content in a card format.""" @classmethod def create(cls, *children, **props): """Create the card component.""" props["data-slot"] = "card" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CardHeader(CardComponent): """A header component for the card.""" @classmethod def create(cls, *children, **props): """Create the card header component.""" props["data-slot"] = "card-header" cls.set_class_name(ClassNames.HEADER, props) return super().create(*children, **props) class CardTitle(CardComponent): """A title component for the card.""" @classmethod def create(cls, *children, **props): """Create the card title component."""
cls.set_class_name(ClassNames.TITLE, props) return super().create(*children, **props) class CardDescription(CardComponent): """A description component for the card.""" @classmethod def create(cls, *children, **props): """Create the card description component.""" props["data-slot"] = "card-description" cls.set_class_name(ClassNames.DESCRIPTION, props) return super().create(*children, **props) class CardContent(CardComponent): """A content component for the card.""" @classmethod def create(cls, *children, **props): """Create the card content component.""" props["data-slot"] = "card-content" cls.set_class_name(ClassNames.CONTENT, props) return super().create(*children, **props) class CardFooter(CardComponent): """A footer component for the card.""" @classmethod def create(cls, *children, **props): """Create the card footer component.""" props["data-
props["data-slot"] = "card-title"
""" class CardRoot(CardComponent): """A card component that displays content in a card format.""" @classmethod def create(cls, *children, **props): """Create the card component.""" props["data-slot"] = "card" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CardHeader(CardComponent): """A header component for the card.""" @classmethod def create(cls, *children, **props): """Create the card header component.""" props["data-slot"] = "card-header" cls.set_class_name(ClassNames.HEADER, props) return super().create(*children, **props) class CardTitle(CardComponent): """A title component for the card.""" @classmethod def create(cls, *children, **props): """Create the card title component.""" props["data-slot"] = "card-title" cls.set_class_name(ClassNames.TITLE, props) return super().create(*children, **props)
class CardContent(CardComponent): """A content component for the card.""" @classmethod def create(cls, *children, **props): """Create the card content component.""" props["data-slot"] = "card-content" cls.set_class_name(ClassNames.CONTENT, props) return super().create(*children, **props) class CardFooter(CardComponent): """A footer component for the card.""" @classmethod def create(cls, *children, **props): """Create the card footer component.""" props["data-slot"] = "card-footer" cls.set_class_name(ClassNames.FOOTER, props) return super().create(*children, **props) class HighLevelCard(CardComponent): """A high level card component that displays content in a card format.""" # Card props title: Var[str | Component | None] description: Var[str | Component | None] content: Var[str | Component | None] footer: Var[str | Component | None] @classmethod def create(
class CardDescription(CardComponent): """A description component for the card.""" @classmethod def create(cls, *children, **props): """Create the card description component.""" props["data-slot"] = "card-description" cls.set_class_name(ClassNames.DESCRIPTION, props) return super().create(*children, **props)
@classmethod def create(cls, *children, **props): """Create the card component.""" props["data-slot"] = "card" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CardHeader(CardComponent): """A header component for the card.""" @classmethod def create(cls, *children, **props): """Create the card header component.""" props["data-slot"] = "card-header" cls.set_class_name(ClassNames.HEADER, props) return super().create(*children, **props) class CardTitle(CardComponent): """A title component for the card.""" @classmethod def create(cls, *children, **props): """Create the card title component.""" props["data-slot"] = "card-title" cls.set_class_name(ClassNames.TITLE, props) return super().create(*children, **props) class CardDescription(CardComponent): """A description component for the card.""" @classmethod
class CardContent(CardComponent): """A content component for the card.""" @classmethod def create(cls, *children, **props): """Create the card content component.""" props["data-slot"] = "card-content" cls.set_class_name(ClassNames.CONTENT, props) return super().create(*children, **props) class CardFooter(CardComponent): """A footer component for the card.""" @classmethod def create(cls, *children, **props): """Create the card footer component.""" props["data-slot"] = "card-footer" cls.set_class_name(ClassNames.FOOTER, props) return super().create(*children, **props) class HighLevelCard(CardComponent): """A high level card component that displays content in a card format.""" # Card props title: Var[str | Component | None] description: Var[str | Component | None] content: Var[str | Component | None] footer: Var[str | Component | None] @classmethod def create(
def create(cls, *children, **props): """Create the card description component.""" props["data-slot"] = "card-description" cls.set_class_name(ClassNames.DESCRIPTION, props) return super().create(*children, **props)
props["data-slot"] = "card" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CardHeader(CardComponent): """A header component for the card.""" @classmethod def create(cls, *children, **props): """Create the card header component.""" props["data-slot"] = "card-header" cls.set_class_name(ClassNames.HEADER, props) return super().create(*children, **props) class CardTitle(CardComponent): """A title component for the card.""" @classmethod def create(cls, *children, **props): """Create the card title component.""" props["data-slot"] = "card-title" cls.set_class_name(ClassNames.TITLE, props) return super().create(*children, **props) class CardDescription(CardComponent): """A description component for the card.""" @classmethod def create(cls, *children, **props): """Create the card description component."""
cls.set_class_name(ClassNames.DESCRIPTION, props) return super().create(*children, **props) class CardContent(CardComponent): """A content component for the card.""" @classmethod def create(cls, *children, **props): """Create the card content component.""" props["data-slot"] = "card-content" cls.set_class_name(ClassNames.CONTENT, props) return super().create(*children, **props) class CardFooter(CardComponent): """A footer component for the card.""" @classmethod def create(cls, *children, **props): """Create the card footer component.""" props["data-slot"] = "card-footer" cls.set_class_name(ClassNames.FOOTER, props) return super().create(*children, **props) class HighLevelCard(CardComponent): """A high level card component that displays content in a card format.""" # Card props title: Var[str | Component | None] description: Var[str | Component | None] co
props["data-slot"] = "card-description"
der(CardComponent): """A header component for the card.""" @classmethod def create(cls, *children, **props): """Create the card header component.""" props["data-slot"] = "card-header" cls.set_class_name(ClassNames.HEADER, props) return super().create(*children, **props) class CardTitle(CardComponent): """A title component for the card.""" @classmethod def create(cls, *children, **props): """Create the card title component.""" props["data-slot"] = "card-title" cls.set_class_name(ClassNames.TITLE, props) return super().create(*children, **props) class CardDescription(CardComponent): """A description component for the card.""" @classmethod def create(cls, *children, **props): """Create the card description component.""" props["data-slot"] = "card-description" cls.set_class_name(ClassNames.DESCRIPTION, props) return super().create(*children, **props)
class CardFooter(CardComponent): """A footer component for the card.""" @classmethod def create(cls, *children, **props): """Create the card footer component.""" props["data-slot"] = "card-footer" cls.set_class_name(ClassNames.FOOTER, props) return super().create(*children, **props) class HighLevelCard(CardComponent): """A high level card component that displays content in a card format.""" # Card props title: Var[str | Component | None] description: Var[str | Component | None] content: Var[str | Component | None] footer: Var[str | Component | None] @classmethod def create(cls, *children, **props): """Create the card component.""" title = props.pop("title", "") description = props.pop("description", "") content = props.pop("content", "") footer = props.pop("footer", "") return CardRoot.create( ( CardHeader.create(
class CardContent(CardComponent): """A content component for the card.""" @classmethod def create(cls, *children, **props): """Create the card content component.""" props["data-slot"] = "card-content" cls.set_class_name(ClassNames.CONTENT, props) return super().create(*children, **props)
*children, **props): """Create the card header component.""" props["data-slot"] = "card-header" cls.set_class_name(ClassNames.HEADER, props) return super().create(*children, **props) class CardTitle(CardComponent): """A title component for the card.""" @classmethod def create(cls, *children, **props): """Create the card title component.""" props["data-slot"] = "card-title" cls.set_class_name(ClassNames.TITLE, props) return super().create(*children, **props) class CardDescription(CardComponent): """A description component for the card.""" @classmethod def create(cls, *children, **props): """Create the card description component.""" props["data-slot"] = "card-description" cls.set_class_name(ClassNames.DESCRIPTION, props) return super().create(*children, **props) class CardContent(CardComponent): """A content component for the card.""" @classmethod
class CardFooter(CardComponent): """A footer component for the card.""" @classmethod def create(cls, *children, **props): """Create the card footer component.""" props["data-slot"] = "card-footer" cls.set_class_name(ClassNames.FOOTER, props) return super().create(*children, **props) class HighLevelCard(CardComponent): """A high level card component that displays content in a card format.""" # Card props title: Var[str | Component | None] description: Var[str | Component | None] content: Var[str | Component | None] footer: Var[str | Component | None] @classmethod def create(cls, *children, **props): """Create the card component.""" title = props.pop("title", "") description = props.pop("description", "") content = props.pop("content", "") footer = props.pop("footer", "") return CardRoot.create( ( CardHeader.create(
def create(cls, *children, **props): """Create the card content component.""" props["data-slot"] = "card-content" cls.set_class_name(ClassNames.CONTENT, props) return super().create(*children, **props)
"] = "card-header" cls.set_class_name(ClassNames.HEADER, props) return super().create(*children, **props) class CardTitle(CardComponent): """A title component for the card.""" @classmethod def create(cls, *children, **props): """Create the card title component.""" props["data-slot"] = "card-title" cls.set_class_name(ClassNames.TITLE, props) return super().create(*children, **props) class CardDescription(CardComponent): """A description component for the card.""" @classmethod def create(cls, *children, **props): """Create the card description component.""" props["data-slot"] = "card-description" cls.set_class_name(ClassNames.DESCRIPTION, props) return super().create(*children, **props) class CardContent(CardComponent): """A content component for the card.""" @classmethod def create(cls, *children, **props): """Create the card content component."""
cls.set_class_name(ClassNames.CONTENT, props) return super().create(*children, **props) class CardFooter(CardComponent): """A footer component for the card.""" @classmethod def create(cls, *children, **props): """Create the card footer component.""" props["data-slot"] = "card-footer" cls.set_class_name(ClassNames.FOOTER, props) return super().create(*children, **props) class HighLevelCard(CardComponent): """A high level card component that displays content in a card format.""" # Card props title: Var[str | Component | None] description: Var[str | Component | None] content: Var[str | Component | None] footer: Var[str | Component | None] @classmethod def create(cls, *children, **props): """Create the card component.""" title = props.pop("title", "") description = props.pop("description", "") content = props.pop("content", "") footer = props.pop("foot
props["data-slot"] = "card-content"
rdComponent): """A title component for the card.""" @classmethod def create(cls, *children, **props): """Create the card title component.""" props["data-slot"] = "card-title" cls.set_class_name(ClassNames.TITLE, props) return super().create(*children, **props) class CardDescription(CardComponent): """A description component for the card.""" @classmethod def create(cls, *children, **props): """Create the card description component.""" props["data-slot"] = "card-description" cls.set_class_name(ClassNames.DESCRIPTION, props) return super().create(*children, **props) class CardContent(CardComponent): """A content component for the card.""" @classmethod def create(cls, *children, **props): """Create the card content component.""" props["data-slot"] = "card-content" cls.set_class_name(ClassNames.CONTENT, props) return super().create(*children, **props)
class HighLevelCard(CardComponent): """A high level card component that displays content in a card format.""" # Card props title: Var[str | Component | None] description: Var[str | Component | None] content: Var[str | Component | None] footer: Var[str | Component | None] @classmethod def create(cls, *children, **props): """Create the card component.""" title = props.pop("title", "") description = props.pop("description", "") content = props.pop("content", "") footer = props.pop("footer", "") return CardRoot.create( ( CardHeader.create( CardTitle.create(title) if title is not None else None, ( CardDescription.create(description) if description is not None else None ), ) if title or description else
class CardFooter(CardComponent): """A footer component for the card.""" @classmethod def create(cls, *children, **props): """Create the card footer component.""" props["data-slot"] = "card-footer" cls.set_class_name(ClassNames.FOOTER, props) return super().create(*children, **props)
ldren, **props): """Create the card title component.""" props["data-slot"] = "card-title" cls.set_class_name(ClassNames.TITLE, props) return super().create(*children, **props) class CardDescription(CardComponent): """A description component for the card.""" @classmethod def create(cls, *children, **props): """Create the card description component.""" props["data-slot"] = "card-description" cls.set_class_name(ClassNames.DESCRIPTION, props) return super().create(*children, **props) class CardContent(CardComponent): """A content component for the card.""" @classmethod def create(cls, *children, **props): """Create the card content component.""" props["data-slot"] = "card-content" cls.set_class_name(ClassNames.CONTENT, props) return super().create(*children, **props) class CardFooter(CardComponent): """A footer component for the card.""" @classmethod
class HighLevelCard(CardComponent): """A high level card component that displays content in a card format.""" # Card props title: Var[str | Component | None] description: Var[str | Component | None] content: Var[str | Component | None] footer: Var[str | Component | None] @classmethod def create(cls, *children, **props): """Create the card component.""" title = props.pop("title", "") description = props.pop("description", "") content = props.pop("content", "") footer = props.pop("footer", "") return CardRoot.create( ( CardHeader.create( CardTitle.create(title) if title is not None else None, ( CardDescription.create(description) if description is not None else None ), ) if title or description else
def create(cls, *children, **props): """Create the card footer component.""" props["data-slot"] = "card-footer" cls.set_class_name(ClassNames.FOOTER, props) return super().create(*children, **props)
d.""" @classmethod def create(cls, *children, **props): """Create the card content component.""" props["data-slot"] = "card-content" cls.set_class_name(ClassNames.CONTENT, props) return super().create(*children, **props) class CardFooter(CardComponent): """A footer component for the card.""" @classmethod def create(cls, *children, **props): """Create the card footer component.""" props["data-slot"] = "card-footer" cls.set_class_name(ClassNames.FOOTER, props) return super().create(*children, **props) class HighLevelCard(CardComponent): """A high level card component that displays content in a card format.""" # Card props title: Var[str | Component | None] description: Var[str | Component | None] content: Var[str | Component | None] footer: Var[str | Component | None] @classmethod def create(cls, *children, **props): """Create the card component."""
description = props.pop("description", "") content = props.pop("content", "") footer = props.pop("footer", "") return CardRoot.create( ( CardHeader.create( CardTitle.create(title) if title is not None else None, ( CardDescription.create(description) if description is not None else None ), ) if title or description else None ), CardContent.create(content) if content is not None else None, CardFooter.create(footer) if footer is not None else None, *children, **props, ) def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "title", "description", "content", "footer", ] class Card(Co
title = props.pop("title", "")
cls, *children, **props): """Create the card content component.""" props["data-slot"] = "card-content" cls.set_class_name(ClassNames.CONTENT, props) return super().create(*children, **props) class CardFooter(CardComponent): """A footer component for the card.""" @classmethod def create(cls, *children, **props): """Create the card footer component.""" props["data-slot"] = "card-footer" cls.set_class_name(ClassNames.FOOTER, props) return super().create(*children, **props) class HighLevelCard(CardComponent): """A high level card component that displays content in a card format.""" # Card props title: Var[str | Component | None] description: Var[str | Component | None] content: Var[str | Component | None] footer: Var[str | Component | None] @classmethod def create(cls, *children, **props): """Create the card component.""" title = props.pop("title", "")
content = props.pop("content", "") footer = props.pop("footer", "") return CardRoot.create( ( CardHeader.create( CardTitle.create(title) if title is not None else None, ( CardDescription.create(description) if description is not None else None ), ) if title or description else None ), CardContent.create(content) if content is not None else None, CardFooter.create(footer) if footer is not None else None, *children, **props, ) def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "title", "description", "content", "footer", ] class Card(ComponentNamespace): """A card component that dis
description = props.pop("description", "")
d content component.""" props["data-slot"] = "card-content" cls.set_class_name(ClassNames.CONTENT, props) return super().create(*children, **props) class CardFooter(CardComponent): """A footer component for the card.""" @classmethod def create(cls, *children, **props): """Create the card footer component.""" props["data-slot"] = "card-footer" cls.set_class_name(ClassNames.FOOTER, props) return super().create(*children, **props) class HighLevelCard(CardComponent): """A high level card component that displays content in a card format.""" # Card props title: Var[str | Component | None] description: Var[str | Component | None] content: Var[str | Component | None] footer: Var[str | Component | None] @classmethod def create(cls, *children, **props): """Create the card component.""" title = props.pop("title", "") description = props.pop("description", "")
footer = props.pop("footer", "") return CardRoot.create( ( CardHeader.create( CardTitle.create(title) if title is not None else None, ( CardDescription.create(description) if description is not None else None ), ) if title or description else None ), CardContent.create(content) if content is not None else None, CardFooter.create(footer) if footer is not None else None, *children, **props, ) def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "title", "description", "content", "footer", ] class Card(ComponentNamespace): """A card component that displays content in a card format.""" roo
content = props.pop("content", "")
-slot"] = "card-content" cls.set_class_name(ClassNames.CONTENT, props) return super().create(*children, **props) class CardFooter(CardComponent): """A footer component for the card.""" @classmethod def create(cls, *children, **props): """Create the card footer component.""" props["data-slot"] = "card-footer" cls.set_class_name(ClassNames.FOOTER, props) return super().create(*children, **props) class HighLevelCard(CardComponent): """A high level card component that displays content in a card format.""" # Card props title: Var[str | Component | None] description: Var[str | Component | None] content: Var[str | Component | None] footer: Var[str | Component | None] @classmethod def create(cls, *children, **props): """Create the card component.""" title = props.pop("title", "") description = props.pop("description", "") content = props.pop("content", "")
return CardRoot.create( ( CardHeader.create( CardTitle.create(title) if title is not None else None, ( CardDescription.create(description) if description is not None else None ), ) if title or description else None ), CardContent.create(content) if content is not None else None, CardFooter.create(footer) if footer is not None else None, *children, **props, ) def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "title", "description", "content", "footer", ] class Card(ComponentNamespace): """A card component that displays content in a card format.""" root = staticmethod(CardRoot.create) hea
footer = props.pop("footer", "")
ntent: Var[str | Component | None] footer: Var[str | Component | None] @classmethod def create(cls, *children, **props): """Create the card component.""" title = props.pop("title", "") description = props.pop("description", "") content = props.pop("content", "") footer = props.pop("footer", "") return CardRoot.create( ( CardHeader.create( CardTitle.create(title) if title is not None else None, ( CardDescription.create(description) if description is not None else None ), ) if title or description else None ), CardContent.create(content) if content is not None else None, CardFooter.create(footer) if footer is not None else None, *children, **props, )
class Card(ComponentNamespace): """A card component that displays content in a card format.""" root = staticmethod(CardRoot.create) header = staticmethod(CardHeader.create) title = staticmethod(CardTitle.create) description = staticmethod(CardDescription.create) content = staticmethod(CardContent.create) footer = staticmethod(CardFooter.create) class_names = ClassNames __call__ = staticmethod(HighLevelCard.create) card = Card()
def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "title", "description", "content", "footer", ]
("title", "") description = props.pop("description", "") content = props.pop("content", "") footer = props.pop("footer", "") return CardRoot.create( ( CardHeader.create( CardTitle.create(title) if title is not None else None, ( CardDescription.create(description) if description is not None else None ), ) if title or description else None ), CardContent.create(content) if content is not None else None, CardFooter.create(footer) if footer is not None else None, *children, **props, ) def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "title", "description", "content", "footer", ]
card = Card()
class Card(ComponentNamespace): """A card component that displays content in a card format.""" root = staticmethod(CardRoot.create) header = staticmethod(CardHeader.create) title = staticmethod(CardTitle.create) description = staticmethod(CardDescription.create) content = staticmethod(CardContent.create) footer = staticmethod(CardFooter.create) class_names = ClassNames __call__ = staticmethod(HighLevelCard.create)
"") footer = props.pop("footer", "") return CardRoot.create( ( CardHeader.create( CardTitle.create(title) if title is not None else None, ( CardDescription.create(description) if description is not None else None ), ) if title or description else None ), CardContent.create(content) if content is not None else None, CardFooter.create(footer) if footer is not None else None, *children, **props, ) def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "title", "description", "content", "footer", ] class Card(ComponentNamespace): """A card component that displays content in a card format."""
header = staticmethod(CardHeader.create) title = staticmethod(CardTitle.create) description = staticmethod(CardDescription.create) content = staticmethod(CardContent.create) footer = staticmethod(CardFooter.create) class_names = ClassNames __call__ = staticmethod(HighLevelCard.create) card = Card()
root = staticmethod(CardRoot.create)
"") return CardRoot.create( ( CardHeader.create( CardTitle.create(title) if title is not None else None, ( CardDescription.create(description) if description is not None else None ), ) if title or description else None ), CardContent.create(content) if content is not None else None, CardFooter.create(footer) if footer is not None else None, *children, **props, ) def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "title", "description", "content", "footer", ] class Card(ComponentNamespace): """A card component that displays content in a card format.""" root = staticmethod(CardRoot.create)
title = staticmethod(CardTitle.create) description = staticmethod(CardDescription.create) content = staticmethod(CardContent.create) footer = staticmethod(CardFooter.create) class_names = ClassNames __call__ = staticmethod(HighLevelCard.create) card = Card()
header = staticmethod(CardHeader.create)
( CardHeader.create( CardTitle.create(title) if title is not None else None, ( CardDescription.create(description) if description is not None else None ), ) if title or description else None ), CardContent.create(content) if content is not None else None, CardFooter.create(footer) if footer is not None else None, *children, **props, ) def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "title", "description", "content", "footer", ] class Card(ComponentNamespace): """A card component that displays content in a card format.""" root = staticmethod(CardRoot.create) header = staticmethod(CardHeader.create)
description = staticmethod(CardDescription.create) content = staticmethod(CardContent.create) footer = staticmethod(CardFooter.create) class_names = ClassNames __call__ = staticmethod(HighLevelCard.create) card = Card()
title = staticmethod(CardTitle.create)
CardTitle.create(title) if title is not None else None, ( CardDescription.create(description) if description is not None else None ), ) if title or description else None ), CardContent.create(content) if content is not None else None, CardFooter.create(footer) if footer is not None else None, *children, **props, ) def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "title", "description", "content", "footer", ] class Card(ComponentNamespace): """A card component that displays content in a card format.""" root = staticmethod(CardRoot.create) header = staticmethod(CardHeader.create) title = staticmethod(CardTitle.create)
content = staticmethod(CardContent.create) footer = staticmethod(CardFooter.create) class_names = ClassNames __call__ = staticmethod(HighLevelCard.create) card = Card()
description = staticmethod(CardDescription.create)
ot None else None, ( CardDescription.create(description) if description is not None else None ), ) if title or description else None ), CardContent.create(content) if content is not None else None, CardFooter.create(footer) if footer is not None else None, *children, **props, ) def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "title", "description", "content", "footer", ] class Card(ComponentNamespace): """A card component that displays content in a card format.""" root = staticmethod(CardRoot.create) header = staticmethod(CardHeader.create) title = staticmethod(CardTitle.create) description = staticmethod(CardDescription.create)
footer = staticmethod(CardFooter.create) class_names = ClassNames __call__ = staticmethod(HighLevelCard.create) card = Card()
content = staticmethod(CardContent.create)
CardDescription.create(description) if description is not None else None ), ) if title or description else None ), CardContent.create(content) if content is not None else None, CardFooter.create(footer) if footer is not None else None, *children, **props, ) def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "title", "description", "content", "footer", ] class Card(ComponentNamespace): """A card component that displays content in a card format.""" root = staticmethod(CardRoot.create) header = staticmethod(CardHeader.create) title = staticmethod(CardTitle.create) description = staticmethod(CardDescription.create) content = staticmethod(CardContent.create)
class_names = ClassNames __call__ = staticmethod(HighLevelCard.create) card = Card()
footer = staticmethod(CardFooter.create)
ription) if description is not None else None ), ) if title or description else None ), CardContent.create(content) if content is not None else None, CardFooter.create(footer) if footer is not None else None, *children, **props, ) def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "title", "description", "content", "footer", ] class Card(ComponentNamespace): """A card component that displays content in a card format.""" root = staticmethod(CardRoot.create) header = staticmethod(CardHeader.create) title = staticmethod(CardTitle.create) description = staticmethod(CardDescription.create) content = staticmethod(CardContent.create) footer = staticmethod(CardFooter.create)
__call__ = staticmethod(HighLevelCard.create) card = Card()
class_names = ClassNames
if description is not None else None ), ) if title or description else None ), CardContent.create(content) if content is not None else None, CardFooter.create(footer) if footer is not None else None, *children, **props, ) def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "title", "description", "content", "footer", ] class Card(ComponentNamespace): """A card component that displays content in a card format.""" root = staticmethod(CardRoot.create) header = staticmethod(CardHeader.create) title = staticmethod(CardTitle.create) description = staticmethod(CardDescription.create) content = staticmethod(CardContent.create) footer = staticmethod(CardFooter.create) class_names = ClassNames
card = Card()
__call__ = staticmethod(HighLevelCard.create)
else None ), ) if title or description else None ), CardContent.create(content) if content is not None else None, CardFooter.create(footer) if footer is not None else None, *children, **props, ) def _exclude_props(self) -> list[str]: return [ *super()._exclude_props(), "title", "description", "content", "footer", ] class Card(ComponentNamespace): """A card component that displays content in a card format.""" root = staticmethod(CardRoot.create) header = staticmethod(CardHeader.create) title = staticmethod(CardTitle.create) description = staticmethod(CardDescription.create) content = staticmethod(CardContent.create) footer = staticmethod(CardFooter.create) class_names = ClassNames __call__ = staticmethod(HighLevelCard.create)
card = Card()
"""Checkbox component from base-ui components."""
from reflex.components.el import Label from reflex.event import EventHandler, passthrough_event_spec from reflex.utils.imports import ImportVar from reflex.vars.base import Var from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent from reflex_ui.components.icons.hugeicon import hi from reflex_ui.utils.twmerge import cn class ClassNames: """Class names for the checkbox component.""" ROOT = "flex size-4 items-center justify-center rounded-[4px] data-[checked]:bg-primary-9 data-[unchecked]:border data-[unchecked]:border-secondary-8 data-[disabled]:cursor-not-allowed data-[disabled]:border data-[disabled]:border-secondary-4 data-[disabled]:bg-secondary-3 hover:bg-secondary-3 transition-colors cursor-default" INDICATOR = ( "flex text-white data-[unchecked]:hidden data-[disabled]:text-secondary-8" ) LABEL = "text-sm text-secondary-12 font-medium flex items-center gap-2" CONTAINER = "flex flex-row items-center gap-2" class CheckboxBaseCo
from reflex.components.component import ComponentNamespace
"""Checkbox component from base-ui components.""" from reflex.components.component import ComponentNamespace
from reflex.event import EventHandler, passthrough_event_spec from reflex.utils.imports import ImportVar from reflex.vars.base import Var from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent from reflex_ui.components.icons.hugeicon import hi from reflex_ui.utils.twmerge import cn class ClassNames: """Class names for the checkbox component.""" ROOT = "flex size-4 items-center justify-center rounded-[4px] data-[checked]:bg-primary-9 data-[unchecked]:border data-[unchecked]:border-secondary-8 data-[disabled]:cursor-not-allowed data-[disabled]:border data-[disabled]:border-secondary-4 data-[disabled]:bg-secondary-3 hover:bg-secondary-3 transition-colors cursor-default" INDICATOR = ( "flex text-white data-[unchecked]:hidden data-[disabled]:text-secondary-8" ) LABEL = "text-sm text-secondary-12 font-medium flex items-center gap-2" CONTAINER = "flex flex-row items-center gap-2" class CheckboxBaseComponent(BaseUIComponent): """Base c
from reflex.components.el import Label
"""Checkbox component from base-ui components.""" from reflex.components.component import ComponentNamespace from reflex.components.el import Label
from reflex.utils.imports import ImportVar from reflex.vars.base import Var from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent from reflex_ui.components.icons.hugeicon import hi from reflex_ui.utils.twmerge import cn class ClassNames: """Class names for the checkbox component.""" ROOT = "flex size-4 items-center justify-center rounded-[4px] data-[checked]:bg-primary-9 data-[unchecked]:border data-[unchecked]:border-secondary-8 data-[disabled]:cursor-not-allowed data-[disabled]:border data-[disabled]:border-secondary-4 data-[disabled]:bg-secondary-3 hover:bg-secondary-3 transition-colors cursor-default" INDICATOR = ( "flex text-white data-[unchecked]:hidden data-[disabled]:text-secondary-8" ) LABEL = "text-sm text-secondary-12 font-medium flex items-center gap-2" CONTAINER = "flex flex-row items-center gap-2" class CheckboxBaseComponent(BaseUIComponent): """Base component for checkbox components.""" library = f"{PACKAGE
from reflex.event import EventHandler, passthrough_event_spec
"""Checkbox component from base-ui components.""" from reflex.components.component import ComponentNamespace from reflex.components.el import Label from reflex.event import EventHandler, passthrough_event_spec
from reflex.vars.base import Var from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent from reflex_ui.components.icons.hugeicon import hi from reflex_ui.utils.twmerge import cn class ClassNames: """Class names for the checkbox component.""" ROOT = "flex size-4 items-center justify-center rounded-[4px] data-[checked]:bg-primary-9 data-[unchecked]:border data-[unchecked]:border-secondary-8 data-[disabled]:cursor-not-allowed data-[disabled]:border data-[disabled]:border-secondary-4 data-[disabled]:bg-secondary-3 hover:bg-secondary-3 transition-colors cursor-default" INDICATOR = ( "flex text-white data-[unchecked]:hidden data-[disabled]:text-secondary-8" ) LABEL = "text-sm text-secondary-12 font-medium flex items-center gap-2" CONTAINER = "flex flex-row items-center gap-2" class CheckboxBaseComponent(BaseUIComponent): """Base component for checkbox components.""" library = f"{PACKAGE_NAME}/checkbox" @property def imp
from reflex.utils.imports import ImportVar
"""Checkbox component from base-ui components.""" from reflex.components.component import ComponentNamespace from reflex.components.el import Label from reflex.event import EventHandler, passthrough_event_spec from reflex.utils.imports import ImportVar
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent from reflex_ui.components.icons.hugeicon import hi from reflex_ui.utils.twmerge import cn class ClassNames: """Class names for the checkbox component.""" ROOT = "flex size-4 items-center justify-center rounded-[4px] data-[checked]:bg-primary-9 data-[unchecked]:border data-[unchecked]:border-secondary-8 data-[disabled]:cursor-not-allowed data-[disabled]:border data-[disabled]:border-secondary-4 data-[disabled]:bg-secondary-3 hover:bg-secondary-3 transition-colors cursor-default" INDICATOR = ( "flex text-white data-[unchecked]:hidden data-[disabled]:text-secondary-8" ) LABEL = "text-sm text-secondary-12 font-medium flex items-center gap-2" CONTAINER = "flex flex-row items-center gap-2" class CheckboxBaseComponent(BaseUIComponent): """Base component for checkbox components.""" library = f"{PACKAGE_NAME}/checkbox" @property def import_var(self): """Return
from reflex.vars.base import Var
"""Checkbox component from base-ui components.""" from reflex.components.component import ComponentNamespace from reflex.components.el import Label from reflex.event import EventHandler, passthrough_event_spec from reflex.utils.imports import ImportVar from reflex.vars.base import Var
from reflex_ui.components.icons.hugeicon import hi from reflex_ui.utils.twmerge import cn class ClassNames: """Class names for the checkbox component.""" ROOT = "flex size-4 items-center justify-center rounded-[4px] data-[checked]:bg-primary-9 data-[unchecked]:border data-[unchecked]:border-secondary-8 data-[disabled]:cursor-not-allowed data-[disabled]:border data-[disabled]:border-secondary-4 data-[disabled]:bg-secondary-3 hover:bg-secondary-3 transition-colors cursor-default" INDICATOR = ( "flex text-white data-[unchecked]:hidden data-[disabled]:text-secondary-8" ) LABEL = "text-sm text-secondary-12 font-medium flex items-center gap-2" CONTAINER = "flex flex-row items-center gap-2" class CheckboxBaseComponent(BaseUIComponent): """Base component for checkbox components.""" library = f"{PACKAGE_NAME}/checkbox" @property def import_var(self): """Return the import variable for the checkbox component.""" return Import
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
"""Checkbox component from base-ui components.""" from reflex.components.component import ComponentNamespace from reflex.components.el import Label from reflex.event import EventHandler, passthrough_event_spec from reflex.utils.imports import ImportVar from reflex.vars.base import Var from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.utils.twmerge import cn class ClassNames: """Class names for the checkbox component.""" ROOT = "flex size-4 items-center justify-center rounded-[4px] data-[checked]:bg-primary-9 data-[unchecked]:border data-[unchecked]:border-secondary-8 data-[disabled]:cursor-not-allowed data-[disabled]:border data-[disabled]:border-secondary-4 data-[disabled]:bg-secondary-3 hover:bg-secondary-3 transition-colors cursor-default" INDICATOR = ( "flex text-white data-[unchecked]:hidden data-[disabled]:text-secondary-8" ) LABEL = "text-sm text-secondary-12 font-medium flex items-center gap-2" CONTAINER = "flex flex-row items-center gap-2" class CheckboxBaseComponent(BaseUIComponent): """Base component for checkbox components.""" library = f"{PACKAGE_NAME}/checkbox" @property def import_var(self): """Return the import variable for the checkbox component.""" return ImportVar(tag="Checkbox", package_path="", install=False)
from reflex_ui.components.icons.hugeicon import hi
"""Checkbox component from base-ui components.""" from reflex.components.component import ComponentNamespace from reflex.components.el import Label from reflex.event import EventHandler, passthrough_event_spec from reflex.utils.imports import ImportVar from reflex.vars.base import Var from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent from reflex_ui.components.icons.hugeicon import hi
class ClassNames: """Class names for the checkbox component.""" ROOT = "flex size-4 items-center justify-center rounded-[4px] data-[checked]:bg-primary-9 data-[unchecked]:border data-[unchecked]:border-secondary-8 data-[disabled]:cursor-not-allowed data-[disabled]:border data-[disabled]:border-secondary-4 data-[disabled]:bg-secondary-3 hover:bg-secondary-3 transition-colors cursor-default" INDICATOR = ( "flex text-white data-[unchecked]:hidden data-[disabled]:text-secondary-8" ) LABEL = "text-sm text-secondary-12 font-medium flex items-center gap-2" CONTAINER = "flex flex-row items-center gap-2" class CheckboxBaseComponent(BaseUIComponent): """Base component for checkbox components.""" library = f"{PACKAGE_NAME}/checkbox" @property def import_var(self): """Return the import variable for the checkbox component.""" return ImportVar(tag="Checkbox", package_path="", install=False) class CheckboxRoot(CheckboxBaseCompo
from reflex_ui.utils.twmerge import cn
"""Checkbox component from base-ui components.""" from reflex.components.component import ComponentNamespace from reflex.components.el import Label from reflex.event import EventHandler, passthrough_event_spec from reflex.utils.imports import ImportVar from reflex.vars.base import Var from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent from reflex_ui.components.icons.hugeicon import hi from reflex_ui.utils.twmerge import cn class ClassNames: """Class names for the checkbox component."""
INDICATOR = ( "flex text-white data-[unchecked]:hidden data-[disabled]:text-secondary-8" ) LABEL = "text-sm text-secondary-12 font-medium flex items-center gap-2" CONTAINER = "flex flex-row items-center gap-2" class CheckboxBaseComponent(BaseUIComponent): """Base component for checkbox components.""" library = f"{PACKAGE_NAME}/checkbox" @property def import_var(self): """Return the import variable for the checkbox component.""" return ImportVar(tag="Checkbox", package_path="", install=False) class CheckboxRoot(CheckboxBaseComponent): """The root checkbox component.""" tag = "Checkbox.Root" # Whether the checkbox is initially ticked. To render a controlled checkbox, use the checked prop instead. Defaults to False. default_checked: Var[bool] # Whether the checkbox is currently ticked. To render an uncontrolled checkbox, use the default_checked prop instead. checked: Var[bool] # Event handler ca
ROOT = "flex size-4 items-center justify-center rounded-[4px] data-[checked]:bg-primary-9 data-[unchecked]:border data-[unchecked]:border-secondary-8 data-[disabled]:cursor-not-allowed data-[disabled]:border data-[disabled]:border-secondary-4 data-[disabled]:bg-secondary-3 hover:bg-secondary-3 transition-colors cursor-default"
"""Checkbox component from base-ui components.""" from reflex.components.component import ComponentNamespace from reflex.components.el import Label from reflex.event import EventHandler, passthrough_event_spec from reflex.utils.imports import ImportVar from reflex.vars.base import Var from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent from reflex_ui.components.icons.hugeicon import hi from reflex_ui.utils.twmerge import cn class ClassNames: """Class names for the checkbox component.""" ROOT = "flex size-4 items-center justify-center rounded-[4px] data-[checked]:bg-primary-9 data-[unchecked]:border data-[unchecked]:border-secondary-8 data-[disabled]:cursor-not-allowed data-[disabled]:border data-[disabled]:border-secondary-4 data-[disabled]:bg-secondary-3 hover:bg-secondary-3 transition-colors cursor-default"
LABEL = "text-sm text-secondary-12 font-medium flex items-center gap-2" CONTAINER = "flex flex-row items-center gap-2" class CheckboxBaseComponent(BaseUIComponent): """Base component for checkbox components.""" library = f"{PACKAGE_NAME}/checkbox" @property def import_var(self): """Return the import variable for the checkbox component.""" return ImportVar(tag="Checkbox", package_path="", install=False) class CheckboxRoot(CheckboxBaseComponent): """The root checkbox component.""" tag = "Checkbox.Root" # Whether the checkbox is initially ticked. To render a controlled checkbox, use the checked prop instead. Defaults to False. default_checked: Var[bool] # Whether the checkbox is currently ticked. To render an uncontrolled checkbox, use the default_checked prop instead. checked: Var[bool] # Event handler called when the checkbox is ticked or unticked. on_checked_change: EventHandler[passthrough_event_spec(bo
INDICATOR = ( "flex text-white data-[unchecked]:hidden data-[disabled]:text-secondary-8" )
"""Checkbox component from base-ui components.""" from reflex.components.component import ComponentNamespace from reflex.components.el import Label from reflex.event import EventHandler, passthrough_event_spec from reflex.utils.imports import ImportVar from reflex.vars.base import Var from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent from reflex_ui.components.icons.hugeicon import hi from reflex_ui.utils.twmerge import cn class ClassNames: """Class names for the checkbox component.""" ROOT = "flex size-4 items-center justify-center rounded-[4px] data-[checked]:bg-primary-9 data-[unchecked]:border data-[unchecked]:border-secondary-8 data-[disabled]:cursor-not-allowed data-[disabled]:border data-[disabled]:border-secondary-4 data-[disabled]:bg-secondary-3 hover:bg-secondary-3 transition-colors cursor-default" INDICATOR = ( "flex text-white data-[unchecked]:hidden data-[disabled]:text-secondary-8" )
CONTAINER = "flex flex-row items-center gap-2" class CheckboxBaseComponent(BaseUIComponent): """Base component for checkbox components.""" library = f"{PACKAGE_NAME}/checkbox" @property def import_var(self): """Return the import variable for the checkbox component.""" return ImportVar(tag="Checkbox", package_path="", install=False) class CheckboxRoot(CheckboxBaseComponent): """The root checkbox component.""" tag = "Checkbox.Root" # Whether the checkbox is initially ticked. To render a controlled checkbox, use the checked prop instead. Defaults to False. default_checked: Var[bool] # Whether the checkbox is currently ticked. To render an uncontrolled checkbox, use the default_checked prop instead. checked: Var[bool] # Event handler called when the checkbox is ticked or unticked. on_checked_change: EventHandler[passthrough_event_spec(bool, dict)] # Whether the checkbox is in a mixed state: neither ticked,
LABEL = "text-sm text-secondary-12 font-medium flex items-center gap-2"
nents.""" from reflex.components.component import ComponentNamespace from reflex.components.el import Label from reflex.event import EventHandler, passthrough_event_spec from reflex.utils.imports import ImportVar from reflex.vars.base import Var from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent from reflex_ui.components.icons.hugeicon import hi from reflex_ui.utils.twmerge import cn class ClassNames: """Class names for the checkbox component.""" ROOT = "flex size-4 items-center justify-center rounded-[4px] data-[checked]:bg-primary-9 data-[unchecked]:border data-[unchecked]:border-secondary-8 data-[disabled]:cursor-not-allowed data-[disabled]:border data-[disabled]:border-secondary-4 data-[disabled]:bg-secondary-3 hover:bg-secondary-3 transition-colors cursor-default" INDICATOR = ( "flex text-white data-[unchecked]:hidden data-[disabled]:text-secondary-8" ) LABEL = "text-sm text-secondary-12 font-medium flex items-center gap-2"
class CheckboxBaseComponent(BaseUIComponent): """Base component for checkbox components.""" library = f"{PACKAGE_NAME}/checkbox" @property def import_var(self): """Return the import variable for the checkbox component.""" return ImportVar(tag="Checkbox", package_path="", install=False) class CheckboxRoot(CheckboxBaseComponent): """The root checkbox component.""" tag = "Checkbox.Root" # Whether the checkbox is initially ticked. To render a controlled checkbox, use the checked prop instead. Defaults to False. default_checked: Var[bool] # Whether the checkbox is currently ticked. To render an uncontrolled checkbox, use the default_checked prop instead. checked: Var[bool] # Event handler called when the checkbox is ticked or unticked. on_checked_change: EventHandler[passthrough_event_spec(bool, dict)] # Whether the checkbox is in a mixed state: neither ticked, nor unticked. Defaults to False. indeterminate:
CONTAINER = "flex flex-row items-center gap-2"
t ComponentNamespace from reflex.components.el import Label from reflex.event import EventHandler, passthrough_event_spec from reflex.utils.imports import ImportVar from reflex.vars.base import Var from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent from reflex_ui.components.icons.hugeicon import hi from reflex_ui.utils.twmerge import cn class ClassNames: """Class names for the checkbox component.""" ROOT = "flex size-4 items-center justify-center rounded-[4px] data-[checked]:bg-primary-9 data-[unchecked]:border data-[unchecked]:border-secondary-8 data-[disabled]:cursor-not-allowed data-[disabled]:border data-[disabled]:border-secondary-4 data-[disabled]:bg-secondary-3 hover:bg-secondary-3 transition-colors cursor-default" INDICATOR = ( "flex text-white data-[unchecked]:hidden data-[disabled]:text-secondary-8" ) LABEL = "text-sm text-secondary-12 font-medium flex items-center gap-2" CONTAINER = "flex flex-row items-center gap-2"
class CheckboxRoot(CheckboxBaseComponent): """The root checkbox component.""" tag = "Checkbox.Root" # Whether the checkbox is initially ticked. To render a controlled checkbox, use the checked prop instead. Defaults to False. default_checked: Var[bool] # Whether the checkbox is currently ticked. To render an uncontrolled checkbox, use the default_checked prop instead. checked: Var[bool] # Event handler called when the checkbox is ticked or unticked. on_checked_change: EventHandler[passthrough_event_spec(bool, dict)] # Whether the checkbox is in a mixed state: neither ticked, nor unticked. Defaults to False. indeterminate: Var[bool] # Whether the component should ignore user interaction. Defaults to False. disabled: Var[bool] # Whether the checkbox is required. Defaults to False. required: Var[bool] # Identifies the field when a form is submitted. name: Var[str] # The value of the selected checkbox. valu
class CheckboxBaseComponent(BaseUIComponent): """Base component for checkbox components.""" library = f"{PACKAGE_NAME}/checkbox" @property def import_var(self): """Return the import variable for the checkbox component.""" return ImportVar(tag="Checkbox", package_path="", install=False)
ssthrough_event_spec from reflex.utils.imports import ImportVar from reflex.vars.base import Var from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent from reflex_ui.components.icons.hugeicon import hi from reflex_ui.utils.twmerge import cn class ClassNames: """Class names for the checkbox component.""" ROOT = "flex size-4 items-center justify-center rounded-[4px] data-[checked]:bg-primary-9 data-[unchecked]:border data-[unchecked]:border-secondary-8 data-[disabled]:cursor-not-allowed data-[disabled]:border data-[disabled]:border-secondary-4 data-[disabled]:bg-secondary-3 hover:bg-secondary-3 transition-colors cursor-default" INDICATOR = ( "flex text-white data-[unchecked]:hidden data-[disabled]:text-secondary-8" ) LABEL = "text-sm text-secondary-12 font-medium flex items-center gap-2" CONTAINER = "flex flex-row items-center gap-2" class CheckboxBaseComponent(BaseUIComponent): """Base component for checkbox components."""
@property def import_var(self): """Return the import variable for the checkbox component.""" return ImportVar(tag="Checkbox", package_path="", install=False) class CheckboxRoot(CheckboxBaseComponent): """The root checkbox component.""" tag = "Checkbox.Root" # Whether the checkbox is initially ticked. To render a controlled checkbox, use the checked prop instead. Defaults to False. default_checked: Var[bool] # Whether the checkbox is currently ticked. To render an uncontrolled checkbox, use the default_checked prop instead. checked: Var[bool] # Event handler called when the checkbox is ticked or unticked. on_checked_change: EventHandler[passthrough_event_spec(bool, dict)] # Whether the checkbox is in a mixed state: neither ticked, nor unticked. Defaults to False. indeterminate: Var[bool] # Whether the component should ignore user interaction. Defaults to False. disabled: Var[bool] # Whether the checkb
library = f"{PACKAGE_NAME}/checkbox"
portVar from reflex.vars.base import Var from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent from reflex_ui.components.icons.hugeicon import hi from reflex_ui.utils.twmerge import cn class ClassNames: """Class names for the checkbox component.""" ROOT = "flex size-4 items-center justify-center rounded-[4px] data-[checked]:bg-primary-9 data-[unchecked]:border data-[unchecked]:border-secondary-8 data-[disabled]:cursor-not-allowed data-[disabled]:border data-[disabled]:border-secondary-4 data-[disabled]:bg-secondary-3 hover:bg-secondary-3 transition-colors cursor-default" INDICATOR = ( "flex text-white data-[unchecked]:hidden data-[disabled]:text-secondary-8" ) LABEL = "text-sm text-secondary-12 font-medium flex items-center gap-2" CONTAINER = "flex flex-row items-center gap-2" class CheckboxBaseComponent(BaseUIComponent): """Base component for checkbox components.""" library = f"{PACKAGE_NAME}/checkbox" @property
class CheckboxRoot(CheckboxBaseComponent): """The root checkbox component.""" tag = "Checkbox.Root" # Whether the checkbox is initially ticked. To render a controlled checkbox, use the checked prop instead. Defaults to False. default_checked: Var[bool] # Whether the checkbox is currently ticked. To render an uncontrolled checkbox, use the default_checked prop instead. checked: Var[bool] # Event handler called when the checkbox is ticked or unticked. on_checked_change: EventHandler[passthrough_event_spec(bool, dict)] # Whether the checkbox is in a mixed state: neither ticked, nor unticked. Defaults to False. indeterminate: Var[bool] # Whether the component should ignore user interaction. Defaults to False. disabled: Var[bool] # Whether the checkbox is required. Defaults to False. required: Var[bool] # Identifies the field when a form is submitted. name: Var[str] # The value of the selected checkbox. valu
def import_var(self): """Return the import variable for the checkbox component.""" return ImportVar(tag="Checkbox", package_path="", install=False)
ckbox component.""" ROOT = "flex size-4 items-center justify-center rounded-[4px] data-[checked]:bg-primary-9 data-[unchecked]:border data-[unchecked]:border-secondary-8 data-[disabled]:cursor-not-allowed data-[disabled]:border data-[disabled]:border-secondary-4 data-[disabled]:bg-secondary-3 hover:bg-secondary-3 transition-colors cursor-default" INDICATOR = ( "flex text-white data-[unchecked]:hidden data-[disabled]:text-secondary-8" ) LABEL = "text-sm text-secondary-12 font-medium flex items-center gap-2" CONTAINER = "flex flex-row items-center gap-2" class CheckboxBaseComponent(BaseUIComponent): """Base component for checkbox components.""" library = f"{PACKAGE_NAME}/checkbox" @property def import_var(self): """Return the import variable for the checkbox component.""" return ImportVar(tag="Checkbox", package_path="", install=False) class CheckboxRoot(CheckboxBaseComponent): """The root checkbox component."""
# Whether the checkbox is initially ticked. To render a controlled checkbox, use the checked prop instead. Defaults to False. default_checked: Var[bool] # Whether the checkbox is currently ticked. To render an uncontrolled checkbox, use the default_checked prop instead. checked: Var[bool] # Event handler called when the checkbox is ticked or unticked. on_checked_change: EventHandler[passthrough_event_spec(bool, dict)] # Whether the checkbox is in a mixed state: neither ticked, nor unticked. Defaults to False. indeterminate: Var[bool] # Whether the component should ignore user interaction. Defaults to False. disabled: Var[bool] # Whether the checkbox is required. Defaults to False. required: Var[bool] # Identifies the field when a form is submitted. name: Var[str] # The value of the selected checkbox. value: Var[str] # Whether the component renders a native <button> element when replacing it via the render pro
tag = "Checkbox.Root"
ge: EventHandler[passthrough_event_spec(bool, dict)] # Whether the checkbox is in a mixed state: neither ticked, nor unticked. Defaults to False. indeterminate: Var[bool] # Whether the component should ignore user interaction. Defaults to False. disabled: Var[bool] # Whether the checkbox is required. Defaults to False. required: Var[bool] # Identifies the field when a form is submitted. name: Var[str] # The value of the selected checkbox. value: Var[str] # Whether the component renders a native <button> element when replacing it via the render prop. Set to false if the rendered element is not a button (e.g. <div>). Defaults to True. native_button: Var[bool] # Whether the checkbox controls a group of child checkboxes. Must be used in a Checkbox Group. Defaults to False. parent: Var[bool] # Whether the user should be unable to tick or untick the checkbox. Defaults to False. read_only: Var[bool] @classmethod
class CheckboxIndicator(CheckboxBaseComponent): """The indicator that shows whether the checkbox is checked.""" tag = "Checkbox.Indicator" @classmethod def create(cls, *children, **props) -> BaseUIComponent: """Create the checkbox indicator component.""" if len(children) == 0: children = (hi("Tick02Icon", size=14),) props["data-slot"] = "checkbox-indicator" cls.set_class_name(ClassNames.INDICATOR, props) return super().create(*children, **props) class HighLevelCheckbox(CheckboxRoot): """High level wrapper for the Checkbox component.""" @classmethod def create(cls, *children, **props) -> BaseUIComponent: """Create a high level checkbox component. Args: *children: The content of the checkbox. **props: Additional properties to apply to the checkbox component. Returns: The checkbox component and its indicator. """ class_name =
def create(cls, *children, **props) -> BaseUIComponent: """Create the checkbox root component.""" props["data-slot"] = "checkbox" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props)
ed, nor unticked. Defaults to False. indeterminate: Var[bool] # Whether the component should ignore user interaction. Defaults to False. disabled: Var[bool] # Whether the checkbox is required. Defaults to False. required: Var[bool] # Identifies the field when a form is submitted. name: Var[str] # The value of the selected checkbox. value: Var[str] # Whether the component renders a native <button> element when replacing it via the render prop. Set to false if the rendered element is not a button (e.g. <div>). Defaults to True. native_button: Var[bool] # Whether the checkbox controls a group of child checkboxes. Must be used in a Checkbox Group. Defaults to False. parent: Var[bool] # Whether the user should be unable to tick or untick the checkbox. Defaults to False. read_only: Var[bool] @classmethod def create(cls, *children, **props) -> BaseUIComponent: """Create the checkbox root component."""
cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CheckboxIndicator(CheckboxBaseComponent): """The indicator that shows whether the checkbox is checked.""" tag = "Checkbox.Indicator" @classmethod def create(cls, *children, **props) -> BaseUIComponent: """Create the checkbox indicator component.""" if len(children) == 0: children = (hi("Tick02Icon", size=14),) props["data-slot"] = "checkbox-indicator" cls.set_class_name(ClassNames.INDICATOR, props) return super().create(*children, **props) class HighLevelCheckbox(CheckboxRoot): """High level wrapper for the Checkbox component.""" @classmethod def create(cls, *children, **props) -> BaseUIComponent: """Create a high level checkbox component. Args: *children: The content of the checkbox. **props: Additional properties to apply to the checkbox component.
props["data-slot"] = "checkbox"
# Identifies the field when a form is submitted. name: Var[str] # The value of the selected checkbox. value: Var[str] # Whether the component renders a native <button> element when replacing it via the render prop. Set to false if the rendered element is not a button (e.g. <div>). Defaults to True. native_button: Var[bool] # Whether the checkbox controls a group of child checkboxes. Must be used in a Checkbox Group. Defaults to False. parent: Var[bool] # Whether the user should be unable to tick or untick the checkbox. Defaults to False. read_only: Var[bool] @classmethod def create(cls, *children, **props) -> BaseUIComponent: """Create the checkbox root component.""" props["data-slot"] = "checkbox" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CheckboxIndicator(CheckboxBaseComponent): """The indicator that shows whether the checkbox is checked."""
@classmethod def create(cls, *children, **props) -> BaseUIComponent: """Create the checkbox indicator component.""" if len(children) == 0: children = (hi("Tick02Icon", size=14),) props["data-slot"] = "checkbox-indicator" cls.set_class_name(ClassNames.INDICATOR, props) return super().create(*children, **props) class HighLevelCheckbox(CheckboxRoot): """High level wrapper for the Checkbox component.""" @classmethod def create(cls, *children, **props) -> BaseUIComponent: """Create a high level checkbox component. Args: *children: The content of the checkbox. **props: Additional properties to apply to the checkbox component. Returns: The checkbox component and its indicator. """ class_name = props.pop("class_name", "") if label := props.pop("label", None): return Label.create( # pyright: ignore[reportReturnType]
tag = "Checkbox.Indicator"
d. name: Var[str] # The value of the selected checkbox. value: Var[str] # Whether the component renders a native <button> element when replacing it via the render prop. Set to false if the rendered element is not a button (e.g. <div>). Defaults to True. native_button: Var[bool] # Whether the checkbox controls a group of child checkboxes. Must be used in a Checkbox Group. Defaults to False. parent: Var[bool] # Whether the user should be unable to tick or untick the checkbox. Defaults to False. read_only: Var[bool] @classmethod def create(cls, *children, **props) -> BaseUIComponent: """Create the checkbox root component.""" props["data-slot"] = "checkbox" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CheckboxIndicator(CheckboxBaseComponent): """The indicator that shows whether the checkbox is checked.""" tag = "Checkbox.Indicator" @classmethod
class HighLevelCheckbox(CheckboxRoot): """High level wrapper for the Checkbox component.""" @classmethod def create(cls, *children, **props) -> BaseUIComponent: """Create a high level checkbox component. Args: *children: The content of the checkbox. **props: Additional properties to apply to the checkbox component. Returns: The checkbox component and its indicator. """ class_name = props.pop("class_name", "") if label := props.pop("label", None): return Label.create( # pyright: ignore[reportReturnType] CheckboxRoot.create( CheckboxIndicator.create(), *children, **props, ), label, class_name=cn(ClassNames.LABEL, class_name), ) return CheckboxRoot.create( CheckboxIndicator.create(), *children, **pr
def create(cls, *children, **props) -> BaseUIComponent: """Create the checkbox indicator component.""" if len(children) == 0: children = (hi("Tick02Icon", size=14),) props["data-slot"] = "checkbox-indicator" cls.set_class_name(ClassNames.INDICATOR, props) return super().create(*children, **props)
rs a native <button> element when replacing it via the render prop. Set to false if the rendered element is not a button (e.g. <div>). Defaults to True. native_button: Var[bool] # Whether the checkbox controls a group of child checkboxes. Must be used in a Checkbox Group. Defaults to False. parent: Var[bool] # Whether the user should be unable to tick or untick the checkbox. Defaults to False. read_only: Var[bool] @classmethod def create(cls, *children, **props) -> BaseUIComponent: """Create the checkbox root component.""" props["data-slot"] = "checkbox" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CheckboxIndicator(CheckboxBaseComponent): """The indicator that shows whether the checkbox is checked.""" tag = "Checkbox.Indicator" @classmethod def create(cls, *children, **props) -> BaseUIComponent: """Create the checkbox indicator component."""
props["data-slot"] = "checkbox-indicator" cls.set_class_name(ClassNames.INDICATOR, props) return super().create(*children, **props) class HighLevelCheckbox(CheckboxRoot): """High level wrapper for the Checkbox component.""" @classmethod def create(cls, *children, **props) -> BaseUIComponent: """Create a high level checkbox component. Args: *children: The content of the checkbox. **props: Additional properties to apply to the checkbox component. Returns: The checkbox component and its indicator. """ class_name = props.pop("class_name", "") if label := props.pop("label", None): return Label.create( # pyright: ignore[reportReturnType] CheckboxRoot.create( CheckboxIndicator.create(), *children, **props, ), label, class_name=cn(Clas
if len(children) == 0: children = (hi("Tick02Icon", size=14),)
eplacing it via the render prop. Set to false if the rendered element is not a button (e.g. <div>). Defaults to True. native_button: Var[bool] # Whether the checkbox controls a group of child checkboxes. Must be used in a Checkbox Group. Defaults to False. parent: Var[bool] # Whether the user should be unable to tick or untick the checkbox. Defaults to False. read_only: Var[bool] @classmethod def create(cls, *children, **props) -> BaseUIComponent: """Create the checkbox root component.""" props["data-slot"] = "checkbox" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CheckboxIndicator(CheckboxBaseComponent): """The indicator that shows whether the checkbox is checked.""" tag = "Checkbox.Indicator" @classmethod def create(cls, *children, **props) -> BaseUIComponent: """Create the checkbox indicator component.""" if len(children) == 0:
props["data-slot"] = "checkbox-indicator" cls.set_class_name(ClassNames.INDICATOR, props) return super().create(*children, **props) class HighLevelCheckbox(CheckboxRoot): """High level wrapper for the Checkbox component.""" @classmethod def create(cls, *children, **props) -> BaseUIComponent: """Create a high level checkbox component. Args: *children: The content of the checkbox. **props: Additional properties to apply to the checkbox component. Returns: The checkbox component and its indicator. """ class_name = props.pop("class_name", "") if label := props.pop("label", None): return Label.create( # pyright: ignore[reportReturnType] CheckboxRoot.create( CheckboxIndicator.create(), *children, **props, ), label, class_name=cn(Clas
children = (hi("Tick02Icon", size=14),)
the rendered element is not a button (e.g. <div>). Defaults to True. native_button: Var[bool] # Whether the checkbox controls a group of child checkboxes. Must be used in a Checkbox Group. Defaults to False. parent: Var[bool] # Whether the user should be unable to tick or untick the checkbox. Defaults to False. read_only: Var[bool] @classmethod def create(cls, *children, **props) -> BaseUIComponent: """Create the checkbox root component.""" props["data-slot"] = "checkbox" cls.set_class_name(ClassNames.ROOT, props) return super().create(*children, **props) class CheckboxIndicator(CheckboxBaseComponent): """The indicator that shows whether the checkbox is checked.""" tag = "Checkbox.Indicator" @classmethod def create(cls, *children, **props) -> BaseUIComponent: """Create the checkbox indicator component.""" if len(children) == 0: children = (hi("Tick02Icon", size=14),)
cls.set_class_name(ClassNames.INDICATOR, props) return super().create(*children, **props) class HighLevelCheckbox(CheckboxRoot): """High level wrapper for the Checkbox component.""" @classmethod def create(cls, *children, **props) -> BaseUIComponent: """Create a high level checkbox component. Args: *children: The content of the checkbox. **props: Additional properties to apply to the checkbox component. Returns: The checkbox component and its indicator. """ class_name = props.pop("class_name", "") if label := props.pop("label", None): return Label.create( # pyright: ignore[reportReturnType] CheckboxRoot.create( CheckboxIndicator.create(), *children, **props, ), label, class_name=cn(ClassNames.LABEL, class_name), ) r
props["data-slot"] = "checkbox-indicator"
en, **props) class CheckboxIndicator(CheckboxBaseComponent): """The indicator that shows whether the checkbox is checked.""" tag = "Checkbox.Indicator" @classmethod def create(cls, *children, **props) -> BaseUIComponent: """Create the checkbox indicator component.""" if len(children) == 0: children = (hi("Tick02Icon", size=14),) props["data-slot"] = "checkbox-indicator" cls.set_class_name(ClassNames.INDICATOR, props) return super().create(*children, **props) class HighLevelCheckbox(CheckboxRoot): """High level wrapper for the Checkbox component.""" @classmethod def create(cls, *children, **props) -> BaseUIComponent: """Create a high level checkbox component. Args: *children: The content of the checkbox. **props: Additional properties to apply to the checkbox component. Returns: The checkbox component and its indicator. """
if label := props.pop("label", None): return Label.create( # pyright: ignore[reportReturnType] CheckboxRoot.create( CheckboxIndicator.create(), *children, **props, ), label, class_name=cn(ClassNames.LABEL, class_name), ) return CheckboxRoot.create( CheckboxIndicator.create(), *children, **props, class_name=class_name, ) class CheckboxNamespace(ComponentNamespace): """Namespace for Checkbox components.""" root = staticmethod(CheckboxRoot.create) indicator = staticmethod(CheckboxIndicator.create) high_level = staticmethod(HighLevelCheckbox.create) class_names = ClassNames __call__ = staticmethod(HighLevelCheckbox.create) checkbox = CheckboxNamespace()
class_name = props.pop("class_name", "")
seComponent): """The indicator that shows whether the checkbox is checked.""" tag = "Checkbox.Indicator" @classmethod def create(cls, *children, **props) -> BaseUIComponent: """Create the checkbox indicator component.""" if len(children) == 0: children = (hi("Tick02Icon", size=14),) props["data-slot"] = "checkbox-indicator" cls.set_class_name(ClassNames.INDICATOR, props) return super().create(*children, **props) class HighLevelCheckbox(CheckboxRoot): """High level wrapper for the Checkbox component.""" @classmethod def create(cls, *children, **props) -> BaseUIComponent: """Create a high level checkbox component. Args: *children: The content of the checkbox. **props: Additional properties to apply to the checkbox component. Returns: The checkbox component and its indicator. """ class_name = props.pop("class_name", "")
return CheckboxRoot.create( CheckboxIndicator.create(), *children, **props, class_name=class_name, ) class CheckboxNamespace(ComponentNamespace): """Namespace for Checkbox components.""" root = staticmethod(CheckboxRoot.create) indicator = staticmethod(CheckboxIndicator.create) high_level = staticmethod(HighLevelCheckbox.create) class_names = ClassNames __call__ = staticmethod(HighLevelCheckbox.create) checkbox = CheckboxNamespace()
if label := props.pop("label", None): return Label.create( # pyright: ignore[reportReturnType] CheckboxRoot.create( CheckboxIndicator.create(), *children, **props, ), label, class_name=cn(ClassNames.LABEL, class_name), )
h level wrapper for the Checkbox component.""" @classmethod def create(cls, *children, **props) -> BaseUIComponent: """Create a high level checkbox component. Args: *children: The content of the checkbox. **props: Additional properties to apply to the checkbox component. Returns: The checkbox component and its indicator. """ class_name = props.pop("class_name", "") if label := props.pop("label", None): return Label.create( # pyright: ignore[reportReturnType] CheckboxRoot.create( CheckboxIndicator.create(), *children, **props, ), label, class_name=cn(ClassNames.LABEL, class_name), ) return CheckboxRoot.create( CheckboxIndicator.create(), *children, **props, class_name=class_name, )
checkbox = CheckboxNamespace()
class CheckboxNamespace(ComponentNamespace): """Namespace for Checkbox components.""" root = staticmethod(CheckboxRoot.create) indicator = staticmethod(CheckboxIndicator.create) high_level = staticmethod(HighLevelCheckbox.create) class_names = ClassNames __call__ = staticmethod(HighLevelCheckbox.create)
**props) -> BaseUIComponent: """Create a high level checkbox component. Args: *children: The content of the checkbox. **props: Additional properties to apply to the checkbox component. Returns: The checkbox component and its indicator. """ class_name = props.pop("class_name", "") if label := props.pop("label", None): return Label.create( # pyright: ignore[reportReturnType] CheckboxRoot.create( CheckboxIndicator.create(), *children, **props, ), label, class_name=cn(ClassNames.LABEL, class_name), ) return CheckboxRoot.create( CheckboxIndicator.create(), *children, **props, class_name=class_name, ) class CheckboxNamespace(ComponentNamespace): """Namespace for Checkbox components."""
indicator = staticmethod(CheckboxIndicator.create) high_level = staticmethod(HighLevelCheckbox.create) class_names = ClassNames __call__ = staticmethod(HighLevelCheckbox.create) checkbox = CheckboxNamespace()
root = staticmethod(CheckboxRoot.create)
te a high level checkbox component. Args: *children: The content of the checkbox. **props: Additional properties to apply to the checkbox component. Returns: The checkbox component and its indicator. """ class_name = props.pop("class_name", "") if label := props.pop("label", None): return Label.create( # pyright: ignore[reportReturnType] CheckboxRoot.create( CheckboxIndicator.create(), *children, **props, ), label, class_name=cn(ClassNames.LABEL, class_name), ) return CheckboxRoot.create( CheckboxIndicator.create(), *children, **props, class_name=class_name, ) class CheckboxNamespace(ComponentNamespace): """Namespace for Checkbox components.""" root = staticmethod(CheckboxRoot.create)
high_level = staticmethod(HighLevelCheckbox.create) class_names = ClassNames __call__ = staticmethod(HighLevelCheckbox.create) checkbox = CheckboxNamespace()
indicator = staticmethod(CheckboxIndicator.create)
*children: The content of the checkbox. **props: Additional properties to apply to the checkbox component. Returns: The checkbox component and its indicator. """ class_name = props.pop("class_name", "") if label := props.pop("label", None): return Label.create( # pyright: ignore[reportReturnType] CheckboxRoot.create( CheckboxIndicator.create(), *children, **props, ), label, class_name=cn(ClassNames.LABEL, class_name), ) return CheckboxRoot.create( CheckboxIndicator.create(), *children, **props, class_name=class_name, ) class CheckboxNamespace(ComponentNamespace): """Namespace for Checkbox components.""" root = staticmethod(CheckboxRoot.create) indicator = staticmethod(CheckboxIndicator.create)
class_names = ClassNames __call__ = staticmethod(HighLevelCheckbox.create) checkbox = CheckboxNamespace()
high_level = staticmethod(HighLevelCheckbox.create)
**props: Additional properties to apply to the checkbox component. Returns: The checkbox component and its indicator. """ class_name = props.pop("class_name", "") if label := props.pop("label", None): return Label.create( # pyright: ignore[reportReturnType] CheckboxRoot.create( CheckboxIndicator.create(), *children, **props, ), label, class_name=cn(ClassNames.LABEL, class_name), ) return CheckboxRoot.create( CheckboxIndicator.create(), *children, **props, class_name=class_name, ) class CheckboxNamespace(ComponentNamespace): """Namespace for Checkbox components.""" root = staticmethod(CheckboxRoot.create) indicator = staticmethod(CheckboxIndicator.create) high_level = staticmethod(HighLevelCheckbox.create)
__call__ = staticmethod(HighLevelCheckbox.create) checkbox = CheckboxNamespace()
class_names = ClassNames