instruction stringlengths 0 1k | input stringlengths 1 1k | output stringlengths 10 6.51k |
|---|---|---|
"""Create the slider indicator component."""
props["data-slot"] = "slider-indicator"
cls.set_class_name(ClassNames.INDICATOR, props)
return super().create(*children, **props)
class SliderThumb(SliderBaseComponent):
"""The draggable part of the slider at the tip of the indicator. Ren... |
cls.set_class_name(ClassNames.THUMB, props)
return super().create(*children, **props)
class HighLevelSlider(SliderRoot):
"""High-level wrapper for the Slider component."""
@classmethod
def create(cls, **props) -> BaseUIComponent:
"""Create a complete slider component.
Ar... | props["data-slot"] = "slider-thumb" |
DICATOR, props)
return super().create(*children, **props)
class SliderThumb(SliderBaseComponent):
"""The draggable part of the slider at the tip of the indicator. Renders a div element."""
tag = "Slider.Thumb"
# Accepts a function which returns a string value that provides a user-friendly name f... |
class Slider(ComponentNamespace):
"""Namespace for Slider components."""
root = staticmethod(SliderRoot.create)
value = staticmethod(SliderValue.create)
control = staticmethod(SliderControl.create)
track = staticmethod(SliderTrack.create)
indicator = staticmethod(SliderIndicator.create)
... | class HighLevelSlider(SliderRoot):
"""High-level wrapper for the Slider component."""
@classmethod
def create(cls, **props) -> BaseUIComponent:
"""Create a complete slider component.
Args:
**props: Additional properties to apply to the slider component.
Returns:
... |
"""The draggable part of the slider at the tip of the indicator. Renders a div element."""
tag = "Slider.Thumb"
# Accepts a function which returns a string value that provides a user-friendly name for the input associated with the thumb.
get_aria_label: Var[str]
# Accepts a function which returns a s... |
class Slider(ComponentNamespace):
"""Namespace for Slider components."""
root = staticmethod(SliderRoot.create)
value = staticmethod(SliderValue.create)
control = staticmethod(SliderControl.create)
track = staticmethod(SliderTrack.create)
indicator = staticmethod(SliderIndicator.create)
... | def create(cls, **props) -> BaseUIComponent:
"""Create a complete slider component.
Args:
**props: Additional properties to apply to the slider component.
Returns:
The slider component.
"""
return SliderRoot.create(
SliderControl.create(
... |
hould ignore user interaction.
disabled: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the slider thumb component."""
props["data-slot"] = "slider-thumb"
cls.set_class_name(ClassNames.THUMB... |
slider = Slider()
| class Slider(ComponentNamespace):
"""Namespace for Slider components."""
root = staticmethod(SliderRoot.create)
value = staticmethod(SliderValue.create)
control = staticmethod(SliderControl.create)
track = staticmethod(SliderTrack.create)
indicator = staticmethod(SliderIndicator.create)
thu... |
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the slider thumb component."""
props["data-slot"] = "slider-thumb"
cls.set_class_name(ClassNames.THUMB, props)
return super().create(*children, **props)
class HighLevelSlider... |
value = staticmethod(SliderValue.create)
control = staticmethod(SliderControl.create)
track = staticmethod(SliderTrack.create)
indicator = staticmethod(SliderIndicator.create)
thumb = staticmethod(SliderThumb.create)
class_names = ClassNames
__call__ = staticmethod(HighLevelSlider.create)
... | root = staticmethod(SliderRoot.create) |
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the slider thumb component."""
props["data-slot"] = "slider-thumb"
cls.set_class_name(ClassNames.THUMB, props)
return super().create(*children, **props)
class HighLevelSlider(SliderRoot):
"""High-level wrapper for... |
control = staticmethod(SliderControl.create)
track = staticmethod(SliderTrack.create)
indicator = staticmethod(SliderIndicator.create)
thumb = staticmethod(SliderThumb.create)
class_names = ClassNames
__call__ = staticmethod(HighLevelSlider.create)
slider = Slider()
| value = staticmethod(SliderValue.create) |
eUIComponent:
"""Create the slider thumb component."""
props["data-slot"] = "slider-thumb"
cls.set_class_name(ClassNames.THUMB, props)
return super().create(*children, **props)
class HighLevelSlider(SliderRoot):
"""High-level wrapper for the Slider component."""
@classmethod
... |
track = staticmethod(SliderTrack.create)
indicator = staticmethod(SliderIndicator.create)
thumb = staticmethod(SliderThumb.create)
class_names = ClassNames
__call__ = staticmethod(HighLevelSlider.create)
slider = Slider()
| control = staticmethod(SliderControl.create) |
component."""
props["data-slot"] = "slider-thumb"
cls.set_class_name(ClassNames.THUMB, props)
return super().create(*children, **props)
class HighLevelSlider(SliderRoot):
"""High-level wrapper for the Slider component."""
@classmethod
def create(cls, **props) -> BaseUIComponent:
... |
indicator = staticmethod(SliderIndicator.create)
thumb = staticmethod(SliderThumb.create)
class_names = ClassNames
__call__ = staticmethod(HighLevelSlider.create)
slider = Slider()
| track = staticmethod(SliderTrack.create) |
lider-thumb"
cls.set_class_name(ClassNames.THUMB, props)
return super().create(*children, **props)
class HighLevelSlider(SliderRoot):
"""High-level wrapper for the Slider component."""
@classmethod
def create(cls, **props) -> BaseUIComponent:
"""Create a complete slider component.... |
thumb = staticmethod(SliderThumb.create)
class_names = ClassNames
__call__ = staticmethod(HighLevelSlider.create)
slider = Slider()
| indicator = staticmethod(SliderIndicator.create) |
UMB, props)
return super().create(*children, **props)
class HighLevelSlider(SliderRoot):
"""High-level wrapper for the Slider component."""
@classmethod
def create(cls, **props) -> BaseUIComponent:
"""Create a complete slider component.
Args:
**props: Additional prope... |
class_names = ClassNames
__call__ = staticmethod(HighLevelSlider.create)
slider = Slider()
| thumb = staticmethod(SliderThumb.create) |
ildren, **props)
class HighLevelSlider(SliderRoot):
"""High-level wrapper for the Slider component."""
@classmethod
def create(cls, **props) -> BaseUIComponent:
"""Create a complete slider component.
Args:
**props: Additional properties to apply to the slider component.
... |
__call__ = staticmethod(HighLevelSlider.create)
slider = Slider()
| class_names = ClassNames |
LevelSlider(SliderRoot):
"""High-level wrapper for the Slider component."""
@classmethod
def create(cls, **props) -> BaseUIComponent:
"""Create a complete slider component.
Args:
**props: Additional properties to apply to the slider component.
Returns:
The ... |
slider = Slider()
| __call__ = staticmethod(HighLevelSlider.create) |
for the Slider component."""
@classmethod
def create(cls, **props) -> BaseUIComponent:
"""Create a complete slider component.
Args:
**props: Additional properties to apply to the slider component.
Returns:
The slider component.
"""
return Slide... | slider = Slider() | |
"""Custom switch component."""
|
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
class ClassNames:
"""Class names for switch components."""
ROOT = "relative flex h-5 w-8 rounded-f... | from reflex.components.component import Component, ComponentNamespace |
"""Custom switch component."""
from reflex.components.component import Component, ComponentNamespace
|
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
class ClassNames:
"""Class names for switch components."""
ROOT = "relative flex h-5 w-8 rounded-full bg-secondary-4 p-0.5 transition-colors duration-200 ease-o... | from reflex.event import EventHandler, passthrough_event_spec |
"""Custom switch component."""
from reflex.components.component import Component, ComponentNamespace
from reflex.event import EventHandler, passthrough_event_spec
|
from reflex.vars.base import Var
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
class ClassNames:
"""Class names for switch components."""
ROOT = "relative flex h-5 w-8 rounded-full bg-secondary-4 p-0.5 transition-colors duration-200 ease-out before:absolute before:rounded-full befo... | from reflex.utils.imports import ImportVar |
"""Custom switch component."""
from reflex.components.component import Component, ComponentNamespace
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
|
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
class ClassNames:
"""Class names for switch components."""
ROOT = "relative flex h-5 w-8 rounded-full bg-secondary-4 p-0.5 transition-colors duration-200 ease-out before:absolute before:rounded-full before:outline-offset-2 before:outlin... | from reflex.vars.base import Var |
"""Custom switch component."""
from reflex.components.component import Component, ComponentNamespace
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var
|
class ClassNames:
"""Class names for switch components."""
ROOT = "relative flex h-5 w-8 rounded-full bg-secondary-4 p-0.5 transition-colors duration-200 ease-out before:absolute before:rounded-full before:outline-offset-2 before:outline-primary-8 focus-visible:before:inset-0 data-[checked]:bg-primary-9 dis... | from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent |
"""Custom switch component."""
from reflex.components.component import Component, 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
class ... |
THUMB = "aspect-square h-full rounded-full bg-white transition-transform duration-200 ease-out data-[checked]:translate-x-3 shadow-small"
class SwitchBaseComponent(BaseUIComponent):
"""Base component for switch components."""
library = f"{PACKAGE_NAME}/switch"
@property
def import_var(self):
... | ROOT = "relative flex h-5 w-8 rounded-full bg-secondary-4 p-0.5 transition-colors duration-200 ease-out before:absolute before:rounded-full before:outline-offset-2 before:outline-primary-8 focus-visible:before:inset-0 data-[checked]:bg-primary-9 disabled:opacity-50 disabled:cursor-not-allowed cursor-default" |
"""Custom switch component."""
from reflex.components.component import Component, 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
class ... |
class SwitchBaseComponent(BaseUIComponent):
"""Base component for switch components."""
library = f"{PACKAGE_NAME}/switch"
@property
def import_var(self):
"""Return the import variable for the switch component."""
return ImportVar(tag="Switch", package_path="", install=False)
clas... | THUMB = "aspect-square h-full rounded-full bg-white transition-transform duration-200 ease-out data-[checked]:translate-x-3 shadow-small" |
"""Custom switch component."""
from reflex.components.component import Component, 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
class ... |
class SwitchRoot(SwitchBaseComponent):
"""Represents the switch itself. Renders a button element and a hidden input beside."""
tag = "Switch.Root"
# Identifies the field when a form is submitted.
name: Var[str]
# Whether the switch is initially active. To render a controlled switch, use the ch... | class SwitchBaseComponent(BaseUIComponent):
"""Base component for switch components."""
library = f"{PACKAGE_NAME}/switch"
@property
def import_var(self):
"""Return the import variable for the switch component."""
return ImportVar(tag="Switch", package_path="", install=False) |
"""Custom switch component."""
from reflex.components.component import Component, 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
class ... |
@property
def import_var(self):
"""Return the import variable for the switch component."""
return ImportVar(tag="Switch", package_path="", install=False)
class SwitchRoot(SwitchBaseComponent):
"""Represents the switch itself. Renders a button element and a hidden input beside."""
ta... | library = f"{PACKAGE_NAME}/switch" |
"""Custom switch component."""
from reflex.components.component import Component, 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
class ... |
class SwitchRoot(SwitchBaseComponent):
"""Represents the switch itself. Renders a button element and a hidden input beside."""
tag = "Switch.Root"
# Identifies the field when a form is submitted.
name: Var[str]
# Whether the switch is initially active. To render a controlled switch, use the ch... | def import_var(self):
"""Return the import variable for the switch component."""
return ImportVar(tag="Switch", package_path="", install=False) |
KAGE_NAME, BaseUIComponent
class ClassNames:
"""Class names for switch components."""
ROOT = "relative flex h-5 w-8 rounded-full bg-secondary-4 p-0.5 transition-colors duration-200 ease-out before:absolute before:rounded-full before:outline-offset-2 before:outline-primary-8 focus-visible:before:inset-0 data-... |
# Identifies the field when a form is submitted.
name: Var[str]
# Whether the switch is initially active. To render a controlled switch, use the checked prop instead. Defaults to False.
default_checked: Var[bool]
# Whether the switch is currently active. To render an uncontrolled switch, use the... | tag = "Switch.Root" |
Var[bool]
# Whether the switch is currently active. To render an uncontrolled switch, use the default_checked prop instead.
checked: Var[bool]
# Event handler called when the switch is activated or deactivated.
on_checked_change: EventHandler[passthrough_event_spec(bool)]
# Whether the component ... |
class SwitchThumb(SwitchBaseComponent):
"""The movable part of the switch that indicates whether the switch is on or off. Renders a span."""
tag = "Switch.Thumb"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create... | def create(cls, *children, **props) -> BaseUIComponent:
"""Create the switch root component."""
props["data-slot"] = "switch"
cls.set_class_name(ClassNames.ROOT, props)
return super().create(*children, **props) |
ed prop instead.
checked: Var[bool]
# Event handler called when the switch is activated or deactivated.
on_checked_change: EventHandler[passthrough_event_spec(bool)]
# Whether the component renders a native <button> element when replacing it via the render prop. Set to false if the rendered element is... |
cls.set_class_name(ClassNames.ROOT, props)
return super().create(*children, **props)
class SwitchThumb(SwitchBaseComponent):
"""The movable part of the switch that indicates whether the switch is on or off. Renders a span."""
tag = "Switch.Thumb"
# The render prop
render_: Var[Compo... | props["data-slot"] = "switch" |
t to false if the rendered element is not a button (e.g. <div>). Defaults to True.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# Whether the user should be unable to activate or deactivate the switch. Defaults to False.
re... |
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the switch thumb component."""
props["data-slot"] = "switch-thumb"
cls.set_class_name(ClassNames.THUMB, props)
return super().create(*children, **pr... | tag = "Switch.Thumb" |
button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# Whether the user should be unable to activate or deactivate the switch. Defaults to False.
read_only: Var[bool]
# Whether the user must activate the switch before submitting a form. ... |
class HighLevelSwitch(SwitchRoot):
"""High-level wrapper for the Switch component."""
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create a complete switch component.
Args:
*children: Additional children to include in the switch.
**prop... | def create(cls, *children, **props) -> BaseUIComponent:
"""Create the switch thumb component."""
props["data-slot"] = "switch-thumb"
cls.set_class_name(ClassNames.THUMB, props)
return super().create(*children, **props) |
ar[bool]
# Whether the user should be unable to activate or deactivate the switch. Defaults to False.
read_only: Var[bool]
# Whether the user must activate the switch before submitting a form. Defaults to False.
required: Var[bool]
# A ref to access the hidden <input> element.
input_ref: Var[... |
cls.set_class_name(ClassNames.THUMB, props)
return super().create(*children, **props)
class HighLevelSwitch(SwitchRoot):
"""High-level wrapper for the Switch component."""
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create a complete switch component.
... | props["data-slot"] = "switch-thumb" |
"
tag = "Switch.Thumb"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the switch thumb component."""
props["data-slot"] = "switch-thumb"
cls.set_class_name(ClassNames.THUMB, props)
return sup... |
thumb = staticmethod(SwitchThumb.create)
class_names = ClassNames
__call__ = staticmethod(HighLevelSwitch.create)
switch = Switch()
| root = staticmethod(SwitchRoot.create) |
ssmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the switch thumb component."""
props["data-slot"] = "switch-thumb"
cls.set_class_name(ClassNames.THUMB, props)
return super().create(*children, **props)
class HighLevelSwitch(SwitchRoot):
"""High-level w... |
__call__ = staticmethod(HighLevelSwitch.create)
switch = Switch()
| class_names = ClassNames |
*children, **props) -> BaseUIComponent:
"""Create the switch thumb component."""
props["data-slot"] = "switch-thumb"
cls.set_class_name(ClassNames.THUMB, props)
return super().create(*children, **props)
class HighLevelSwitch(SwitchRoot):
"""High-level wrapper for the Switch compone... |
switch = Switch()
| __call__ = staticmethod(HighLevelSwitch.create) |
"Create the switch thumb component."""
props["data-slot"] = "switch-thumb"
cls.set_class_name(ClassNames.THUMB, props)
return super().create(*children, **props)
class HighLevelSwitch(SwitchRoot):
"""High-level wrapper for the Switch component."""
@classmethod
def create(cls, *chil... | switch = Switch() | |
"""Custom tabs component."""
|
from reflex.components.component import Component, 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
LiteralOrientation = Literal["horizon... | from typing import Literal |
"""Custom tabs component."""
from typing import Literal
|
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
LiteralOrientation = Literal["horizontal", "vertical"]
class ClassNames:
"""Class names for tabs compo... | from reflex.components.component import Component, ComponentNamespace |
"""Custom tabs component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
|
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
LiteralOrientation = Literal["horizontal", "vertical"]
class ClassNames:
"""Class names for tabs components."""
ROOT = "flex flex-col gap-2"
LIST = "bg-sec... | from reflex.event import EventHandler, passthrough_event_spec |
"""Custom tabs component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.event import EventHandler, passthrough_event_spec
|
from reflex.vars.base import Var
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
LiteralOrientation = Literal["horizontal", "vertical"]
class ClassNames:
"""Class names for tabs components."""
ROOT = "flex flex-col gap-2"
LIST = "bg-secondary-3 inline-flex gap-1 p-1 items-center... | from reflex.utils.imports import ImportVar |
"""Custom tabs component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
|
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
LiteralOrientation = Literal["horizontal", "vertical"]
class ClassNames:
"""Class names for tabs components."""
ROOT = "flex flex-col gap-2"
LIST = "bg-secondary-3 inline-flex gap-1 p-1 items-center justify-start rounded-ui-md rela... | from reflex.vars.base import Var |
"""Custom tabs component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var
|
LiteralOrientation = Literal["horizontal", "vertical"]
class ClassNames:
"""Class names for tabs components."""
ROOT = "flex flex-col gap-2"
LIST = "bg-secondary-3 inline-flex gap-1 p-1 items-center justify-start rounded-ui-md relative z-0"
TAB = "h-7 px-1.5 rounded-ui-sm justify-center items-cente... | from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent |
"""Custom tabs component."""
from typing import Literal
from reflex.components.component import Component, 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... |
class ClassNames:
"""Class names for tabs components."""
ROOT = "flex flex-col gap-2"
LIST = "bg-secondary-3 inline-flex gap-1 p-1 items-center justify-start rounded-ui-md relative z-0"
TAB = "h-7 px-1.5 rounded-ui-sm justify-center items-center gap-1.5 inline-flex text-sm font-medium text-secondary... | LiteralOrientation = Literal["horizontal", "vertical"] |
"""Custom tabs component."""
from typing import Literal
from reflex.components.component import Component, 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... |
LIST = "bg-secondary-3 inline-flex gap-1 p-1 items-center justify-start rounded-ui-md relative z-0"
TAB = "h-7 px-1.5 rounded-ui-sm justify-center items-center gap-1.5 inline-flex text-sm font-medium text-secondary-11 cursor-pointer z-[1] hover:text-secondary-12 transition-color text-nowrap data-[selected]:tex... | ROOT = "flex flex-col gap-2" |
"""Custom tabs component."""
from typing import Literal
from reflex.components.component import Component, 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... |
TAB = "h-7 px-1.5 rounded-ui-sm justify-center items-center gap-1.5 inline-flex text-sm font-medium text-secondary-11 cursor-pointer z-[1] hover:text-secondary-12 transition-color text-nowrap data-[selected]:text-secondary-12 data-[disabled]:cursor-not-allowed data-[disabled]:text-secondary-8"
INDICATOR = "abs... | LIST = "bg-secondary-3 inline-flex gap-1 p-1 items-center justify-start rounded-ui-md relative z-0" |
"""Custom tabs component."""
from typing import Literal
from reflex.components.component import Component, 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... |
INDICATOR = "absolute top-1/2 left-0 -z-1 h-7 w-(--active-tab-width) -translate-y-1/2 translate-x-(--active-tab-left) rounded-ui-sm bg-secondary-1 shadow-small transition-all duration-200 ease-in-out"
PANEL = "flex flex-col gap-2"
class TabsBaseComponent(BaseUIComponent):
"""Base component for tabs compo... | TAB = "h-7 px-1.5 rounded-ui-sm justify-center items-center gap-1.5 inline-flex text-sm font-medium text-secondary-11 cursor-pointer z-[1] hover:text-secondary-12 transition-color text-nowrap data-[selected]:text-secondary-12 data-[disabled]:cursor-not-allowed data-[disabled]:text-secondary-8" |
"""Custom tabs component."""
from typing import Literal
from reflex.components.component import Component, 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... |
PANEL = "flex flex-col gap-2"
class TabsBaseComponent(BaseUIComponent):
"""Base component for tabs components."""
library = f"{PACKAGE_NAME}/tabs"
@property
def import_var(self):
"""Return the import variable for the tabs component."""
return ImportVar(tag="Tabs", package_path="... | INDICATOR = "absolute top-1/2 left-0 -z-1 h-7 w-(--active-tab-width) -translate-y-1/2 translate-x-(--active-tab-left) rounded-ui-sm bg-secondary-1 shadow-small transition-all duration-200 ease-in-out" |
nent, 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
LiteralOrientation = Literal["horizontal", "vertical"]
class ClassNames:
"""Cl... |
class TabsBaseComponent(BaseUIComponent):
"""Base component for tabs components."""
library = f"{PACKAGE_NAME}/tabs"
@property
def import_var(self):
"""Return the import variable for the tabs component."""
return ImportVar(tag="Tabs", package_path="", install=False)
class TabsRoot... | PANEL = "flex flex-col gap-2" |
flex.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
LiteralOrientation = Literal["horizontal", "vertical"]
class ClassNames:
"""Class names for tabs components.""... |
class TabsRoot(TabsBaseComponent):
"""Groups the tabs and the corresponding panels. Renders a <div> element."""
tag = "Tabs.Root"
# The default value. Use when the component is not controlled. When the value is null, no Tab will be selected. Defaults to 0.
default_value: Var[str | int]
# The v... | class TabsBaseComponent(BaseUIComponent):
"""Base component for tabs components."""
library = f"{PACKAGE_NAME}/tabs"
@property
def import_var(self):
"""Return the import variable for the tabs component."""
return ImportVar(tag="Tabs", package_path="", install=False) |
tVar
from reflex.vars.base import Var
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
LiteralOrientation = Literal["horizontal", "vertical"]
class ClassNames:
"""Class names for tabs components."""
ROOT = "flex flex-col gap-2"
LIST = "bg-secondary-3 inline-flex gap-1 p-1 items-ce... |
@property
def import_var(self):
"""Return the import variable for the tabs component."""
return ImportVar(tag="Tabs", package_path="", install=False)
class TabsRoot(TabsBaseComponent):
"""Groups the tabs and the corresponding panels. Renders a <div> element."""
tag = "Tabs.Root"
... | library = f"{PACKAGE_NAME}/tabs" |
i.components.base_ui import PACKAGE_NAME, BaseUIComponent
LiteralOrientation = Literal["horizontal", "vertical"]
class ClassNames:
"""Class names for tabs components."""
ROOT = "flex flex-col gap-2"
LIST = "bg-secondary-3 inline-flex gap-1 p-1 items-center justify-start rounded-ui-md relative z-0"
T... |
class TabsRoot(TabsBaseComponent):
"""Groups the tabs and the corresponding panels. Renders a <div> element."""
tag = "Tabs.Root"
# The default value. Use when the component is not controlled. When the value is null, no Tab will be selected. Defaults to 0.
default_value: Var[str | int]
# The v... | def import_var(self):
"""Return the import variable for the tabs component."""
return ImportVar(tag="Tabs", package_path="", install=False) |
y-start rounded-ui-md relative z-0"
TAB = "h-7 px-1.5 rounded-ui-sm justify-center items-center gap-1.5 inline-flex text-sm font-medium text-secondary-11 cursor-pointer z-[1] hover:text-secondary-12 transition-color text-nowrap data-[selected]:text-secondary-12 data-[disabled]:cursor-not-allowed data-[disabled]:tex... |
# The default value. Use when the component is not controlled. When the value is null, no Tab will be selected. Defaults to 0.
default_value: Var[str | int]
# The value of the currently selected Tab. Use when the component is controlled. When the value is null, no Tab will be selected.
value: Var[str... | tag = "Tabs.Root" |
library = f"{PACKAGE_NAME}/tabs"
@property
def import_var(self):
"""Return the import variable for the tabs component."""
return ImportVar(tag="Tabs", package_path="", install=False)
class TabsRoot(TabsBaseComponent):
"""Groups the tabs and the corresponding panels. Renders a <div> ele... |
class TabsList(TabsBaseComponent):
"""Groups the individual tab buttons. Renders a <div> element."""
tag = "Tabs.List"
# Whether to automatically change the active tab on arrow key focus. Otherwise, tabs will be activated using Enter or Spacebar key press. Defaults to True.
activate_on_focus: Var[b... | def create(cls, *children, **props) -> BaseUIComponent:
"""Create the tabs root component."""
props["data-slot"] = "tabs"
cls.set_class_name(ClassNames.ROOT, props)
return super().create(*children, **props) |
able for the tabs component."""
return ImportVar(tag="Tabs", package_path="", install=False)
class TabsRoot(TabsBaseComponent):
"""Groups the tabs and the corresponding panels. Renders a <div> element."""
tag = "Tabs.Root"
# The default value. Use when the component is not controlled. When the v... |
cls.set_class_name(ClassNames.ROOT, props)
return super().create(*children, **props)
class TabsList(TabsBaseComponent):
"""Groups the individual tab buttons. Renders a <div> element."""
tag = "Tabs.List"
# Whether to automatically change the active tab on arrow key focus. Otherwise, tab... | props["data-slot"] = "tabs" |
# The default value. Use when the component is not controlled. When the value is null, no Tab will be selected. Defaults to 0.
default_value: Var[str | int]
# The value of the currently selected Tab. Use when the component is controlled. When the value is null, no Tab will be selected.
value: Var[str... |
# Whether to automatically change the active tab on arrow key focus. Otherwise, tabs will be activated using Enter or Spacebar key press. Defaults to True.
activate_on_focus: Var[bool]
# Whether to loop keyboard focus back to the first item when the end of the list is reached while using the arrow keys. ... | tag = "Tabs.List" |
nge: EventHandler[passthrough_event_spec(str | dict)]
# The component orientation (layout flow direction). Defaults to "horizontal".
orientation: Var[LiteralOrientation]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""C... |
class TabsTab(TabsBaseComponent):
"""An individual interactive tab button that toggles the corresponding panel. Renders a <button> element."""
tag = "Tabs.Tab"
# The value of the Tab. When not specified, the value is the child position index.
value: Var[str | int]
# Whether the component rende... | def create(cls, *children, **props) -> BaseUIComponent:
"""Create the tabs list component."""
props["data-slot"] = "tabs-list"
cls.set_class_name(ClassNames.LIST, props)
return super().create(*children, **props) |
. Defaults to "horizontal".
orientation: Var[LiteralOrientation]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the tabs root component."""
props["data-slot"] = "tabs"
cls.set_class_name(ClassNames.RO... |
cls.set_class_name(ClassNames.LIST, props)
return super().create(*children, **props)
class TabsTab(TabsBaseComponent):
"""An individual interactive tab button that toggles the corresponding panel. Renders a <button> element."""
tag = "Tabs.Tab"
# The value of the Tab. When not specified... | props["data-slot"] = "tabs-list" |
cls.set_class_name(ClassNames.ROOT, props)
return super().create(*children, **props)
class TabsList(TabsBaseComponent):
"""Groups the individual tab buttons. Renders a <div> element."""
tag = "Tabs.List"
# Whether to automatically change the active tab on arrow key focus. Otherwise, tabs will be... |
# The value of the Tab. When not specified, the value is the child position index.
value: Var[str | int]
# 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:... | tag = "Tabs.Tab" |
focus back to the first item when the end of the list is reached while using the arrow keys. Defaults to True.
loop: Var[bool]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the tabs list component."""
props["data-slot"] = "tabs-list"
cls.set_class_n... |
class TabsIndicator(TabsBaseComponent):
"""A visual indicator that can be styled to match the position of the currently active tab. Renders a <span> element."""
tag = "Tabs.Indicator"
# Whether to render itself before React hydrates. This minimizes the time that the indicator isn't visible after server... | def create(cls, *children, **props) -> BaseUIComponent:
"""Create the tabs tab component."""
props["data-slot"] = "tabs-tab"
cls.set_class_name(ClassNames.TAB, props)
return super().create(*children, **props) |
e.
loop: Var[bool]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the tabs list component."""
props["data-slot"] = "tabs-list"
cls.set_class_name(ClassNames.LIST, props)
return super().create(*children, **props)
class TabsTab(TabsBaseCompone... |
cls.set_class_name(ClassNames.TAB, props)
return super().create(*children, **props)
class TabsIndicator(TabsBaseComponent):
"""A visual indicator that can be styled to match the position of the currently active tab. Renders a <span> element."""
tag = "Tabs.Indicator"
# Whether to render... | props["data-slot"] = "tabs-tab" |
(TabsBaseComponent):
"""An individual interactive tab button that toggles the corresponding panel. Renders a <button> element."""
tag = "Tabs.Tab"
# The value of the Tab. When not specified, the value is the child position index.
value: Var[str | int]
# Whether the component renders a native <but... |
# Whether to render itself before React hydrates. This minimizes the time that the indicator isn't visible after server-side rendering. Defaults to False.
render_before_hydration: Var[bool]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the tabs indicator compo... | tag = "Tabs.Indicator" |
value: Var[str | int]
# 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 Tab is disabled. Defaults to false.
disabled: Var[bool]... |
class TabsPanel(TabsBaseComponent):
"""A panel displayed when the corresponding tab is active. Renders a <div> element."""
tag = "Tabs.Panel"
# The value of the TabPanel. It will be shown when the Tab with the corresponding value is selected. If not provided, it will fall back to the index of the panel... | def create(cls, *children, **props) -> BaseUIComponent:
"""Create the tabs indicator component."""
props["data-slot"] = "tabs-indicator"
cls.set_class_name(ClassNames.INDICATOR, props)
return super().create(*children, **props) |
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 Tab is disabled. Defaults to false.
disabled: Var[bool]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the tabs tab compo... |
cls.set_class_name(ClassNames.INDICATOR, props)
return super().create(*children, **props)
class TabsPanel(TabsBaseComponent):
"""A panel displayed when the corresponding tab is active. Renders a <div> element."""
tag = "Tabs.Panel"
# The value of the TabPanel. It will be shown when the ... | props["data-slot"] = "tabs-indicator" |
nent:
"""Create the tabs tab component."""
props["data-slot"] = "tabs-tab"
cls.set_class_name(ClassNames.TAB, props)
return super().create(*children, **props)
class TabsIndicator(TabsBaseComponent):
"""A visual indicator that can be styled to match the position of the currently act... |
# The value of the TabPanel. It will be shown when the Tab with the corresponding value is selected. If not provided, it will fall back to the index of the panel. It is recommended to explicitly provide it, as it's required for the tab panel to be rendered on the server.
value: Var[str | int]
# Whether t... | tag = "Tabs.Panel" |
the indicator isn't visible after server-side rendering. Defaults to False.
render_before_hydration: Var[bool]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the tabs indicator component."""
props["data-slot"] = "tabs-indicator"
cls.set_class_name(Cl... |
class Tabs(ComponentNamespace):
"""Namespace for Tabs components."""
root = __call__ = staticmethod(TabsRoot.create)
list = staticmethod(TabsList.create)
tab = staticmethod(TabsTab.create)
panel = staticmethod(TabsPanel.create)
indicator = staticmethod(TabsIndicator.create)
class_names =... | def create(cls, *children, **props) -> BaseUIComponent:
"""Create the tabs panel component."""
props["data-slot"] = "tabs-panel"
cls.set_class_name(ClassNames.PANEL, props)
return super().create(*children, **props) |
ool]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the tabs indicator component."""
props["data-slot"] = "tabs-indicator"
cls.set_class_name(ClassNames.INDICATOR, props)
return super().create(*children, **props)
class TabsPanel(TabsBaseComponen... |
cls.set_class_name(ClassNames.PANEL, props)
return super().create(*children, **props)
class Tabs(ComponentNamespace):
"""Namespace for Tabs components."""
root = __call__ = staticmethod(TabsRoot.create)
list = staticmethod(TabsList.create)
tab = staticmethod(TabsTab.create)
panel... | props["data-slot"] = "tabs-panel" |
props["data-slot"] = "tabs-indicator"
cls.set_class_name(ClassNames.INDICATOR, props)
return super().create(*children, **props)
class TabsPanel(TabsBaseComponent):
"""A panel displayed when the corresponding tab is active. Renders a <div> element."""
tag = "Tabs.Panel"
# The value of... |
tabs = Tabs()
| class Tabs(ComponentNamespace):
"""Namespace for Tabs components."""
root = __call__ = staticmethod(TabsRoot.create)
list = staticmethod(TabsList.create)
tab = staticmethod(TabsTab.create)
panel = staticmethod(TabsPanel.create)
indicator = staticmethod(TabsIndicator.create)
class_names = Cl... |
s.INDICATOR, props)
return super().create(*children, **props)
class TabsPanel(TabsBaseComponent):
"""A panel displayed when the corresponding tab is active. Renders a <div> element."""
tag = "Tabs.Panel"
# The value of the TabPanel. It will be shown when the Tab with the corresponding value is s... |
list = staticmethod(TabsList.create)
tab = staticmethod(TabsTab.create)
panel = staticmethod(TabsPanel.create)
indicator = staticmethod(TabsIndicator.create)
class_names = ClassNames
tabs = Tabs()
| root = __call__ = staticmethod(TabsRoot.create) |
hildren, **props)
class TabsPanel(TabsBaseComponent):
"""A panel displayed when the corresponding tab is active. Renders a <div> element."""
tag = "Tabs.Panel"
# The value of the TabPanel. It will be shown when the Tab with the corresponding value is selected. If not provided, it will fall back to the i... |
tab = staticmethod(TabsTab.create)
panel = staticmethod(TabsPanel.create)
indicator = staticmethod(TabsIndicator.create)
class_names = ClassNames
tabs = Tabs()
| list = staticmethod(TabsList.create) |
aseComponent):
"""A panel displayed when the corresponding tab is active. Renders a <div> element."""
tag = "Tabs.Panel"
# The value of the TabPanel. It will be shown when the Tab with the corresponding value is selected. If not provided, it will fall back to the index of the panel. It is recommended to e... |
panel = staticmethod(TabsPanel.create)
indicator = staticmethod(TabsIndicator.create)
class_names = ClassNames
tabs = Tabs()
| tab = staticmethod(TabsTab.create) |
when the corresponding tab is active. Renders a <div> element."""
tag = "Tabs.Panel"
# The value of the TabPanel. It will be shown when the Tab with the corresponding value is selected. If not provided, it will fall back to the index of the panel. It is recommended to explicitly provide it, as it's required ... |
indicator = staticmethod(TabsIndicator.create)
class_names = ClassNames
tabs = Tabs()
| panel = staticmethod(TabsPanel.create) |
ers a <div> element."""
tag = "Tabs.Panel"
# The value of the TabPanel. It will be shown when the Tab with the corresponding value is selected. If not provided, it will fall back to the index of the panel. It is recommended to explicitly provide it, as it's required for the tab panel to be rendered on the ser... |
class_names = ClassNames
tabs = Tabs()
| indicator = staticmethod(TabsIndicator.create) |
# The value of the TabPanel. It will be shown when the Tab with the corresponding value is selected. If not provided, it will fall back to the index of the panel. It is recommended to explicitly provide it, as it's required for the tab panel to be rendered on the server.
value: Var[str | int]
# Whether to ke... |
tabs = Tabs()
| class_names = ClassNames |
el. It will be shown when the Tab with the corresponding value is selected. If not provided, it will fall back to the index of the panel. It is recommended to explicitly provide it, as it's required for the tab panel to be rendered on the server.
value: Var[str | int]
# Whether to keep the HTML element in the ... | tabs = Tabs() | |
"""Custom Textarea component."""
|
from reflex.components.el import Textarea as TextareaComponent
from reflex_ui.components.component import CoreComponent
class ClassNames:
"""Class names for textarea components."""
ROOT = "focus:shadow-[0px_0px_0px_2px_var(--primary-4)] focus:border-primary-7 focus:hover:border-primary-7 bg-secondary-1 bor... | from reflex.components.component import Component |
"""Custom Textarea component."""
from reflex.components.component import Component
|
from reflex_ui.components.component import CoreComponent
class ClassNames:
"""Class names for textarea components."""
ROOT = "focus:shadow-[0px_0px_0px_2px_var(--primary-4)] focus:border-primary-7 focus:hover:border-primary-7 bg-secondary-1 border border-secondary-a4 hover:border-secondary-a6 transition-[c... | from reflex.components.el import Textarea as TextareaComponent |
"""Custom Textarea component."""
from reflex.components.component import Component
from reflex.components.el import Textarea as TextareaComponent
|
class ClassNames:
"""Class names for textarea components."""
ROOT = "focus:shadow-[0px_0px_0px_2px_var(--primary-4)] focus:border-primary-7 focus:hover:border-primary-7 bg-secondary-1 border border-secondary-a4 hover:border-secondary-a6 transition-[color,box-shadow] disabled:border-secondary-4 disabled:bg-s... | from reflex_ui.components.component import CoreComponent |
ROOT = "focus:shadow-[0px_0px_0px_2px_var(--primary-4)] focus:border-primary-7 focus:hover:border-primary-7 bg-secondary-1 border border-secondary-a4 hover:border-secondary-a6 transition-[color,box-shadow] disabled:border-secondary-4 disabled:bg-secondary-3 disabled:text-secondary-8 disabled:cursor-not-allowed cu... |
cls.set_class_name(ClassNames.ROOT, props)
return super().create(*children, **props)
textarea = Textarea.create
| props["data-slot"] = "textarea" |
border-secondary-a4 hover:border-secondary-a6 transition-[color,box-shadow] disabled:border-secondary-4 disabled:bg-secondary-3 disabled:text-secondary-8 disabled:cursor-not-allowed cursor-text min-h-24 rounded-ui-md text-secondary-12 placeholder:text-secondary-9 text-sm disabled:placeholder:text-secondary-8 w-full ou... | textarea = Textarea.create | |
"""Theme switcher component."""
|
from reflex.components.core.cond import cond
from reflex.components.el import Button, Div
from reflex.style import LiteralColorMode, color_mode, set_color_mode
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.utils.twmerge import cn
def theme_switcher_item(mode: LiteralColorMode, icon: str) -> Comp... | from reflex.components.component import Component, memo |
"""Theme switcher component."""
from reflex.components.component import Component, memo
|
from reflex.components.el import Button, Div
from reflex.style import LiteralColorMode, color_mode, set_color_mode
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.utils.twmerge import cn
def theme_switcher_item(mode: LiteralColorMode, icon: str) -> Component:
"""Create a theme switcher item bu... | from reflex.components.core.cond import cond |
"""Theme switcher component."""
from reflex.components.component import Component, memo
from reflex.components.core.cond import cond
|
from reflex.style import LiteralColorMode, color_mode, set_color_mode
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.utils.twmerge import cn
def theme_switcher_item(mode: LiteralColorMode, icon: str) -> Component:
"""Create a theme switcher item button for a specific mode."""
active_cn = ... | from reflex.components.el import Button, Div |
"""Theme switcher component."""
from reflex.components.component import Component, memo
from reflex.components.core.cond import cond
from reflex.components.el import Button, Div
|
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.utils.twmerge import cn
def theme_switcher_item(mode: LiteralColorMode, icon: str) -> Component:
"""Create a theme switcher item button for a specific mode."""
active_cn = "text-secondary-11 shadow-small bg-secondary-1"
unactive_cn = "hov... | from reflex.style import LiteralColorMode, color_mode, set_color_mode |
"""Theme switcher component."""
from reflex.components.component import Component, memo
from reflex.components.core.cond import cond
from reflex.components.el import Button, Div
from reflex.style import LiteralColorMode, color_mode, set_color_mode
|
from reflex_ui.utils.twmerge import cn
def theme_switcher_item(mode: LiteralColorMode, icon: str) -> Component:
"""Create a theme switcher item button for a specific mode."""
active_cn = "text-secondary-11 shadow-small bg-secondary-1"
unactive_cn = "hover:text-secondary-11 text-secondary-9"
return Bu... | from reflex_ui.components.icons.hugeicon import hi |
"""Theme switcher component."""
from reflex.components.component import Component, memo
from reflex.components.core.cond import cond
from reflex.components.el import Button, Div
from reflex.style import LiteralColorMode, color_mode, set_color_mode
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.util... |
unactive_cn = "hover:text-secondary-11 text-secondary-9"
return Button.create(
hi(icon, class_name="shrink-0", size=14),
on_click=set_color_mode(mode),
class_name=(
"flex items-center cursor-pointer justify-center rounded-ui-xs transition-color size-6",
cond(mode... | active_cn = "text-secondary-11 shadow-small bg-secondary-1" |
"""Theme switcher component."""
from reflex.components.component import Component, memo
from reflex.components.core.cond import cond
from reflex.components.el import Button, Div
from reflex.style import LiteralColorMode, color_mode, set_color_mode
from reflex_ui.components.icons.hugeicon import hi
from reflex_ui.util... |
return Button.create(
hi(icon, class_name="shrink-0", size=14),
on_click=set_color_mode(mode),
class_name=(
"flex items-center cursor-pointer justify-center rounded-ui-xs transition-color size-6",
cond(mode == color_mode, active_cn, unactive_cn),
),
a... | unactive_cn = "hover:text-secondary-11 text-secondary-9" |
"""Custom toggle component."""
|
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
class ClassNames:
"""Class names for toggle components."""
ROOT = "flex size-8 items-center justif... | from reflex.components.component import Component |
"""Custom toggle component."""
from reflex.components.component import Component
|
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
class ClassNames:
"""Class names for toggle components."""
ROOT = "flex size-8 items-center justify-center rounded-ui-sm text-secondary-11 select-none hover:bg-... | from reflex.event import EventHandler, passthrough_event_spec |
"""Custom toggle component."""
from reflex.components.component import Component
from reflex.event import EventHandler, passthrough_event_spec
|
from reflex.vars.base import Var
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
class ClassNames:
"""Class names for toggle components."""
ROOT = "flex size-8 items-center justify-center rounded-ui-sm text-secondary-11 select-none hover:bg-secondary-3 focus-visible:bg-none active:bg... | from reflex.utils.imports import ImportVar |
"""Custom toggle component."""
from reflex.components.component import Component
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
|
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
class ClassNames:
"""Class names for toggle components."""
ROOT = "flex size-8 items-center justify-center rounded-ui-sm text-secondary-11 select-none hover:bg-secondary-3 focus-visible:bg-none active:bg-secondary-4 data-[pressed]:text-... | from reflex.vars.base import Var |
"""Custom toggle component."""
from reflex.components.component import Component
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var
|
class ClassNames:
"""Class names for toggle components."""
ROOT = "flex size-8 items-center justify-center rounded-ui-sm text-secondary-11 select-none hover:bg-secondary-3 focus-visible:bg-none active:bg-secondary-4 data-[pressed]:text-secondary-12 data-[pressed]:bg-secondary-4 transition-colors"
class To... | from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent |
"""Custom toggle component."""
from reflex.components.component import Component
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
class ClassNames:
"""C... |
@property
def import_var(self):
"""Return the import variable for the toggle component."""
return ImportVar(tag="Toggle", package_path="", install=False)
class Toggle(ToggleBaseComponent):
"""A two-state button that can be on or off. Renders a <button> element."""
tag = "Toggle"
... | library = f"{PACKAGE_NAME}/toggle" |
"""Custom toggle component."""
from reflex.components.component import Component
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
class ClassNames:
"""C... |
class Toggle(ToggleBaseComponent):
"""A two-state button that can be on or off. Renders a <button> element."""
tag = "Toggle"
# A unique string that identifies the toggle when used inside a toggle group.
value: Var[str]
# Whether the toggle button is currently pressed. This is the uncontrolled... | def import_var(self):
"""Return the import variable for the toggle component."""
return ImportVar(tag="Toggle", package_path="", install=False) |
reflex.components.component import Component
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
class ClassNames:
"""Class names for toggle components."""... |
# A unique string that identifies the toggle when used inside a toggle group.
value: Var[str]
# Whether the toggle button is currently pressed. This is the uncontrolled counterpart of pressed. Defaults to False.
default_pressed: Var[bool]
# Whether the toggle button is currently pressed. This is... | tag = "Toggle" |
ing that identifies the toggle when used inside a toggle group.
value: Var[str]
# Whether the toggle button is currently pressed. This is the uncontrolled counterpart of pressed. Defaults to False.
default_pressed: Var[bool]
# Whether the toggle button is currently pressed. This is the controlled coun... |
cls.set_class_name(ClassNames.ROOT, props)
return super().create(*children, **props)
toggle = Toggle.create
| props["data-slot"] = "toggle" |
ssed. This is the uncontrolled counterpart of pressed. Defaults to False.
default_pressed: Var[bool]
# Whether the toggle button is currently pressed. This is the controlled counterpart of default_pressed.
pressed: Var[bool]
# Callback fired when the pressed state is changed.
on_pressed_change: Ev... | toggle = Toggle.create | |
"""Custom toggle group component."""
|
from reflex.components.component import Component
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
LiteralOrientation = Literal["horizontal", "vertical"]
... | from typing import Literal |
"""Custom toggle group component."""
from typing import Literal
|
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
LiteralOrientation = Literal["horizontal", "vertical"]
class ClassNames:
"""Class names for toggle gro... | from reflex.components.component import Component |
"""Custom toggle group component."""
from typing import Literal
from reflex.components.component import Component
|
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
LiteralOrientation = Literal["horizontal", "vertical"]
class ClassNames:
"""Class names for toggle group components."""
ROOT = "inline-flex items-center gap-1 ... | from reflex.event import EventHandler, passthrough_event_spec |
"""Custom toggle group component."""
from typing import Literal
from reflex.components.component import Component
from reflex.event import EventHandler, passthrough_event_spec
|
from reflex.vars.base import Var
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
LiteralOrientation = Literal["horizontal", "vertical"]
class ClassNames:
"""Class names for toggle group components."""
ROOT = "inline-flex items-center gap-1 p-1 rounded-ui-md bg-secondary-3 data-[orie... | from reflex.utils.imports import ImportVar |
"""Custom toggle group component."""
from typing import Literal
from reflex.components.component import Component
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
|
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
LiteralOrientation = Literal["horizontal", "vertical"]
class ClassNames:
"""Class names for toggle group components."""
ROOT = "inline-flex items-center gap-1 p-1 rounded-ui-md bg-secondary-3 data-[orientation=vertical]:flex-col data-[... | from reflex.vars.base import Var |
"""Custom toggle group component."""
from typing import Literal
from reflex.components.component import Component
from reflex.event import EventHandler, passthrough_event_spec
from reflex.utils.imports import ImportVar
from reflex.vars.base import Var
|
LiteralOrientation = Literal["horizontal", "vertical"]
class ClassNames:
"""Class names for toggle group components."""
ROOT = "inline-flex items-center gap-1 p-1 rounded-ui-md bg-secondary-3 data-[orientation=vertical]:flex-col data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed"
class ToggleG... | from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent |
"""Custom toggle group component."""
from typing import Literal
from reflex.components.component import Component
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, BaseUIComp... |
class ClassNames:
"""Class names for toggle group components."""
ROOT = "inline-flex items-center gap-1 p-1 rounded-ui-md bg-secondary-3 data-[orientation=vertical]:flex-col data-[disabled]:opacity-50 data-[disabled]:cursor-not-allowed"
class ToggleGroupBaseComponent(BaseUIComponent):
"""Base componen... | LiteralOrientation = Literal["horizontal", "vertical"] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.