instruction stringlengths 0 1k | input stringlengths 1 1k | output stringlengths 10 6.51k |
|---|---|---|
"""Custom menu component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.foreach import foreach
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.button import button
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.others import select_arrow
from reflex_ui.utils.twmerge import cn
LiteralOpenChangeReason = Literal[
"arrowKey",
"escapeKey",
"select",
"hover",
"click",
"focus",
"dismiss",
"typeahead",
"tab",
]
|
LiteralSide = Literal["top", "right", "bottom", "left"]
LiteralAlign = Literal["start", "center", "end"]
LiteralPositionMethod = Literal["absolute", "fixed"]
LiteralCollisionAvoidance = Literal["flip", "shift", "auto"]
LiteralMenuSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for menu components."""
TRIGGER = "flex min-w-48 items-center justify-between gap-3 select-none text-sm [&>span]:line-clamp-1 cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-primary-4 group/trigger"
PORTAL = "relative"
ICON = "flex size-4 text-secondary-10 group-data-[disabled]/trigger:text-current"
POPUP = "group/popup max-h-[17.25rem] overflow-y-auto origin-(--transform-origin) p-1 border border-secondary-a4 bg-secondary-1 shadow-large transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 outline-none scrollbar-thin scrollbar-thu | LiteralMenuOrientation = Literal["vertical", "horizontal"] |
"""Custom menu component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.foreach import foreach
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.button import button
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.others import select_arrow
from reflex_ui.utils.twmerge import cn
LiteralOpenChangeReason = Literal[
"arrowKey",
"escapeKey",
"select",
"hover",
"click",
"focus",
"dismiss",
"typeahead",
"tab",
]
LiteralMenuOrientation = Literal["vertical", "horizontal"]
|
LiteralAlign = Literal["start", "center", "end"]
LiteralPositionMethod = Literal["absolute", "fixed"]
LiteralCollisionAvoidance = Literal["flip", "shift", "auto"]
LiteralMenuSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for menu components."""
TRIGGER = "flex min-w-48 items-center justify-between gap-3 select-none text-sm [&>span]:line-clamp-1 cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-primary-4 group/trigger"
PORTAL = "relative"
ICON = "flex size-4 text-secondary-10 group-data-[disabled]/trigger:text-current"
POPUP = "group/popup max-h-[17.25rem] overflow-y-auto origin-(--transform-origin) p-1 border border-secondary-a4 bg-secondary-1 shadow-large transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 outline-none scrollbar-thin scrollbar-thumb-secondary-9 scrollbar-track-transparent"
ITEM = " | LiteralSide = Literal["top", "right", "bottom", "left"] |
"""Custom menu component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.foreach import foreach
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.button import button
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.others import select_arrow
from reflex_ui.utils.twmerge import cn
LiteralOpenChangeReason = Literal[
"arrowKey",
"escapeKey",
"select",
"hover",
"click",
"focus",
"dismiss",
"typeahead",
"tab",
]
LiteralMenuOrientation = Literal["vertical", "horizontal"]
LiteralSide = Literal["top", "right", "bottom", "left"]
|
LiteralPositionMethod = Literal["absolute", "fixed"]
LiteralCollisionAvoidance = Literal["flip", "shift", "auto"]
LiteralMenuSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for menu components."""
TRIGGER = "flex min-w-48 items-center justify-between gap-3 select-none text-sm [&>span]:line-clamp-1 cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-primary-4 group/trigger"
PORTAL = "relative"
ICON = "flex size-4 text-secondary-10 group-data-[disabled]/trigger:text-current"
POPUP = "group/popup max-h-[17.25rem] overflow-y-auto origin-(--transform-origin) p-1 border border-secondary-a4 bg-secondary-1 shadow-large transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 outline-none scrollbar-thin scrollbar-thumb-secondary-9 scrollbar-track-transparent"
ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] | LiteralAlign = Literal["start", "center", "end"] |
"""Custom menu component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.foreach import foreach
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.button import button
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.others import select_arrow
from reflex_ui.utils.twmerge import cn
LiteralOpenChangeReason = Literal[
"arrowKey",
"escapeKey",
"select",
"hover",
"click",
"focus",
"dismiss",
"typeahead",
"tab",
]
LiteralMenuOrientation = Literal["vertical", "horizontal"]
LiteralSide = Literal["top", "right", "bottom", "left"]
LiteralAlign = Literal["start", "center", "end"]
|
LiteralCollisionAvoidance = Literal["flip", "shift", "auto"]
LiteralMenuSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for menu components."""
TRIGGER = "flex min-w-48 items-center justify-between gap-3 select-none text-sm [&>span]:line-clamp-1 cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-primary-4 group/trigger"
PORTAL = "relative"
ICON = "flex size-4 text-secondary-10 group-data-[disabled]/trigger:text-current"
POPUP = "group/popup max-h-[17.25rem] overflow-y-auto origin-(--transform-origin) p-1 border border-secondary-a4 bg-secondary-1 shadow-large transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 outline-none scrollbar-thin scrollbar-thumb-secondary-9 scrollbar-track-transparent"
ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-medium gr | LiteralPositionMethod = Literal["absolute", "fixed"] |
"""Custom menu component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.foreach import foreach
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.button import button
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.others import select_arrow
from reflex_ui.utils.twmerge import cn
LiteralOpenChangeReason = Literal[
"arrowKey",
"escapeKey",
"select",
"hover",
"click",
"focus",
"dismiss",
"typeahead",
"tab",
]
LiteralMenuOrientation = Literal["vertical", "horizontal"]
LiteralSide = Literal["top", "right", "bottom", "left"]
LiteralAlign = Literal["start", "center", "end"]
LiteralPositionMethod = Literal["absolute", "fixed"]
|
LiteralMenuSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for menu components."""
TRIGGER = "flex min-w-48 items-center justify-between gap-3 select-none text-sm [&>span]:line-clamp-1 cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-primary-4 group/trigger"
PORTAL = "relative"
ICON = "flex size-4 text-secondary-10 group-data-[disabled]/trigger:text-current"
POPUP = "group/popup max-h-[17.25rem] overflow-y-auto origin-(--transform-origin) p-1 border border-secondary-a4 bg-secondary-1 shadow-large transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 outline-none scrollbar-thin scrollbar-thumb-secondary-9 scrollbar-track-transparent"
ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-medium group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1r | LiteralCollisionAvoidance = Literal["flip", "shift", "auto"] |
"""Custom menu component."""
from typing import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.foreach import foreach
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.button import button
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.others import select_arrow
from reflex_ui.utils.twmerge import cn
LiteralOpenChangeReason = Literal[
"arrowKey",
"escapeKey",
"select",
"hover",
"click",
"focus",
"dismiss",
"typeahead",
"tab",
]
LiteralMenuOrientation = Literal["vertical", "horizontal"]
LiteralSide = Literal["top", "right", "bottom", "left"]
LiteralAlign = Literal["start", "center", "end"]
LiteralPositionMethod = Literal["absolute", "fixed"]
LiteralCollisionAvoidance = Literal["flip", "shift", "auto"]
|
class ClassNames:
"""Class names for menu components."""
TRIGGER = "flex min-w-48 items-center justify-between gap-3 select-none text-sm [&>span]:line-clamp-1 cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-primary-4 group/trigger"
PORTAL = "relative"
ICON = "flex size-4 text-secondary-10 group-data-[disabled]/trigger:text-current"
POPUP = "group/popup max-h-[17.25rem] overflow-y-auto origin-(--transform-origin) p-1 border border-secondary-a4 bg-secondary-1 shadow-large transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 outline-none scrollbar-thin scrollbar-thumb-secondary-9 scrollbar-track-transparent"
ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-medium group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-12 cursor-pointer outline-none data- | LiteralMenuSize = Literal["xs", "sm", "md", "lg", "xl"] |
import Literal
from reflex.components.component import Component, ComponentNamespace
from reflex.components.core.foreach import foreach
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.button import button
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.others import select_arrow
from reflex_ui.utils.twmerge import cn
LiteralOpenChangeReason = Literal[
"arrowKey",
"escapeKey",
"select",
"hover",
"click",
"focus",
"dismiss",
"typeahead",
"tab",
]
LiteralMenuOrientation = Literal["vertical", "horizontal"]
LiteralSide = Literal["top", "right", "bottom", "left"]
LiteralAlign = Literal["start", "center", "end"]
LiteralPositionMethod = Literal["absolute", "fixed"]
LiteralCollisionAvoidance = Literal["flip", "shift", "auto"]
LiteralMenuSize = Literal["xs", "sm", "md", "lg", "xl"]
|
class MenuBaseComponent(BaseUIComponent):
"""Base component for menu components."""
library = f"{PACKAGE_NAME}/menu"
@property
def import_var(self):
"""Return the import variable for the menu component."""
return ImportVar(tag="Menu", package_path="", install=False)
class MenuRoot(MenuBaseComponent):
"""Groups all parts of the menu. Doesn't render its own HTML element."""
tag = "Menu.Root"
# Whether the menu is initially open. To render a controlled menu, use the open prop instead. Defaults to False.
default_open: Var[bool]
# Whether the menu is currently open.
open: Var[bool]
# Event handler called when the menu is opened or closed.
on_open_change: EventHandler[passthrough_event_spec(bool, dict)]
# Event handler called after any animations complete when the menu is closed.
on_open_change_complete: EventHandler[passthrough_event_spec(bool)]
# When in a submenu, determines whether pressing the Escap | class ClassNames:
"""Class names for menu components."""
TRIGGER = "flex min-w-48 items-center justify-between gap-3 select-none text-sm [&>span]:line-clamp-1 cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-primary-4 group/trigger"
PORTAL = "relative"
ICON = "flex size-4 text-secondary-10 group-data-[disabled]/trigger:text-current"
POPUP = "group/popup max-h-[17.25rem] overflow-y-auto origin-(--transform-origin) p-1 border border-secondary-a4 bg-secondary-1 shadow-large transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 outline-none scrollbar-thin scrollbar-thumb-secondary-9 scrollbar-track-transparent"
ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-medium group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-12 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1 text-start"
ITEM_INDICATOR = "text-current"
ITEM_TEXT = "text-start"
GROUP = "p-1"
GROUP_LABEL = "px-2 py-1.5 text-sm font-semibold"
SEPARATOR = "-mx-1 my-1 h-px bg-muted"
ARROW = "data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180"
POSITIONER = "outline-none"
RADIO_GROUP = ""
RADIO_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
RADIO_ITEM_INDICATOR = "text-current"
CHECKBOX_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
CHECKBOX_ITEM_INDICATOR = "text-current"
SUBMENU_TRIGGER = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1" |
ComponentNamespace
from reflex.components.core.foreach import foreach
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.button import button
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.others import select_arrow
from reflex_ui.utils.twmerge import cn
LiteralOpenChangeReason = Literal[
"arrowKey",
"escapeKey",
"select",
"hover",
"click",
"focus",
"dismiss",
"typeahead",
"tab",
]
LiteralMenuOrientation = Literal["vertical", "horizontal"]
LiteralSide = Literal["top", "right", "bottom", "left"]
LiteralAlign = Literal["start", "center", "end"]
LiteralPositionMethod = Literal["absolute", "fixed"]
LiteralCollisionAvoidance = Literal["flip", "shift", "auto"]
LiteralMenuSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for menu components."""
|
PORTAL = "relative"
ICON = "flex size-4 text-secondary-10 group-data-[disabled]/trigger:text-current"
POPUP = "group/popup max-h-[17.25rem] overflow-y-auto origin-(--transform-origin) p-1 border border-secondary-a4 bg-secondary-1 shadow-large transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 outline-none scrollbar-thin scrollbar-thumb-secondary-9 scrollbar-track-transparent"
ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-medium group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-12 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1 text-start"
ITEM_INDICATOR = "text-current"
ITEM_TEXT = "text-start"
GROUP = "p-1"
GROUP_LABEL = "px-2 py-1.5 text-sm font-semibold"
SEPARATOR = "-mx-1 my-1 h-px bg-muted"
ARROW = "data-[side=bottom]:top-[ | TRIGGER = "flex min-w-48 items-center justify-between gap-3 select-none text-sm [&>span]:line-clamp-1 cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-primary-4 group/trigger" |
Var
from reflex_ui.components.base.button import button
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.others import select_arrow
from reflex_ui.utils.twmerge import cn
LiteralOpenChangeReason = Literal[
"arrowKey",
"escapeKey",
"select",
"hover",
"click",
"focus",
"dismiss",
"typeahead",
"tab",
]
LiteralMenuOrientation = Literal["vertical", "horizontal"]
LiteralSide = Literal["top", "right", "bottom", "left"]
LiteralAlign = Literal["start", "center", "end"]
LiteralPositionMethod = Literal["absolute", "fixed"]
LiteralCollisionAvoidance = Literal["flip", "shift", "auto"]
LiteralMenuSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for menu components."""
TRIGGER = "flex min-w-48 items-center justify-between gap-3 select-none text-sm [&>span]:line-clamp-1 cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-primary-4 group/trigger"
|
ICON = "flex size-4 text-secondary-10 group-data-[disabled]/trigger:text-current"
POPUP = "group/popup max-h-[17.25rem] overflow-y-auto origin-(--transform-origin) p-1 border border-secondary-a4 bg-secondary-1 shadow-large transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 outline-none scrollbar-thin scrollbar-thumb-secondary-9 scrollbar-track-transparent"
ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-medium group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-12 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1 text-start"
ITEM_INDICATOR = "text-current"
ITEM_TEXT = "text-start"
GROUP = "p-1"
GROUP_LABEL = "px-2 py-1.5 text-sm font-semibold"
SEPARATOR = "-mx-1 my-1 h-px bg-muted"
ARROW = "data-[side=bottom]:top-[-8px] data-[side=left]:r | PORTAL = "relative" |
onents.base.button import button
from reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent
from reflex_ui.components.icons.others import select_arrow
from reflex_ui.utils.twmerge import cn
LiteralOpenChangeReason = Literal[
"arrowKey",
"escapeKey",
"select",
"hover",
"click",
"focus",
"dismiss",
"typeahead",
"tab",
]
LiteralMenuOrientation = Literal["vertical", "horizontal"]
LiteralSide = Literal["top", "right", "bottom", "left"]
LiteralAlign = Literal["start", "center", "end"]
LiteralPositionMethod = Literal["absolute", "fixed"]
LiteralCollisionAvoidance = Literal["flip", "shift", "auto"]
LiteralMenuSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for menu components."""
TRIGGER = "flex min-w-48 items-center justify-between gap-3 select-none text-sm [&>span]:line-clamp-1 cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-primary-4 group/trigger"
PORTAL = "relative"
|
POPUP = "group/popup max-h-[17.25rem] overflow-y-auto origin-(--transform-origin) p-1 border border-secondary-a4 bg-secondary-1 shadow-large transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 outline-none scrollbar-thin scrollbar-thumb-secondary-9 scrollbar-track-transparent"
ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-medium group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-12 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1 text-start"
ITEM_INDICATOR = "text-current"
ITEM_TEXT = "text-start"
GROUP = "p-1"
GROUP_LABEL = "px-2 py-1.5 text-sm font-semibold"
SEPARATOR = "-mx-1 my-1 h-px bg-muted"
ARROW = "data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=righ | ICON = "flex size-4 text-secondary-10 group-data-[disabled]/trigger:text-current" |
, BaseUIComponent
from reflex_ui.components.icons.others import select_arrow
from reflex_ui.utils.twmerge import cn
LiteralOpenChangeReason = Literal[
"arrowKey",
"escapeKey",
"select",
"hover",
"click",
"focus",
"dismiss",
"typeahead",
"tab",
]
LiteralMenuOrientation = Literal["vertical", "horizontal"]
LiteralSide = Literal["top", "right", "bottom", "left"]
LiteralAlign = Literal["start", "center", "end"]
LiteralPositionMethod = Literal["absolute", "fixed"]
LiteralCollisionAvoidance = Literal["flip", "shift", "auto"]
LiteralMenuSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for menu components."""
TRIGGER = "flex min-w-48 items-center justify-between gap-3 select-none text-sm [&>span]:line-clamp-1 cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-primary-4 group/trigger"
PORTAL = "relative"
ICON = "flex size-4 text-secondary-10 group-data-[disabled]/trigger:text-current"
|
ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-medium group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-12 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1 text-start"
ITEM_INDICATOR = "text-current"
ITEM_TEXT = "text-start"
GROUP = "p-1"
GROUP_LABEL = "px-2 py-1.5 text-sm font-semibold"
SEPARATOR = "-mx-1 my-1 h-px bg-muted"
ARROW = "data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180"
POSITIONER = "outline-none"
RADIO_GROUP = ""
RADIO_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 | POPUP = "group/popup max-h-[17.25rem] overflow-y-auto origin-(--transform-origin) p-1 border border-secondary-a4 bg-secondary-1 shadow-large transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 outline-none scrollbar-thin scrollbar-thumb-secondary-9 scrollbar-track-transparent" |
"left"]
LiteralAlign = Literal["start", "center", "end"]
LiteralPositionMethod = Literal["absolute", "fixed"]
LiteralCollisionAvoidance = Literal["flip", "shift", "auto"]
LiteralMenuSize = Literal["xs", "sm", "md", "lg", "xl"]
class ClassNames:
"""Class names for menu components."""
TRIGGER = "flex min-w-48 items-center justify-between gap-3 select-none text-sm [&>span]:line-clamp-1 cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-primary-4 group/trigger"
PORTAL = "relative"
ICON = "flex size-4 text-secondary-10 group-data-[disabled]/trigger:text-current"
POPUP = "group/popup max-h-[17.25rem] overflow-y-auto origin-(--transform-origin) p-1 border border-secondary-a4 bg-secondary-1 shadow-large transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 outline-none scrollbar-thin scrollbar-thumb-secondary-9 scrollbar-track-transparent"
|
ITEM_INDICATOR = "text-current"
ITEM_TEXT = "text-start"
GROUP = "p-1"
GROUP_LABEL = "px-2 py-1.5 text-sm font-semibold"
SEPARATOR = "-mx-1 my-1 h-px bg-muted"
ARROW = "data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180"
POSITIONER = "outline-none"
RADIO_GROUP = ""
RADIO_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
RADIO_ITEM_INDICATOR = "text-current"
CHECKBOX_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline | ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-medium group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-12 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1 text-start" |
nts."""
TRIGGER = "flex min-w-48 items-center justify-between gap-3 select-none text-sm [&>span]:line-clamp-1 cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-primary-4 group/trigger"
PORTAL = "relative"
ICON = "flex size-4 text-secondary-10 group-data-[disabled]/trigger:text-current"
POPUP = "group/popup max-h-[17.25rem] overflow-y-auto origin-(--transform-origin) p-1 border border-secondary-a4 bg-secondary-1 shadow-large transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 outline-none scrollbar-thin scrollbar-thumb-secondary-9 scrollbar-track-transparent"
ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-medium group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-12 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1 text-start"
|
ITEM_TEXT = "text-start"
GROUP = "p-1"
GROUP_LABEL = "px-2 py-1.5 text-sm font-semibold"
SEPARATOR = "-mx-1 my-1 h-px bg-muted"
ARROW = "data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180"
POSITIONER = "outline-none"
RADIO_GROUP = ""
RADIO_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
RADIO_ITEM_INDICATOR = "text-current"
CHECKBOX_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondar | ITEM_INDICATOR = "text-current" |
8 items-center justify-between gap-3 select-none text-sm [&>span]:line-clamp-1 cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-primary-4 group/trigger"
PORTAL = "relative"
ICON = "flex size-4 text-secondary-10 group-data-[disabled]/trigger:text-current"
POPUP = "group/popup max-h-[17.25rem] overflow-y-auto origin-(--transform-origin) p-1 border border-secondary-a4 bg-secondary-1 shadow-large transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 outline-none scrollbar-thin scrollbar-thumb-secondary-9 scrollbar-track-transparent"
ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-medium group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-12 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1 text-start"
ITEM_INDICATOR = "text-current"
|
GROUP = "p-1"
GROUP_LABEL = "px-2 py-1.5 text-sm font-semibold"
SEPARATOR = "-mx-1 my-1 h-px bg-muted"
ARROW = "data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180"
POSITIONER = "outline-none"
RADIO_GROUP = ""
RADIO_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
RADIO_ITEM_INDICATOR = "text-current"
CHECKBOX_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
CHECKBOX_ | ITEM_TEXT = "text-start" |
n gap-3 select-none text-sm [&>span]:line-clamp-1 cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-primary-4 group/trigger"
PORTAL = "relative"
ICON = "flex size-4 text-secondary-10 group-data-[disabled]/trigger:text-current"
POPUP = "group/popup max-h-[17.25rem] overflow-y-auto origin-(--transform-origin) p-1 border border-secondary-a4 bg-secondary-1 shadow-large transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 outline-none scrollbar-thin scrollbar-thumb-secondary-9 scrollbar-track-transparent"
ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-medium group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-12 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1 text-start"
ITEM_INDICATOR = "text-current"
ITEM_TEXT = "text-start"
|
GROUP_LABEL = "px-2 py-1.5 text-sm font-semibold"
SEPARATOR = "-mx-1 my-1 h-px bg-muted"
ARROW = "data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180"
POSITIONER = "outline-none"
RADIO_GROUP = ""
RADIO_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
RADIO_ITEM_INDICATOR = "text-current"
CHECKBOX_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
CHECKBOX_ITEM_INDICATOR = " | GROUP = "p-1" |
e text-sm [&>span]:line-clamp-1 cursor-pointer focus:outline-none focus-visible:ring-1 focus-visible:ring-primary-4 group/trigger"
PORTAL = "relative"
ICON = "flex size-4 text-secondary-10 group-data-[disabled]/trigger:text-current"
POPUP = "group/popup max-h-[17.25rem] overflow-y-auto origin-(--transform-origin) p-1 border border-secondary-a4 bg-secondary-1 shadow-large transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 outline-none scrollbar-thin scrollbar-thumb-secondary-9 scrollbar-track-transparent"
ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-medium group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-12 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1 text-start"
ITEM_INDICATOR = "text-current"
ITEM_TEXT = "text-start"
GROUP = "p-1"
|
SEPARATOR = "-mx-1 my-1 h-px bg-muted"
ARROW = "data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180"
POSITIONER = "outline-none"
RADIO_GROUP = ""
RADIO_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
RADIO_ITEM_INDICATOR = "text-current"
CHECKBOX_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
CHECKBOX_ITEM_INDICATOR = "text-current"
SUBMENU_TRIGGER = "grid min-w-(--anc | GROUP_LABEL = "px-2 py-1.5 text-sm font-semibold" |
utline-none focus-visible:ring-1 focus-visible:ring-primary-4 group/trigger"
PORTAL = "relative"
ICON = "flex size-4 text-secondary-10 group-data-[disabled]/trigger:text-current"
POPUP = "group/popup max-h-[17.25rem] overflow-y-auto origin-(--transform-origin) p-1 border border-secondary-a4 bg-secondary-1 shadow-large transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 outline-none scrollbar-thin scrollbar-thumb-secondary-9 scrollbar-track-transparent"
ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-medium group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-12 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1 text-start"
ITEM_INDICATOR = "text-current"
ITEM_TEXT = "text-start"
GROUP = "p-1"
GROUP_LABEL = "px-2 py-1.5 text-sm font-semibold"
|
ARROW = "data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180"
POSITIONER = "outline-none"
RADIO_GROUP = ""
RADIO_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
RADIO_ITEM_INDICATOR = "text-current"
CHECKBOX_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
CHECKBOX_ITEM_INDICATOR = "text-current"
SUBMENU_TRIGGER = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-cente | SEPARATOR = "-mx-1 my-1 h-px bg-muted" |
ble:ring-primary-4 group/trigger"
PORTAL = "relative"
ICON = "flex size-4 text-secondary-10 group-data-[disabled]/trigger:text-current"
POPUP = "group/popup max-h-[17.25rem] overflow-y-auto origin-(--transform-origin) p-1 border border-secondary-a4 bg-secondary-1 shadow-large transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 outline-none scrollbar-thin scrollbar-thumb-secondary-9 scrollbar-track-transparent"
ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-medium group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-12 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1 text-start"
ITEM_INDICATOR = "text-current"
ITEM_TEXT = "text-start"
GROUP = "p-1"
GROUP_LABEL = "px-2 py-1.5 text-sm font-semibold"
SEPARATOR = "-mx-1 my-1 h-px bg-muted"
|
POSITIONER = "outline-none"
RADIO_GROUP = ""
RADIO_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
RADIO_ITEM_INDICATOR = "text-current"
CHECKBOX_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
CHECKBOX_ITEM_INDICATOR = "text-current"
SUBMENU_TRIGGER = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
class MenuBaseComp | ARROW = "data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180" |
rm-origin) p-1 border border-secondary-a4 bg-secondary-1 shadow-large transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 outline-none scrollbar-thin scrollbar-thumb-secondary-9 scrollbar-track-transparent"
ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-medium group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-12 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1 text-start"
ITEM_INDICATOR = "text-current"
ITEM_TEXT = "text-start"
GROUP = "p-1"
GROUP_LABEL = "px-2 py-1.5 text-sm font-semibold"
SEPARATOR = "-mx-1 my-1 h-px bg-muted"
ARROW = "data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180"
|
RADIO_GROUP = ""
RADIO_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
RADIO_ITEM_INDICATOR = "text-current"
CHECKBOX_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
CHECKBOX_ITEM_INDICATOR = "text-current"
SUBMENU_TRIGGER = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
class MenuBaseComponent(BaseUIComponent):
"""B | POSITIONER = "outline-none" |
ondary-a4 bg-secondary-1 shadow-large transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 outline-none scrollbar-thin scrollbar-thumb-secondary-9 scrollbar-track-transparent"
ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-medium group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-12 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1 text-start"
ITEM_INDICATOR = "text-current"
ITEM_TEXT = "text-start"
GROUP = "p-1"
GROUP_LABEL = "px-2 py-1.5 text-sm font-semibold"
SEPARATOR = "-mx-1 my-1 h-px bg-muted"
ARROW = "data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180"
POSITIONER = "outline-none"
|
RADIO_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
RADIO_ITEM_INDICATOR = "text-current"
CHECKBOX_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
CHECKBOX_ITEM_INDICATOR = "text-current"
SUBMENU_TRIGGER = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
class MenuBaseComponent(BaseUIComponent):
"""Base component for men | RADIO_GROUP = "" |
y-1 shadow-large transition-[transform,scale,opacity] data-[ending-style]:scale-95 data-[starting-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 outline-none scrollbar-thin scrollbar-thumb-secondary-9 scrollbar-track-transparent"
ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-medium group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-12 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1 text-start"
ITEM_INDICATOR = "text-current"
ITEM_TEXT = "text-start"
GROUP = "p-1"
GROUP_LABEL = "px-2 py-1.5 text-sm font-semibold"
SEPARATOR = "-mx-1 my-1 h-px bg-muted"
ARROW = "data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180"
POSITIONER = "outline-none"
RADIO_GROUP = ""
|
RADIO_ITEM_INDICATOR = "text-current"
CHECKBOX_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
CHECKBOX_ITEM_INDICATOR = "text-current"
SUBMENU_TRIGGER = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
class MenuBaseComponent(BaseUIComponent):
"""Base component for menu components."""
library = f"{PACKAGE_NAME}/menu"
@property
def import_var(self):
"""Return the import variable for the menu component."""
return ImportVar(tag="Menu", package_path="", install=False)
class MenuRoot(MenuBaseComponent):
"""Gro | RADIO_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1" |
min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-medium group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-12 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1 text-start"
ITEM_INDICATOR = "text-current"
ITEM_TEXT = "text-start"
GROUP = "p-1"
GROUP_LABEL = "px-2 py-1.5 text-sm font-semibold"
SEPARATOR = "-mx-1 my-1 h-px bg-muted"
ARROW = "data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180"
POSITIONER = "outline-none"
RADIO_GROUP = ""
RADIO_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
|
CHECKBOX_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
CHECKBOX_ITEM_INDICATOR = "text-current"
SUBMENU_TRIGGER = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
class MenuBaseComponent(BaseUIComponent):
"""Base component for menu components."""
library = f"{PACKAGE_NAME}/menu"
@property
def import_var(self):
"""Return the import variable for the menu component."""
return ImportVar(tag="Menu", package_path="", install=False)
class MenuRoot(MenuBaseComponent):
"""Groups all parts of the menu. Doesn't render | RADIO_ITEM_INDICATOR = "text-current" |
o] items-center gap-2 text-sm select-none font-medium group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-12 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1 text-start"
ITEM_INDICATOR = "text-current"
ITEM_TEXT = "text-start"
GROUP = "p-1"
GROUP_LABEL = "px-2 py-1.5 text-sm font-semibold"
SEPARATOR = "-mx-1 my-1 h-px bg-muted"
ARROW = "data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180"
POSITIONER = "outline-none"
RADIO_GROUP = ""
RADIO_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
RADIO_ITEM_INDICATOR = "text-current"
|
CHECKBOX_ITEM_INDICATOR = "text-current"
SUBMENU_TRIGGER = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
class MenuBaseComponent(BaseUIComponent):
"""Base component for menu components."""
library = f"{PACKAGE_NAME}/menu"
@property
def import_var(self):
"""Return the import variable for the menu component."""
return ImportVar(tag="Menu", package_path="", install=False)
class MenuRoot(MenuBaseComponent):
"""Groups all parts of the menu. Doesn't render its own HTML element."""
tag = "Menu.Root"
# Whether the menu is initially open. To render a controlled menu, use the open prop instead. Defaults to False.
default_open: Var[bool]
# Whether the menu is currently open.
open: Var[bool]
# Event handler ca | CHECKBOX_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1" |
xt-start"
GROUP = "p-1"
GROUP_LABEL = "px-2 py-1.5 text-sm font-semibold"
SEPARATOR = "-mx-1 my-1 h-px bg-muted"
ARROW = "data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180"
POSITIONER = "outline-none"
RADIO_GROUP = ""
RADIO_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
RADIO_ITEM_INDICATOR = "text-current"
CHECKBOX_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
|
SUBMENU_TRIGGER = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
class MenuBaseComponent(BaseUIComponent):
"""Base component for menu components."""
library = f"{PACKAGE_NAME}/menu"
@property
def import_var(self):
"""Return the import variable for the menu component."""
return ImportVar(tag="Menu", package_path="", install=False)
class MenuRoot(MenuBaseComponent):
"""Groups all parts of the menu. Doesn't render its own HTML element."""
tag = "Menu.Root"
# Whether the menu is initially open. To render a controlled menu, use the open prop instead. Defaults to False.
default_open: Var[bool]
# Whether the menu is currently open.
open: Var[bool]
# Event handler called when the menu is opened or closed.
o | CHECKBOX_ITEM_INDICATOR = "text-current" |
"px-2 py-1.5 text-sm font-semibold"
SEPARATOR = "-mx-1 my-1 h-px bg-muted"
ARROW = "data-[side=bottom]:top-[-8px] data-[side=left]:right-[-13px] data-[side=left]:rotate-90 data-[side=right]:left-[-13px] data-[side=right]:-rotate-90 data-[side=top]:bottom-[-8px] data-[side=top]:rotate-180"
POSITIONER = "outline-none"
RADIO_GROUP = ""
RADIO_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
RADIO_ITEM_INDICATOR = "text-current"
CHECKBOX_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
CHECKBOX_ITEM_INDICATOR = "text-current"
|
class MenuBaseComponent(BaseUIComponent):
"""Base component for menu components."""
library = f"{PACKAGE_NAME}/menu"
@property
def import_var(self):
"""Return the import variable for the menu component."""
return ImportVar(tag="Menu", package_path="", install=False)
class MenuRoot(MenuBaseComponent):
"""Groups all parts of the menu. Doesn't render its own HTML element."""
tag = "Menu.Root"
# Whether the menu is initially open. To render a controlled menu, use the open prop instead. Defaults to False.
default_open: Var[bool]
# Whether the menu is currently open.
open: Var[bool]
# Event handler called when the menu is opened or closed.
on_open_change: EventHandler[passthrough_event_spec(bool, dict)]
# Event handler called after any animations complete when the menu is closed.
on_open_change_complete: EventHandler[passthrough_event_spec(bool)]
# When in a submenu, determines whether pressing the Escap | SUBMENU_TRIGGER = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1" |
e=top]:rotate-180"
POSITIONER = "outline-none"
RADIO_GROUP = ""
RADIO_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
RADIO_ITEM_INDICATOR = "text-current"
CHECKBOX_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
CHECKBOX_ITEM_INDICATOR = "text-current"
SUBMENU_TRIGGER = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
|
class MenuRoot(MenuBaseComponent):
"""Groups all parts of the menu. Doesn't render its own HTML element."""
tag = "Menu.Root"
# Whether the menu is initially open. To render a controlled menu, use the open prop instead. Defaults to False.
default_open: Var[bool]
# Whether the menu is currently open.
open: Var[bool]
# Event handler called when the menu is opened or closed.
on_open_change: EventHandler[passthrough_event_spec(bool, dict)]
# Event handler called after any animations complete when the menu is closed.
on_open_change_complete: EventHandler[passthrough_event_spec(bool)]
# When in a submenu, determines whether pressing the Escape key closes the entire menu, or only the current child menu. Defaults to True.
close_parent_on_esc: Var[bool]
# Determines if the menu enters a modal state when open. Defaults to True.
# - True: user interaction is limited to the menu: document page scroll is locked and and pointer intera | class MenuBaseComponent(BaseUIComponent):
"""Base component for menu components."""
library = f"{PACKAGE_NAME}/menu"
@property
def import_var(self):
"""Return the import variable for the menu component."""
return ImportVar(tag="Menu", package_path="", install=False) |
d min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
RADIO_ITEM_INDICATOR = "text-current"
CHECKBOX_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
CHECKBOX_ITEM_INDICATOR = "text-current"
SUBMENU_TRIGGER = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
class MenuBaseComponent(BaseUIComponent):
"""Base component for menu components."""
|
@property
def import_var(self):
"""Return the import variable for the menu component."""
return ImportVar(tag="Menu", package_path="", install=False)
class MenuRoot(MenuBaseComponent):
"""Groups all parts of the menu. Doesn't render its own HTML element."""
tag = "Menu.Root"
# Whether the menu is initially open. To render a controlled menu, use the open prop instead. Defaults to False.
default_open: Var[bool]
# Whether the menu is currently open.
open: Var[bool]
# Event handler called when the menu is opened or closed.
on_open_change: EventHandler[passthrough_event_spec(bool, dict)]
# Event handler called after any animations complete when the menu is closed.
on_open_change_complete: EventHandler[passthrough_event_spec(bool)]
# When in a submenu, determines whether pressing the Escape key closes the entire menu, or only the current child menu. Defaults to True.
close_parent_on_esc: Var[bool]
# Determ | library = f"{PACKAGE_NAME}/menu" |
center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
RADIO_ITEM_INDICATOR = "text-current"
CHECKBOX_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
CHECKBOX_ITEM_INDICATOR = "text-current"
SUBMENU_TRIGGER = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
class MenuBaseComponent(BaseUIComponent):
"""Base component for menu components."""
library = f"{PACKAGE_NAME}/menu"
@property
|
class MenuRoot(MenuBaseComponent):
"""Groups all parts of the menu. Doesn't render its own HTML element."""
tag = "Menu.Root"
# Whether the menu is initially open. To render a controlled menu, use the open prop instead. Defaults to False.
default_open: Var[bool]
# Whether the menu is currently open.
open: Var[bool]
# Event handler called when the menu is opened or closed.
on_open_change: EventHandler[passthrough_event_spec(bool, dict)]
# Event handler called after any animations complete when the menu is closed.
on_open_change_complete: EventHandler[passthrough_event_spec(bool)]
# When in a submenu, determines whether pressing the Escape key closes the entire menu, or only the current child menu. Defaults to True.
close_parent_on_esc: Var[bool]
# Determines if the menu enters a modal state when open. Defaults to True.
# - True: user interaction is limited to the menu: document page scroll is locked and and pointer intera | def import_var(self):
"""Return the import variable for the menu component."""
return ImportVar(tag="Menu", package_path="", install=False) |
data-[highlighted]:bg-secondary-3 scroll-m-1"
RADIO_ITEM_INDICATOR = "text-current"
CHECKBOX_ITEM = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
CHECKBOX_ITEM_INDICATOR = "text-current"
SUBMENU_TRIGGER = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
class MenuBaseComponent(BaseUIComponent):
"""Base component for menu components."""
library = f"{PACKAGE_NAME}/menu"
@property
def import_var(self):
"""Return the import variable for the menu component."""
return ImportVar(tag="Menu", package_path="", install=False)
|
class MenuTrigger(MenuBaseComponent):
"""A button that opens the menu. Renders a <button> element."""
tag = "Menu.Trigger"
# 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 component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu trigger component."""
props["data-slot"] = "menu-trigger"
cls.set_class_name(ClassNames.TRIGGER, props)
return super().create(*children, **props)
class MenuPortal(MenuBaseComponent):
"""A portal element that moves the popup to a different part of the DOM. By default, the portal element is appended to <body>."""
tag = "Menu.Portal"
# A parent elem | class MenuRoot(MenuBaseComponent):
"""Groups all parts of the menu. Doesn't render its own HTML element."""
tag = "Menu.Root"
# Whether the menu is initially open. To render a controlled menu, use the open prop instead. Defaults to False.
default_open: Var[bool]
# Whether the menu is currently open.
open: Var[bool]
# Event handler called when the menu is opened or closed.
on_open_change: EventHandler[passthrough_event_spec(bool, dict)]
# Event handler called after any animations complete when the menu is closed.
on_open_change_complete: EventHandler[passthrough_event_spec(bool)]
# When in a submenu, determines whether pressing the Escape key closes the entire menu, or only the current child menu. Defaults to True.
close_parent_on_esc: Var[bool]
# Determines if the menu enters a modal state when open. Defaults to True.
# - True: user interaction is limited to the menu: document page scroll is locked and and pointer interactions on outside elements are disabled.
# - False: user interaction with the rest of the document is allowed.
modal: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# Whether the menu should also open when the trigger is hovered.
open_on_hover: Var[bool]
# How long to wait before the menu may be opened on hover. Specified in milliseconds. Requires the open_on_hover prop. Defaults to 100.
delay: Var[int]
# How long to wait before closing the menu that was opened on hover. Specified in milliseconds. Requires the open_on_hover prop. Defaults to 0.
close_delay: Var[int]
# Whether to loop keyboard 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]
# The visual orientation of the menu. Controls whether roving focus uses up/down or left/right arrow keys. Defaults to 'vertical'.
orientation: Var[LiteralMenuOrientation]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu root component."""
props["data-slot"] = "menu"
return super().create(*children, **props) |
-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
CHECKBOX_ITEM_INDICATOR = "text-current"
SUBMENU_TRIGGER = "grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] group-data-[side=none]/popup:min-w-[calc(var(--anchor-width)+1rem)] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1"
class MenuBaseComponent(BaseUIComponent):
"""Base component for menu components."""
library = f"{PACKAGE_NAME}/menu"
@property
def import_var(self):
"""Return the import variable for the menu component."""
return ImportVar(tag="Menu", package_path="", install=False)
class MenuRoot(MenuBaseComponent):
"""Groups all parts of the menu. Doesn't render its own HTML element."""
|
# Whether the menu is initially open. To render a controlled menu, use the open prop instead. Defaults to False.
default_open: Var[bool]
# Whether the menu is currently open.
open: Var[bool]
# Event handler called when the menu is opened or closed.
on_open_change: EventHandler[passthrough_event_spec(bool, dict)]
# Event handler called after any animations complete when the menu is closed.
on_open_change_complete: EventHandler[passthrough_event_spec(bool)]
# When in a submenu, determines whether pressing the Escape key closes the entire menu, or only the current child menu. Defaults to True.
close_parent_on_esc: Var[bool]
# Determines if the menu enters a modal state when open. Defaults to True.
# - True: user interaction is limited to the menu: document page scroll is locked and and pointer interactions on outside elements are disabled.
# - False: user interaction with the rest of the document is allowed.
modal: Var[bool]
| tag = "Menu.Root" |
# - False: user interaction with the rest of the document is allowed.
modal: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# Whether the menu should also open when the trigger is hovered.
open_on_hover: Var[bool]
# How long to wait before the menu may be opened on hover. Specified in milliseconds. Requires the open_on_hover prop. Defaults to 100.
delay: Var[int]
# How long to wait before closing the menu that was opened on hover. Specified in milliseconds. Requires the open_on_hover prop. Defaults to 0.
close_delay: Var[int]
# Whether to loop keyboard 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]
# The visual orientation of the menu. Controls whether roving focus uses up/down or left/right arrow keys. Defaults to 'vertical'.
orientation: Var[LiteralMenuOrientation]
@classmethod
|
class MenuTrigger(MenuBaseComponent):
"""A button that opens the menu. Renders a <button> element."""
tag = "Menu.Trigger"
# 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 component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu trigger component."""
props["data-slot"] = "menu-trigger"
cls.set_class_name(ClassNames.TRIGGER, props)
return super().create(*children, **props)
class MenuPortal(MenuBaseComponent):
"""A portal element that moves the popup to a different part of the DOM. By default, the portal element is appended to <body>."""
tag = "Menu.Portal"
# A parent elem | def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu root component."""
props["data-slot"] = "menu"
return super().create(*children, **props) |
the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# Whether the menu should also open when the trigger is hovered.
open_on_hover: Var[bool]
# How long to wait before the menu may be opened on hover. Specified in milliseconds. Requires the open_on_hover prop. Defaults to 100.
delay: Var[int]
# How long to wait before closing the menu that was opened on hover. Specified in milliseconds. Requires the open_on_hover prop. Defaults to 0.
close_delay: Var[int]
# Whether to loop keyboard 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]
# The visual orientation of the menu. Controls whether roving focus uses up/down or left/right arrow keys. Defaults to 'vertical'.
orientation: Var[LiteralMenuOrientation]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu root component."""
|
return super().create(*children, **props)
class MenuTrigger(MenuBaseComponent):
"""A button that opens the menu. Renders a <button> element."""
tag = "Menu.Trigger"
# 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 component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu trigger component."""
props["data-slot"] = "menu-trigger"
cls.set_class_name(ClassNames.TRIGGER, props)
return super().create(*children, **props)
class MenuPortal(MenuBaseComponent):
"""A portal element that moves the popup to a different part of the DOM. By default, the portal element is appended to <body> | props["data-slot"] = "menu" |
ar[bool]
# Whether the menu should also open when the trigger is hovered.
open_on_hover: Var[bool]
# How long to wait before the menu may be opened on hover. Specified in milliseconds. Requires the open_on_hover prop. Defaults to 100.
delay: Var[int]
# How long to wait before closing the menu that was opened on hover. Specified in milliseconds. Requires the open_on_hover prop. Defaults to 0.
close_delay: Var[int]
# Whether to loop keyboard 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]
# The visual orientation of the menu. Controls whether roving focus uses up/down or left/right arrow keys. Defaults to 'vertical'.
orientation: Var[LiteralMenuOrientation]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu root component."""
props["data-slot"] = "menu"
return super().create(*children, **props)
|
class MenuPortal(MenuBaseComponent):
"""A portal element that moves the popup to a different part of the DOM. By default, the portal element is appended to <body>."""
tag = "Menu.Portal"
# A parent element to render the portal element into.
container: Var[str]
# Whether to keep the portal mounted in the DOM while the popup is hidden. Defaults to False.
keep_mounted: Var[bool]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu portal component."""
props["data-slot"] = "menu-portal"
cls.set_class_name(ClassNames.PORTAL, props)
return super().create(*children, **props)
class MenuPositioner(MenuBaseComponent):
"""Positions the menu popup against the trigger. Renders a <div> element."""
tag = "Menu.Positioner"
# Determines how to handle collisions when positioning the popup.
collision_avoidance: Var[bool | LiteralCollisionAvoidance]
# How to align the popup re | class MenuTrigger(MenuBaseComponent):
"""A button that opens the menu. Renders a <button> element."""
tag = "Menu.Trigger"
# 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 component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu trigger component."""
props["data-slot"] = "menu-trigger"
cls.set_class_name(ClassNames.TRIGGER, props)
return super().create(*children, **props) |
# How long to wait before the menu may be opened on hover. Specified in milliseconds. Requires the open_on_hover prop. Defaults to 100.
delay: Var[int]
# How long to wait before closing the menu that was opened on hover. Specified in milliseconds. Requires the open_on_hover prop. Defaults to 0.
close_delay: Var[int]
# Whether to loop keyboard 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]
# The visual orientation of the menu. Controls whether roving focus uses up/down or left/right arrow keys. Defaults to 'vertical'.
orientation: Var[LiteralMenuOrientation]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu root component."""
props["data-slot"] = "menu"
return super().create(*children, **props)
class MenuTrigger(MenuBaseComponent):
"""A button that opens the menu. Renders a <button> element."""
|
# 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 component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu trigger component."""
props["data-slot"] = "menu-trigger"
cls.set_class_name(ClassNames.TRIGGER, props)
return super().create(*children, **props)
class MenuPortal(MenuBaseComponent):
"""A portal element that moves the popup to a different part of the DOM. By default, the portal element is appended to <body>."""
tag = "Menu.Portal"
# A parent element to render the portal element into.
container: Var[str]
# Whether to keep the portal mounted in the DOM while the popup is | tag = "Menu.Trigger" |
ist is reached while using the arrow keys. Defaults to True.
loop: Var[bool]
# The visual orientation of the menu. Controls whether roving focus uses up/down or left/right arrow keys. Defaults to 'vertical'.
orientation: Var[LiteralMenuOrientation]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu root component."""
props["data-slot"] = "menu"
return super().create(*children, **props)
class MenuTrigger(MenuBaseComponent):
"""A button that opens the menu. Renders a <button> element."""
tag = "Menu.Trigger"
# 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 component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
|
class MenuPortal(MenuBaseComponent):
"""A portal element that moves the popup to a different part of the DOM. By default, the portal element is appended to <body>."""
tag = "Menu.Portal"
# A parent element to render the portal element into.
container: Var[str]
# Whether to keep the portal mounted in the DOM while the popup is hidden. Defaults to False.
keep_mounted: Var[bool]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu portal component."""
props["data-slot"] = "menu-portal"
cls.set_class_name(ClassNames.PORTAL, props)
return super().create(*children, **props)
class MenuPositioner(MenuBaseComponent):
"""Positions the menu popup against the trigger. Renders a <div> element."""
tag = "Menu.Positioner"
# Determines how to handle collisions when positioning the popup.
collision_avoidance: Var[bool | LiteralCollisionAvoidance]
# How to align the popup re | def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu trigger component."""
props["data-slot"] = "menu-trigger"
cls.set_class_name(ClassNames.TRIGGER, props)
return super().create(*children, **props) |
the menu. Controls whether roving focus uses up/down or left/right arrow keys. Defaults to 'vertical'.
orientation: Var[LiteralMenuOrientation]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu root component."""
props["data-slot"] = "menu"
return super().create(*children, **props)
class MenuTrigger(MenuBaseComponent):
"""A button that opens the menu. Renders a <button> element."""
tag = "Menu.Trigger"
# 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 component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu trigger component."""
|
cls.set_class_name(ClassNames.TRIGGER, props)
return super().create(*children, **props)
class MenuPortal(MenuBaseComponent):
"""A portal element that moves the popup to a different part of the DOM. By default, the portal element is appended to <body>."""
tag = "Menu.Portal"
# A parent element to render the portal element into.
container: Var[str]
# Whether to keep the portal mounted in the DOM while the popup is hidden. Defaults to False.
keep_mounted: Var[bool]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu portal component."""
props["data-slot"] = "menu-portal"
cls.set_class_name(ClassNames.PORTAL, props)
return super().create(*children, **props)
class MenuPositioner(MenuBaseComponent):
"""Positions the menu popup against the trigger. Renders a <div> element."""
tag = "Menu.Positioner"
# Determines how to handle collisions when positioning th | props["data-slot"] = "menu-trigger" |
ation]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu root component."""
props["data-slot"] = "menu"
return super().create(*children, **props)
class MenuTrigger(MenuBaseComponent):
"""A button that opens the menu. Renders a <button> element."""
tag = "Menu.Trigger"
# 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 component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu trigger component."""
props["data-slot"] = "menu-trigger"
cls.set_class_name(ClassNames.TRIGGER, props)
return super().create(*children, **props)
|
class MenuPositioner(MenuBaseComponent):
"""Positions the menu popup against the trigger. Renders a <div> element."""
tag = "Menu.Positioner"
# Determines how to handle collisions when positioning the popup.
collision_avoidance: Var[bool | LiteralCollisionAvoidance]
# How to align the popup relative to the specified side. Defaults to "center".
align: Var[LiteralAlign]
# Additional offset along the alignment axis in pixels. Defaults to 0.
align_offset: Var[int]
# Which side of the anchor element to align the popup against. May automatically change to avoid collisions. Defaults to "bottom".
side: Var[LiteralSide]
# Distance between the anchor and the popup in pixels. Defaults to 0.
side_offset: Var[int]
# Minimum distance to maintain between the arrow and the edges of the popup. Use it to prevent the arrow element from hanging out of the rounded corners of a popup. Defaults to 5.
arrow_padding: Var[int]
# Additional s | class MenuPortal(MenuBaseComponent):
"""A portal element that moves the popup to a different part of the DOM. By default, the portal element is appended to <body>."""
tag = "Menu.Portal"
# A parent element to render the portal element into.
container: Var[str]
# Whether to keep the portal mounted in the DOM while the popup is hidden. Defaults to False.
keep_mounted: Var[bool]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu portal component."""
props["data-slot"] = "menu-portal"
cls.set_class_name(ClassNames.PORTAL, props)
return super().create(*children, **props) |
eturn super().create(*children, **props)
class MenuTrigger(MenuBaseComponent):
"""A button that opens the menu. Renders a <button> element."""
tag = "Menu.Trigger"
# 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 component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu trigger component."""
props["data-slot"] = "menu-trigger"
cls.set_class_name(ClassNames.TRIGGER, props)
return super().create(*children, **props)
class MenuPortal(MenuBaseComponent):
"""A portal element that moves the popup to a different part of the DOM. By default, the portal element is appended to <body>."""
|
# A parent element to render the portal element into.
container: Var[str]
# Whether to keep the portal mounted in the DOM while the popup is hidden. Defaults to False.
keep_mounted: Var[bool]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu portal component."""
props["data-slot"] = "menu-portal"
cls.set_class_name(ClassNames.PORTAL, props)
return super().create(*children, **props)
class MenuPositioner(MenuBaseComponent):
"""Positions the menu popup against the trigger. Renders a <div> element."""
tag = "Menu.Positioner"
# Determines how to handle collisions when positioning the popup.
collision_avoidance: Var[bool | LiteralCollisionAvoidance]
# How to align the popup relative to the specified side. Defaults to "center".
align: Var[LiteralAlign]
# Additional offset along the alignment axis in pixels. Defaults to 0.
align_offset: Var[int]
# Which s | tag = "Menu.Portal" |
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 component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu trigger component."""
props["data-slot"] = "menu-trigger"
cls.set_class_name(ClassNames.TRIGGER, props)
return super().create(*children, **props)
class MenuPortal(MenuBaseComponent):
"""A portal element that moves the popup to a different part of the DOM. By default, the portal element is appended to <body>."""
tag = "Menu.Portal"
# A parent element to render the portal element into.
container: Var[str]
# Whether to keep the portal mounted in the DOM while the popup is hidden. Defaults to False.
keep_mounted: Var[bool]
@classmethod
|
class MenuPositioner(MenuBaseComponent):
"""Positions the menu popup against the trigger. Renders a <div> element."""
tag = "Menu.Positioner"
# Determines how to handle collisions when positioning the popup.
collision_avoidance: Var[bool | LiteralCollisionAvoidance]
# How to align the popup relative to the specified side. Defaults to "center".
align: Var[LiteralAlign]
# Additional offset along the alignment axis in pixels. Defaults to 0.
align_offset: Var[int]
# Which side of the anchor element to align the popup against. May automatically change to avoid collisions. Defaults to "bottom".
side: Var[LiteralSide]
# Distance between the anchor and the popup in pixels. Defaults to 0.
side_offset: Var[int]
# Minimum distance to maintain between the arrow and the edges of the popup. Use it to prevent the arrow element from hanging out of the rounded corners of a popup. Defaults to 5.
arrow_padding: Var[int]
# Additional s | def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu portal component."""
props["data-slot"] = "menu-portal"
cls.set_class_name(ClassNames.PORTAL, props)
return super().create(*children, **props) |
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu trigger component."""
props["data-slot"] = "menu-trigger"
cls.set_class_name(ClassNames.TRIGGER, props)
return super().create(*children, **props)
class MenuPortal(MenuBaseComponent):
"""A portal element that moves the popup to a different part of the DOM. By default, the portal element is appended to <body>."""
tag = "Menu.Portal"
# A parent element to render the portal element into.
container: Var[str]
# Whether to keep the portal mounted in the DOM while the popup is hidden. Defaults to False.
keep_mounted: Var[bool]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu portal component."""
|
cls.set_class_name(ClassNames.PORTAL, props)
return super().create(*children, **props)
class MenuPositioner(MenuBaseComponent):
"""Positions the menu popup against the trigger. Renders a <div> element."""
tag = "Menu.Positioner"
# Determines how to handle collisions when positioning the popup.
collision_avoidance: Var[bool | LiteralCollisionAvoidance]
# How to align the popup relative to the specified side. Defaults to "center".
align: Var[LiteralAlign]
# Additional offset along the alignment axis in pixels. Defaults to 0.
align_offset: Var[int]
# Which side of the anchor element to align the popup against. May automatically change to avoid collisions. Defaults to "bottom".
side: Var[LiteralSide]
# Distance between the anchor and the popup in pixels. Defaults to 0.
side_offset: Var[int]
# Minimum distance to maintain between the arrow and the edges of the popup. Use it to prevent the arrow element from hangin | props["data-slot"] = "menu-portal" |
e render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu trigger component."""
props["data-slot"] = "menu-trigger"
cls.set_class_name(ClassNames.TRIGGER, props)
return super().create(*children, **props)
class MenuPortal(MenuBaseComponent):
"""A portal element that moves the popup to a different part of the DOM. By default, the portal element is appended to <body>."""
tag = "Menu.Portal"
# A parent element to render the portal element into.
container: Var[str]
# Whether to keep the portal mounted in the DOM while the popup is hidden. Defaults to False.
keep_mounted: Var[bool]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu portal component."""
props["data-slot"] = "menu-portal"
cls.set_class_name(ClassNames.PORTAL, props)
return super().create(*children, **props)
|
class MenuPopup(MenuBaseComponent):
"""A container for the menu items. Renders a <div> element."""
tag = "Menu.Popup"
# Determines the element to focus when the menu is closed. By default, focus returns to the trigger.
final_focus: Var[str]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu popup component."""
props["data-slot"] = "menu-popup"
cls.set_class_name(ClassNames.POPUP, props)
return super().create(*children, **props)
class MenuArrow(MenuBaseComponent):
"""Displays an element positioned against the menu anchor. Renders a <div> element."""
tag = "Menu.Arrow"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu arrow component."""
props["data-slot"] = "menu-arrow"
cls.set_class_name(ClassNames.ARROW, pr | class MenuPositioner(MenuBaseComponent):
"""Positions the menu popup against the trigger. Renders a <div> element."""
tag = "Menu.Positioner"
# Determines how to handle collisions when positioning the popup.
collision_avoidance: Var[bool | LiteralCollisionAvoidance]
# How to align the popup relative to the specified side. Defaults to "center".
align: Var[LiteralAlign]
# Additional offset along the alignment axis in pixels. Defaults to 0.
align_offset: Var[int]
# Which side of the anchor element to align the popup against. May automatically change to avoid collisions. Defaults to "bottom".
side: Var[LiteralSide]
# Distance between the anchor and the popup in pixels. Defaults to 0.
side_offset: Var[int]
# Minimum distance to maintain between the arrow and the edges of the popup. Use it to prevent the arrow element from hanging out of the rounded corners of a popup. Defaults to 5.
arrow_padding: Var[int]
# Additional space to maintain from the edge of the collision boundary. Defaults to 5.
collision_padding: Var[int]
# An element or a rectangle that delimits the area that the popup is confined to. Defaults to the "clipping-ancestors".
collision_boundary: Var[str]
# Whether to maintain the popup in the viewport after the anchor element was scrolled out of view. Defaults to False.
sticky: Var[bool]
# Whether the popup tracks any layout shift of its positioning anchor. Defaults to True.
track_anchor: Var[bool]
# Determines which CSS position property to use. Defaults to "absolute".
position_method: Var[LiteralPositionMethod]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu positioner component."""
props["data-slot"] = "menu-positioner"
props.setdefault("side_offset", 4)
cls.set_class_name(ClassNames.POSITIONER, props)
return super().create(*children, **props) |
"""Create the menu trigger component."""
props["data-slot"] = "menu-trigger"
cls.set_class_name(ClassNames.TRIGGER, props)
return super().create(*children, **props)
class MenuPortal(MenuBaseComponent):
"""A portal element that moves the popup to a different part of the DOM. By default, the portal element is appended to <body>."""
tag = "Menu.Portal"
# A parent element to render the portal element into.
container: Var[str]
# Whether to keep the portal mounted in the DOM while the popup is hidden. Defaults to False.
keep_mounted: Var[bool]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu portal component."""
props["data-slot"] = "menu-portal"
cls.set_class_name(ClassNames.PORTAL, props)
return super().create(*children, **props)
class MenuPositioner(MenuBaseComponent):
"""Positions the menu popup against the trigger. Renders a <div> element."""
|
# Determines how to handle collisions when positioning the popup.
collision_avoidance: Var[bool | LiteralCollisionAvoidance]
# How to align the popup relative to the specified side. Defaults to "center".
align: Var[LiteralAlign]
# Additional offset along the alignment axis in pixels. Defaults to 0.
align_offset: Var[int]
# Which side of the anchor element to align the popup against. May automatically change to avoid collisions. Defaults to "bottom".
side: Var[LiteralSide]
# Distance between the anchor and the popup in pixels. Defaults to 0.
side_offset: Var[int]
# Minimum distance to maintain between the arrow and the edges of the popup. Use it to prevent the arrow element from hanging out of the rounded corners of a popup. Defaults to 5.
arrow_padding: Var[int]
# Additional space to maintain from the edge of the collision boundary. Defaults to 5.
collision_padding: Var[int]
# An element or a rectangle that delimits t | tag = "Menu.Positioner" |
aults to 0.
side_offset: Var[int]
# Minimum distance to maintain between the arrow and the edges of the popup. Use it to prevent the arrow element from hanging out of the rounded corners of a popup. Defaults to 5.
arrow_padding: Var[int]
# Additional space to maintain from the edge of the collision boundary. Defaults to 5.
collision_padding: Var[int]
# An element or a rectangle that delimits the area that the popup is confined to. Defaults to the "clipping-ancestors".
collision_boundary: Var[str]
# Whether to maintain the popup in the viewport after the anchor element was scrolled out of view. Defaults to False.
sticky: Var[bool]
# Whether the popup tracks any layout shift of its positioning anchor. Defaults to True.
track_anchor: Var[bool]
# Determines which CSS position property to use. Defaults to "absolute".
position_method: Var[LiteralPositionMethod]
# The render prop.
render_: Var[Component]
@classmethod
|
class MenuPopup(MenuBaseComponent):
"""A container for the menu items. Renders a <div> element."""
tag = "Menu.Popup"
# Determines the element to focus when the menu is closed. By default, focus returns to the trigger.
final_focus: Var[str]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu popup component."""
props["data-slot"] = "menu-popup"
cls.set_class_name(ClassNames.POPUP, props)
return super().create(*children, **props)
class MenuArrow(MenuBaseComponent):
"""Displays an element positioned against the menu anchor. Renders a <div> element."""
tag = "Menu.Arrow"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu arrow component."""
props["data-slot"] = "menu-arrow"
cls.set_class_name(ClassNames.ARROW, pr | def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu positioner component."""
props["data-slot"] = "menu-positioner"
props.setdefault("side_offset", 4)
cls.set_class_name(ClassNames.POSITIONER, props)
return super().create(*children, **props) |
up. Use it to prevent the arrow element from hanging out of the rounded corners of a popup. Defaults to 5.
arrow_padding: Var[int]
# Additional space to maintain from the edge of the collision boundary. Defaults to 5.
collision_padding: Var[int]
# An element or a rectangle that delimits the area that the popup is confined to. Defaults to the "clipping-ancestors".
collision_boundary: Var[str]
# Whether to maintain the popup in the viewport after the anchor element was scrolled out of view. Defaults to False.
sticky: Var[bool]
# Whether the popup tracks any layout shift of its positioning anchor. Defaults to True.
track_anchor: Var[bool]
# Determines which CSS position property to use. Defaults to "absolute".
position_method: Var[LiteralPositionMethod]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu positioner component."""
|
props.setdefault("side_offset", 4)
cls.set_class_name(ClassNames.POSITIONER, props)
return super().create(*children, **props)
class MenuPopup(MenuBaseComponent):
"""A container for the menu items. Renders a <div> element."""
tag = "Menu.Popup"
# Determines the element to focus when the menu is closed. By default, focus returns to the trigger.
final_focus: Var[str]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu popup component."""
props["data-slot"] = "menu-popup"
cls.set_class_name(ClassNames.POPUP, props)
return super().create(*children, **props)
class MenuArrow(MenuBaseComponent):
"""Displays an element positioned against the menu anchor. Renders a <div> element."""
tag = "Menu.Arrow"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> Bas | props["data-slot"] = "menu-positioner" |
limits the area that the popup is confined to. Defaults to the "clipping-ancestors".
collision_boundary: Var[str]
# Whether to maintain the popup in the viewport after the anchor element was scrolled out of view. Defaults to False.
sticky: Var[bool]
# Whether the popup tracks any layout shift of its positioning anchor. Defaults to True.
track_anchor: Var[bool]
# Determines which CSS position property to use. Defaults to "absolute".
position_method: Var[LiteralPositionMethod]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu positioner component."""
props["data-slot"] = "menu-positioner"
props.setdefault("side_offset", 4)
cls.set_class_name(ClassNames.POSITIONER, props)
return super().create(*children, **props)
class MenuPopup(MenuBaseComponent):
"""A container for the menu items. Renders a <div> element."""
|
# Determines the element to focus when the menu is closed. By default, focus returns to the trigger.
final_focus: Var[str]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu popup component."""
props["data-slot"] = "menu-popup"
cls.set_class_name(ClassNames.POPUP, props)
return super().create(*children, **props)
class MenuArrow(MenuBaseComponent):
"""Displays an element positioned against the menu anchor. Renders a <div> element."""
tag = "Menu.Arrow"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu arrow component."""
props["data-slot"] = "menu-arrow"
cls.set_class_name(ClassNames.ARROW, props)
return super().create(*children, **props)
class MenuItem(MenuBaseComponent):
"""An individual interactive item | tag = "Menu.Popup" |
faults to False.
sticky: Var[bool]
# Whether the popup tracks any layout shift of its positioning anchor. Defaults to True.
track_anchor: Var[bool]
# Determines which CSS position property to use. Defaults to "absolute".
position_method: Var[LiteralPositionMethod]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu positioner component."""
props["data-slot"] = "menu-positioner"
props.setdefault("side_offset", 4)
cls.set_class_name(ClassNames.POSITIONER, props)
return super().create(*children, **props)
class MenuPopup(MenuBaseComponent):
"""A container for the menu items. Renders a <div> element."""
tag = "Menu.Popup"
# Determines the element to focus when the menu is closed. By default, focus returns to the trigger.
final_focus: Var[str]
# The render prop
render_: Var[Component]
@classmethod
|
class MenuArrow(MenuBaseComponent):
"""Displays an element positioned against the menu anchor. Renders a <div> element."""
tag = "Menu.Arrow"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu arrow component."""
props["data-slot"] = "menu-arrow"
cls.set_class_name(ClassNames.ARROW, props)
return super().create(*children, **props)
class MenuItem(MenuBaseComponent):
"""An individual interactive item in the menu. Renders a <div> element."""
tag = "Menu.Item"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Whether to close the menu when the item is clicked. Defaults to True.
close_on_click: Var[bool]
# 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. <d | def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu popup component."""
props["data-slot"] = "menu-popup"
cls.set_class_name(ClassNames.POPUP, props)
return super().create(*children, **props) |
or. Defaults to True.
track_anchor: Var[bool]
# Determines which CSS position property to use. Defaults to "absolute".
position_method: Var[LiteralPositionMethod]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu positioner component."""
props["data-slot"] = "menu-positioner"
props.setdefault("side_offset", 4)
cls.set_class_name(ClassNames.POSITIONER, props)
return super().create(*children, **props)
class MenuPopup(MenuBaseComponent):
"""A container for the menu items. Renders a <div> element."""
tag = "Menu.Popup"
# Determines the element to focus when the menu is closed. By default, focus returns to the trigger.
final_focus: Var[str]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu popup component."""
|
cls.set_class_name(ClassNames.POPUP, props)
return super().create(*children, **props)
class MenuArrow(MenuBaseComponent):
"""Displays an element positioned against the menu anchor. Renders a <div> element."""
tag = "Menu.Arrow"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu arrow component."""
props["data-slot"] = "menu-arrow"
cls.set_class_name(ClassNames.ARROW, props)
return super().create(*children, **props)
class MenuItem(MenuBaseComponent):
"""An individual interactive item in the menu. Renders a <div> element."""
tag = "Menu.Item"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Whether to close the menu when the item is clicked. Defaults to True.
close_on_click: Var[bool]
# Whether the component renders a native <button> elemen | props["data-slot"] = "menu-popup" |
on_method: Var[LiteralPositionMethod]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu positioner component."""
props["data-slot"] = "menu-positioner"
props.setdefault("side_offset", 4)
cls.set_class_name(ClassNames.POSITIONER, props)
return super().create(*children, **props)
class MenuPopup(MenuBaseComponent):
"""A container for the menu items. Renders a <div> element."""
tag = "Menu.Popup"
# Determines the element to focus when the menu is closed. By default, focus returns to the trigger.
final_focus: Var[str]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu popup component."""
props["data-slot"] = "menu-popup"
cls.set_class_name(ClassNames.POPUP, props)
return super().create(*children, **props)
|
class MenuItem(MenuBaseComponent):
"""An individual interactive item in the menu. Renders a <div> element."""
tag = "Menu.Item"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Whether to close the menu when the item is clicked. Defaults to True.
close_on_click: Var[bool]
# 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu item component."""
props["data-slot"] = "menu-item"
cls.set_class_name(ClassNames.ITEM, props)
return super().create(*children, **prop | class MenuArrow(MenuBaseComponent):
"""Displays an element positioned against the menu anchor. Renders a <div> element."""
tag = "Menu.Arrow"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu arrow component."""
props["data-slot"] = "menu-arrow"
cls.set_class_name(ClassNames.ARROW, props)
return super().create(*children, **props) |
ldren, **props) -> BaseUIComponent:
"""Create the menu positioner component."""
props["data-slot"] = "menu-positioner"
props.setdefault("side_offset", 4)
cls.set_class_name(ClassNames.POSITIONER, props)
return super().create(*children, **props)
class MenuPopup(MenuBaseComponent):
"""A container for the menu items. Renders a <div> element."""
tag = "Menu.Popup"
# Determines the element to focus when the menu is closed. By default, focus returns to the trigger.
final_focus: Var[str]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu popup component."""
props["data-slot"] = "menu-popup"
cls.set_class_name(ClassNames.POPUP, props)
return super().create(*children, **props)
class MenuArrow(MenuBaseComponent):
"""Displays an element positioned against the menu anchor. Renders a <div> element."""
|
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu arrow component."""
props["data-slot"] = "menu-arrow"
cls.set_class_name(ClassNames.ARROW, props)
return super().create(*children, **props)
class MenuItem(MenuBaseComponent):
"""An individual interactive item in the menu. Renders a <div> element."""
tag = "Menu.Item"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Whether to close the menu when the item is clicked. Defaults to True.
close_on_click: Var[bool]
# 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[b | tag = "Menu.Arrow" |
props["data-slot"] = "menu-positioner"
props.setdefault("side_offset", 4)
cls.set_class_name(ClassNames.POSITIONER, props)
return super().create(*children, **props)
class MenuPopup(MenuBaseComponent):
"""A container for the menu items. Renders a <div> element."""
tag = "Menu.Popup"
# Determines the element to focus when the menu is closed. By default, focus returns to the trigger.
final_focus: Var[str]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu popup component."""
props["data-slot"] = "menu-popup"
cls.set_class_name(ClassNames.POPUP, props)
return super().create(*children, **props)
class MenuArrow(MenuBaseComponent):
"""Displays an element positioned against the menu anchor. Renders a <div> element."""
tag = "Menu.Arrow"
# The render prop
render_: Var[Component]
@classmethod
|
class MenuItem(MenuBaseComponent):
"""An individual interactive item in the menu. Renders a <div> element."""
tag = "Menu.Item"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Whether to close the menu when the item is clicked. Defaults to True.
close_on_click: Var[bool]
# 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu item component."""
props["data-slot"] = "menu-item"
cls.set_class_name(ClassNames.ITEM, props)
return super().create(*children, **prop | def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu arrow component."""
props["data-slot"] = "menu-arrow"
cls.set_class_name(ClassNames.ARROW, props)
return super().create(*children, **props) |
for the menu items. Renders a <div> element."""
tag = "Menu.Popup"
# Determines the element to focus when the menu is closed. By default, focus returns to the trigger.
final_focus: Var[str]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu popup component."""
props["data-slot"] = "menu-popup"
cls.set_class_name(ClassNames.POPUP, props)
return super().create(*children, **props)
class MenuArrow(MenuBaseComponent):
"""Displays an element positioned against the menu anchor. Renders a <div> element."""
tag = "Menu.Arrow"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu arrow component."""
props["data-slot"] = "menu-arrow"
cls.set_class_name(ClassNames.ARROW, props)
return super().create(*children, **props)
|
class MenuSubMenuRoot(MenuBaseComponent):
"""Groups all parts of a submenu. Doesn't render its own HTML element."""
tag = "Menu.SubMenuRoot"
# Whether the menu is initially open. To render a controlled menu, use the open prop instead. Defaults to False.
default_open: Var[bool]
# Whether the menu is currently open.
open: Var[bool]
# Event handler called when the menu is opened or closed.
on_open_change: EventHandler[passthrough_event_spec(bool, dict)]
# When in a submenu, determines whether pressing the Escape key closes the entire menu, or only the current child menu. Defaults to True.
close_parent_on_esc: Var[bool]
# Event handler called after any animations complete when the menu is closed.
on_open_change_complete: EventHandler[passthrough_event_spec(bool)]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# Whether the menu should also open when the trigger is hovered. | class MenuItem(MenuBaseComponent):
"""An individual interactive item in the menu. Renders a <div> element."""
tag = "Menu.Item"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Whether to close the menu when the item is clicked. Defaults to True.
close_on_click: Var[bool]
# 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu item component."""
props["data-slot"] = "menu-item"
cls.set_class_name(ClassNames.ITEM, props)
return super().create(*children, **props) |
e menu is closed. By default, focus returns to the trigger.
final_focus: Var[str]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu popup component."""
props["data-slot"] = "menu-popup"
cls.set_class_name(ClassNames.POPUP, props)
return super().create(*children, **props)
class MenuArrow(MenuBaseComponent):
"""Displays an element positioned against the menu anchor. Renders a <div> element."""
tag = "Menu.Arrow"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu arrow component."""
props["data-slot"] = "menu-arrow"
cls.set_class_name(ClassNames.ARROW, props)
return super().create(*children, **props)
class MenuItem(MenuBaseComponent):
"""An individual interactive item in the menu. Renders a <div> element."""
|
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Whether to close the menu when the item is clicked. Defaults to True.
close_on_click: Var[bool]
# 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu item component."""
props["data-slot"] = "menu-item"
cls.set_class_name(ClassNames.ITEM, props)
return super().create(*children, **props)
class MenuSubMenuRoot(MenuBaseComponent):
"""Groups all parts of a submenu. Doesn't render its own HTML element."""
tag = "Me | tag = "Menu.Item" |
reate(cls, *children, **props) -> BaseUIComponent:
"""Create the menu arrow component."""
props["data-slot"] = "menu-arrow"
cls.set_class_name(ClassNames.ARROW, props)
return super().create(*children, **props)
class MenuItem(MenuBaseComponent):
"""An individual interactive item in the menu. Renders a <div> element."""
tag = "Menu.Item"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Whether to close the menu when the item is clicked. Defaults to True.
close_on_click: Var[bool]
# 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
|
class MenuSubMenuRoot(MenuBaseComponent):
"""Groups all parts of a submenu. Doesn't render its own HTML element."""
tag = "Menu.SubMenuRoot"
# Whether the menu is initially open. To render a controlled menu, use the open prop instead. Defaults to False.
default_open: Var[bool]
# Whether the menu is currently open.
open: Var[bool]
# Event handler called when the menu is opened or closed.
on_open_change: EventHandler[passthrough_event_spec(bool, dict)]
# When in a submenu, determines whether pressing the Escape key closes the entire menu, or only the current child menu. Defaults to True.
close_parent_on_esc: Var[bool]
# Event handler called after any animations complete when the menu is closed.
on_open_change_complete: EventHandler[passthrough_event_spec(bool)]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# Whether the menu should also open when the trigger is hovered. | def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu item component."""
props["data-slot"] = "menu-item"
cls.set_class_name(ClassNames.ITEM, props)
return super().create(*children, **props) |
s["data-slot"] = "menu-arrow"
cls.set_class_name(ClassNames.ARROW, props)
return super().create(*children, **props)
class MenuItem(MenuBaseComponent):
"""An individual interactive item in the menu. Renders a <div> element."""
tag = "Menu.Item"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Whether to close the menu when the item is clicked. Defaults to True.
close_on_click: Var[bool]
# 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu item component."""
|
cls.set_class_name(ClassNames.ITEM, props)
return super().create(*children, **props)
class MenuSubMenuRoot(MenuBaseComponent):
"""Groups all parts of a submenu. Doesn't render its own HTML element."""
tag = "Menu.SubMenuRoot"
# Whether the menu is initially open. To render a controlled menu, use the open prop instead. Defaults to False.
default_open: Var[bool]
# Whether the menu is currently open.
open: Var[bool]
# Event handler called when the menu is opened or closed.
on_open_change: EventHandler[passthrough_event_spec(bool, dict)]
# When in a submenu, determines whether pressing the Escape key closes the entire menu, or only the current child menu. Defaults to True.
close_parent_on_esc: Var[bool]
# Event handler called after any animations complete when the menu is closed.
on_open_change_complete: EventHandler[passthrough_event_spec(bool)]
# Whether the component should ignore user interaction. Defaults to | props["data-slot"] = "menu-item" |
ass MenuItem(MenuBaseComponent):
"""An individual interactive item in the menu. Renders a <div> element."""
tag = "Menu.Item"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Whether to close the menu when the item is clicked. Defaults to True.
close_on_click: Var[bool]
# 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu item component."""
props["data-slot"] = "menu-item"
cls.set_class_name(ClassNames.ITEM, props)
return super().create(*children, **props)
|
class MenuSubMenuTrigger(MenuBaseComponent):
"""A menu item that opens a submenu."""
tag = "Menu.SubMenuTrigger"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: 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 False.
native_button: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu submenu trigger component."""
props["data-slot"] = "menu-submenu-trigger"
cls.set_class_name(ClassNames.SUBMENU_TRIGGER, props)
return super().create(*children, **props)
class MenuGroup(MenuBaseComponent):
"""Groups related menu items with the corresponding label. Renders a <div> element."""
tag = "Menu.Group"
# The render prop
render_: Va | class MenuSubMenuRoot(MenuBaseComponent):
"""Groups all parts of a submenu. Doesn't render its own HTML element."""
tag = "Menu.SubMenuRoot"
# Whether the menu is initially open. To render a controlled menu, use the open prop instead. Defaults to False.
default_open: Var[bool]
# Whether the menu is currently open.
open: Var[bool]
# Event handler called when the menu is opened or closed.
on_open_change: EventHandler[passthrough_event_spec(bool, dict)]
# When in a submenu, determines whether pressing the Escape key closes the entire menu, or only the current child menu. Defaults to True.
close_parent_on_esc: Var[bool]
# Event handler called after any animations complete when the menu is closed.
on_open_change_complete: EventHandler[passthrough_event_spec(bool)]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# Whether the menu should also open when the trigger is hovered. Defaults to True.
open_on_hover: Var[bool]
# How long to wait before the menu may be opened on hover. Specified in milliseconds. Requires the open_on_hover prop. Defaults to 100.
delay: Var[int]
# How long to wait before closing the menu that was opened on hover. Specified in milliseconds. Requires the open_on_hover prop. Defaults to 0.
close_delay: Var[int]
# Whether to loop keyboard 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]
# The visual orientation of the menu. Controls whether roving focus uses up/down or left/right arrow keys. Defaults to 'vertical'.
orientation: Var[LiteralMenuOrientation]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu submenu root component."""
props["data-slot"] = "menu-submenu-root"
cls.set_class_name(ClassNames.ITEM_TEXT, props)
return super().create(*children, **props) |
enu.Item"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Whether to close the menu when the item is clicked. Defaults to True.
close_on_click: Var[bool]
# 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu item component."""
props["data-slot"] = "menu-item"
cls.set_class_name(ClassNames.ITEM, props)
return super().create(*children, **props)
class MenuSubMenuRoot(MenuBaseComponent):
"""Groups all parts of a submenu. Doesn't render its own HTML element."""
|
# Whether the menu is initially open. To render a controlled menu, use the open prop instead. Defaults to False.
default_open: Var[bool]
# Whether the menu is currently open.
open: Var[bool]
# Event handler called when the menu is opened or closed.
on_open_change: EventHandler[passthrough_event_spec(bool, dict)]
# When in a submenu, determines whether pressing the Escape key closes the entire menu, or only the current child menu. Defaults to True.
close_parent_on_esc: Var[bool]
# Event handler called after any animations complete when the menu is closed.
on_open_change_complete: EventHandler[passthrough_event_spec(bool)]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# Whether the menu should also open when the trigger is hovered. Defaults to True.
open_on_hover: Var[bool]
# How long to wait before the menu may be opened on hover. Specified in milliseconds. Requires the | tag = "Menu.SubMenuRoot" |
hrough_event_spec(bool)]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# Whether the menu should also open when the trigger is hovered. Defaults to True.
open_on_hover: Var[bool]
# How long to wait before the menu may be opened on hover. Specified in milliseconds. Requires the open_on_hover prop. Defaults to 100.
delay: Var[int]
# How long to wait before closing the menu that was opened on hover. Specified in milliseconds. Requires the open_on_hover prop. Defaults to 0.
close_delay: Var[int]
# Whether to loop keyboard 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]
# The visual orientation of the menu. Controls whether roving focus uses up/down or left/right arrow keys. Defaults to 'vertical'.
orientation: Var[LiteralMenuOrientation]
# The render prop.
render_: Var[Component]
@classmethod
|
class MenuSubMenuTrigger(MenuBaseComponent):
"""A menu item that opens a submenu."""
tag = "Menu.SubMenuTrigger"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: 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 False.
native_button: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu submenu trigger component."""
props["data-slot"] = "menu-submenu-trigger"
cls.set_class_name(ClassNames.SUBMENU_TRIGGER, props)
return super().create(*children, **props)
class MenuGroup(MenuBaseComponent):
"""Groups related menu items with the corresponding label. Renders a <div> element."""
tag = "Menu.Group"
# The render prop
render_: Va | def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu submenu root component."""
props["data-slot"] = "menu-submenu-root"
cls.set_class_name(ClassNames.ITEM_TEXT, props)
return super().create(*children, **props) |
Var[bool]
# Whether the menu should also open when the trigger is hovered. Defaults to True.
open_on_hover: Var[bool]
# How long to wait before the menu may be opened on hover. Specified in milliseconds. Requires the open_on_hover prop. Defaults to 100.
delay: Var[int]
# How long to wait before closing the menu that was opened on hover. Specified in milliseconds. Requires the open_on_hover prop. Defaults to 0.
close_delay: Var[int]
# Whether to loop keyboard 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]
# The visual orientation of the menu. Controls whether roving focus uses up/down or left/right arrow keys. Defaults to 'vertical'.
orientation: Var[LiteralMenuOrientation]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu submenu root component."""
|
cls.set_class_name(ClassNames.ITEM_TEXT, props)
return super().create(*children, **props)
class MenuSubMenuTrigger(MenuBaseComponent):
"""A menu item that opens a submenu."""
tag = "Menu.SubMenuTrigger"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: 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 False.
native_button: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu submenu trigger component."""
props["data-slot"] = "menu-submenu-trigger"
cls.set_class_name(ClassNames.SUBMENU_TRIGGER, props)
return super().create(*children, **props)
class MenuGroup(MenuBaseComponent):
"""Groups related menu items with the corre | props["data-slot"] = "menu-submenu-root" |
it before the menu may be opened on hover. Specified in milliseconds. Requires the open_on_hover prop. Defaults to 100.
delay: Var[int]
# How long to wait before closing the menu that was opened on hover. Specified in milliseconds. Requires the open_on_hover prop. Defaults to 0.
close_delay: Var[int]
# Whether to loop keyboard 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]
# The visual orientation of the menu. Controls whether roving focus uses up/down or left/right arrow keys. Defaults to 'vertical'.
orientation: Var[LiteralMenuOrientation]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu submenu root component."""
props["data-slot"] = "menu-submenu-root"
cls.set_class_name(ClassNames.ITEM_TEXT, props)
return super().create(*children, **props)
|
class MenuGroup(MenuBaseComponent):
"""Groups related menu items with the corresponding label. Renders a <div> element."""
tag = "Menu.Group"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group component."""
props["data-slot"] = "menu-group"
cls.set_class_name(ClassNames.GROUP, props)
return super().create(*children, **props)
class MenuGroupLabel(MenuBaseComponent):
"""An accessible label that is automatically associated with its parent group. Renders a <div> element."""
tag = "Menu.GroupLabel"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group label component."""
props["data-slot"] = "menu-group-label"
cls.set_class_name(ClassNames.GROUP_LABEL, props)
return super().create(*children, **props)
cla | class MenuSubMenuTrigger(MenuBaseComponent):
"""A menu item that opens a submenu."""
tag = "Menu.SubMenuTrigger"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: 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 False.
native_button: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu submenu trigger component."""
props["data-slot"] = "menu-submenu-trigger"
cls.set_class_name(ClassNames.SUBMENU_TRIGGER, props)
return super().create(*children, **props) |
er prop. Defaults to 100.
delay: Var[int]
# How long to wait before closing the menu that was opened on hover. Specified in milliseconds. Requires the open_on_hover prop. Defaults to 0.
close_delay: Var[int]
# Whether to loop keyboard 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]
# The visual orientation of the menu. Controls whether roving focus uses up/down or left/right arrow keys. Defaults to 'vertical'.
orientation: Var[LiteralMenuOrientation]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu submenu root component."""
props["data-slot"] = "menu-submenu-root"
cls.set_class_name(ClassNames.ITEM_TEXT, props)
return super().create(*children, **props)
class MenuSubMenuTrigger(MenuBaseComponent):
"""A menu item that opens a submenu."""
|
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: 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 False.
native_button: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu submenu trigger component."""
props["data-slot"] = "menu-submenu-trigger"
cls.set_class_name(ClassNames.SUBMENU_TRIGGER, props)
return super().create(*children, **props)
class MenuGroup(MenuBaseComponent):
"""Groups related menu items with the corresponding label. Renders a <div> element."""
tag = "Menu.Group"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group | tag = "Menu.SubMenuTrigger" |
whether roving focus uses up/down or left/right arrow keys. Defaults to 'vertical'.
orientation: Var[LiteralMenuOrientation]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu submenu root component."""
props["data-slot"] = "menu-submenu-root"
cls.set_class_name(ClassNames.ITEM_TEXT, props)
return super().create(*children, **props)
class MenuSubMenuTrigger(MenuBaseComponent):
"""A menu item that opens a submenu."""
tag = "Menu.SubMenuTrigger"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: 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 False.
native_button: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
|
class MenuGroup(MenuBaseComponent):
"""Groups related menu items with the corresponding label. Renders a <div> element."""
tag = "Menu.Group"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group component."""
props["data-slot"] = "menu-group"
cls.set_class_name(ClassNames.GROUP, props)
return super().create(*children, **props)
class MenuGroupLabel(MenuBaseComponent):
"""An accessible label that is automatically associated with its parent group. Renders a <div> element."""
tag = "Menu.GroupLabel"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group label component."""
props["data-slot"] = "menu-group-label"
cls.set_class_name(ClassNames.GROUP_LABEL, props)
return super().create(*children, **props)
cla | def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu submenu trigger component."""
props["data-slot"] = "menu-submenu-trigger"
cls.set_class_name(ClassNames.SUBMENU_TRIGGER, props)
return super().create(*children, **props) |
ntation]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu submenu root component."""
props["data-slot"] = "menu-submenu-root"
cls.set_class_name(ClassNames.ITEM_TEXT, props)
return super().create(*children, **props)
class MenuSubMenuTrigger(MenuBaseComponent):
"""A menu item that opens a submenu."""
tag = "Menu.SubMenuTrigger"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: 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 False.
native_button: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu submenu trigger component."""
|
cls.set_class_name(ClassNames.SUBMENU_TRIGGER, props)
return super().create(*children, **props)
class MenuGroup(MenuBaseComponent):
"""Groups related menu items with the corresponding label. Renders a <div> element."""
tag = "Menu.Group"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group component."""
props["data-slot"] = "menu-group"
cls.set_class_name(ClassNames.GROUP, props)
return super().create(*children, **props)
class MenuGroupLabel(MenuBaseComponent):
"""An accessible label that is automatically associated with its parent group. Renders a <div> element."""
tag = "Menu.GroupLabel"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group label component."""
props["data-slot"] = "menu-group-label"
| props["data-slot"] = "menu-submenu-trigger" |
he menu submenu root component."""
props["data-slot"] = "menu-submenu-root"
cls.set_class_name(ClassNames.ITEM_TEXT, props)
return super().create(*children, **props)
class MenuSubMenuTrigger(MenuBaseComponent):
"""A menu item that opens a submenu."""
tag = "Menu.SubMenuTrigger"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: 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 False.
native_button: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu submenu trigger component."""
props["data-slot"] = "menu-submenu-trigger"
cls.set_class_name(ClassNames.SUBMENU_TRIGGER, props)
return super().create(*children, **props)
|
class MenuGroupLabel(MenuBaseComponent):
"""An accessible label that is automatically associated with its parent group. Renders a <div> element."""
tag = "Menu.GroupLabel"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group label component."""
props["data-slot"] = "menu-group-label"
cls.set_class_name(ClassNames.GROUP_LABEL, props)
return super().create(*children, **props)
class MenuRadioGroup(MenuBaseComponent):
"""Groups related radio items. Renders a <div> element."""
tag = "Menu.RadioGroup"
# The uncontrolled value of the radio item that should be initially selected. To render a controlled radio group, use the value prop instead.
default_value: Var[str | int]
# The controlled value of the radio item that should be currently selected. To render an uncontrolled radio group, use the defaultValue prop instead.
val | class MenuGroup(MenuBaseComponent):
"""Groups related menu items with the corresponding label. Renders a <div> element."""
tag = "Menu.Group"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group component."""
props["data-slot"] = "menu-group"
cls.set_class_name(ClassNames.GROUP, props)
return super().create(*children, **props) |
props)
return super().create(*children, **props)
class MenuSubMenuTrigger(MenuBaseComponent):
"""A menu item that opens a submenu."""
tag = "Menu.SubMenuTrigger"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: 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 False.
native_button: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu submenu trigger component."""
props["data-slot"] = "menu-submenu-trigger"
cls.set_class_name(ClassNames.SUBMENU_TRIGGER, props)
return super().create(*children, **props)
class MenuGroup(MenuBaseComponent):
"""Groups related menu items with the corresponding label. Renders a <div> element."""
|
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group component."""
props["data-slot"] = "menu-group"
cls.set_class_name(ClassNames.GROUP, props)
return super().create(*children, **props)
class MenuGroupLabel(MenuBaseComponent):
"""An accessible label that is automatically associated with its parent group. Renders a <div> element."""
tag = "Menu.GroupLabel"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group label component."""
props["data-slot"] = "menu-group-label"
cls.set_class_name(ClassNames.GROUP_LABEL, props)
return super().create(*children, **props)
class MenuRadioGroup(MenuBaseComponent):
"""Groups related radio items. Renders a <div> element."""
tag = "Menu.RadioGroup"
# The uncontrolled | tag = "Menu.Group" |
eComponent):
"""A menu item that opens a submenu."""
tag = "Menu.SubMenuTrigger"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: 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 False.
native_button: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu submenu trigger component."""
props["data-slot"] = "menu-submenu-trigger"
cls.set_class_name(ClassNames.SUBMENU_TRIGGER, props)
return super().create(*children, **props)
class MenuGroup(MenuBaseComponent):
"""Groups related menu items with the corresponding label. Renders a <div> element."""
tag = "Menu.Group"
# The render prop
render_: Var[Component]
@classmethod
|
class MenuGroupLabel(MenuBaseComponent):
"""An accessible label that is automatically associated with its parent group. Renders a <div> element."""
tag = "Menu.GroupLabel"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group label component."""
props["data-slot"] = "menu-group-label"
cls.set_class_name(ClassNames.GROUP_LABEL, props)
return super().create(*children, **props)
class MenuRadioGroup(MenuBaseComponent):
"""Groups related radio items. Renders a <div> element."""
tag = "Menu.RadioGroup"
# The uncontrolled value of the radio item that should be initially selected. To render a controlled radio group, use the value prop instead.
default_value: Var[str | int]
# The controlled value of the radio item that should be currently selected. To render an uncontrolled radio group, use the defaultValue prop instead.
val | def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group component."""
props["data-slot"] = "menu-group"
cls.set_class_name(ClassNames.GROUP, props)
return super().create(*children, **props) |
text label to use when the item is matched during keyboard text navigation.
label: 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 False.
native_button: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu submenu trigger component."""
props["data-slot"] = "menu-submenu-trigger"
cls.set_class_name(ClassNames.SUBMENU_TRIGGER, props)
return super().create(*children, **props)
class MenuGroup(MenuBaseComponent):
"""Groups related menu items with the corresponding label. Renders a <div> element."""
tag = "Menu.Group"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group component."""
|
cls.set_class_name(ClassNames.GROUP, props)
return super().create(*children, **props)
class MenuGroupLabel(MenuBaseComponent):
"""An accessible label that is automatically associated with its parent group. Renders a <div> element."""
tag = "Menu.GroupLabel"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group label component."""
props["data-slot"] = "menu-group-label"
cls.set_class_name(ClassNames.GROUP_LABEL, props)
return super().create(*children, **props)
class MenuRadioGroup(MenuBaseComponent):
"""Groups related radio items. Renders a <div> element."""
tag = "Menu.RadioGroup"
# The uncontrolled value of the radio item that should be initially selected. To render a controlled radio group, use the value prop instead.
default_value: Var[str | int]
# The controlled value of the radio item that should be | props["data-slot"] = "menu-group" |
ive <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 False.
native_button: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu submenu trigger component."""
props["data-slot"] = "menu-submenu-trigger"
cls.set_class_name(ClassNames.SUBMENU_TRIGGER, props)
return super().create(*children, **props)
class MenuGroup(MenuBaseComponent):
"""Groups related menu items with the corresponding label. Renders a <div> element."""
tag = "Menu.Group"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group component."""
props["data-slot"] = "menu-group"
cls.set_class_name(ClassNames.GROUP, props)
return super().create(*children, **props)
|
class MenuRadioGroup(MenuBaseComponent):
"""Groups related radio items. Renders a <div> element."""
tag = "Menu.RadioGroup"
# The uncontrolled value of the radio item that should be initially selected. To render a controlled radio group, use the value prop instead.
default_value: Var[str | int]
# The controlled value of the radio item that should be currently selected. To render an uncontrolled radio group, use the defaultValue prop instead.
value: Var[str | int]
# Function called when the selected value changes.
on_value_change: EventHandler[passthrough_event_spec(str | int, dict)]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio group component."""
props["data-slot"] = "menu-radio-group"
cls.set_class_name(ClassName | class MenuGroupLabel(MenuBaseComponent):
"""An accessible label that is automatically associated with its parent group. Renders a <div> element."""
tag = "Menu.GroupLabel"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group label component."""
props["data-slot"] = "menu-group-label"
cls.set_class_name(ClassNames.GROUP_LABEL, props)
return super().create(*children, **props) |
button: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu submenu trigger component."""
props["data-slot"] = "menu-submenu-trigger"
cls.set_class_name(ClassNames.SUBMENU_TRIGGER, props)
return super().create(*children, **props)
class MenuGroup(MenuBaseComponent):
"""Groups related menu items with the corresponding label. Renders a <div> element."""
tag = "Menu.Group"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group component."""
props["data-slot"] = "menu-group"
cls.set_class_name(ClassNames.GROUP, props)
return super().create(*children, **props)
class MenuGroupLabel(MenuBaseComponent):
"""An accessible label that is automatically associated with its parent group. Renders a <div> element."""
|
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group label component."""
props["data-slot"] = "menu-group-label"
cls.set_class_name(ClassNames.GROUP_LABEL, props)
return super().create(*children, **props)
class MenuRadioGroup(MenuBaseComponent):
"""Groups related radio items. Renders a <div> element."""
tag = "Menu.RadioGroup"
# The uncontrolled value of the radio item that should be initially selected. To render a controlled radio group, use the value prop instead.
default_value: Var[str | int]
# The controlled value of the radio item that should be currently selected. To render an uncontrolled radio group, use the defaultValue prop instead.
value: Var[str | int]
# Function called when the selected value changes.
on_value_change: EventHandler[passthrough_event_spec(str | int, dict)]
# Whether the component shou | tag = "Menu.GroupLabel" |
eate(cls, *children, **props) -> BaseUIComponent:
"""Create the menu submenu trigger component."""
props["data-slot"] = "menu-submenu-trigger"
cls.set_class_name(ClassNames.SUBMENU_TRIGGER, props)
return super().create(*children, **props)
class MenuGroup(MenuBaseComponent):
"""Groups related menu items with the corresponding label. Renders a <div> element."""
tag = "Menu.Group"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group component."""
props["data-slot"] = "menu-group"
cls.set_class_name(ClassNames.GROUP, props)
return super().create(*children, **props)
class MenuGroupLabel(MenuBaseComponent):
"""An accessible label that is automatically associated with its parent group. Renders a <div> element."""
tag = "Menu.GroupLabel"
# The render prop
render_: Var[Component]
@classmethod
|
class MenuRadioGroup(MenuBaseComponent):
"""Groups related radio items. Renders a <div> element."""
tag = "Menu.RadioGroup"
# The uncontrolled value of the radio item that should be initially selected. To render a controlled radio group, use the value prop instead.
default_value: Var[str | int]
# The controlled value of the radio item that should be currently selected. To render an uncontrolled radio group, use the defaultValue prop instead.
value: Var[str | int]
# Function called when the selected value changes.
on_value_change: EventHandler[passthrough_event_spec(str | int, dict)]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio group component."""
props["data-slot"] = "menu-radio-group"
cls.set_class_name(ClassName | def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group label component."""
props["data-slot"] = "menu-group-label"
cls.set_class_name(ClassNames.GROUP_LABEL, props)
return super().create(*children, **props) |
ops["data-slot"] = "menu-submenu-trigger"
cls.set_class_name(ClassNames.SUBMENU_TRIGGER, props)
return super().create(*children, **props)
class MenuGroup(MenuBaseComponent):
"""Groups related menu items with the corresponding label. Renders a <div> element."""
tag = "Menu.Group"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group component."""
props["data-slot"] = "menu-group"
cls.set_class_name(ClassNames.GROUP, props)
return super().create(*children, **props)
class MenuGroupLabel(MenuBaseComponent):
"""An accessible label that is automatically associated with its parent group. Renders a <div> element."""
tag = "Menu.GroupLabel"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group label component."""
|
cls.set_class_name(ClassNames.GROUP_LABEL, props)
return super().create(*children, **props)
class MenuRadioGroup(MenuBaseComponent):
"""Groups related radio items. Renders a <div> element."""
tag = "Menu.RadioGroup"
# The uncontrolled value of the radio item that should be initially selected. To render a controlled radio group, use the value prop instead.
default_value: Var[str | int]
# The controlled value of the radio item that should be currently selected. To render an uncontrolled radio group, use the defaultValue prop instead.
value: Var[str | int]
# Function called when the selected value changes.
on_value_change: EventHandler[passthrough_event_spec(str | int, dict)]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu ra | props["data-slot"] = "menu-group-label" |
ps)
class MenuGroup(MenuBaseComponent):
"""Groups related menu items with the corresponding label. Renders a <div> element."""
tag = "Menu.Group"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group component."""
props["data-slot"] = "menu-group"
cls.set_class_name(ClassNames.GROUP, props)
return super().create(*children, **props)
class MenuGroupLabel(MenuBaseComponent):
"""An accessible label that is automatically associated with its parent group. Renders a <div> element."""
tag = "Menu.GroupLabel"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group label component."""
props["data-slot"] = "menu-group-label"
cls.set_class_name(ClassNames.GROUP_LABEL, props)
return super().create(*children, **props)
|
class MenuRadioItem(MenuBaseComponent):
"""A menu item that works like a radio button in a given group. Renders a <div> element."""
tag = "Menu.RadioItem"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Value of the radio item. This is the value that will be set in the MenuRadioGroup when the item is selected.
value: Var[str | int]
# Whether to close the menu when the item is clicked. Defaults to False.
close_on_click: Var[bool]
# 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Crea | class MenuRadioGroup(MenuBaseComponent):
"""Groups related radio items. Renders a <div> element."""
tag = "Menu.RadioGroup"
# The uncontrolled value of the radio item that should be initially selected. To render a controlled radio group, use the value prop instead.
default_value: Var[str | int]
# The controlled value of the radio item that should be currently selected. To render an uncontrolled radio group, use the defaultValue prop instead.
value: Var[str | int]
# Function called when the selected value changes.
on_value_change: EventHandler[passthrough_event_spec(str | int, dict)]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio group component."""
props["data-slot"] = "menu-radio-group"
cls.set_class_name(ClassNames.RADIO_GROUP, props)
return super().create(*children, **props) |
ers a <div> element."""
tag = "Menu.Group"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group component."""
props["data-slot"] = "menu-group"
cls.set_class_name(ClassNames.GROUP, props)
return super().create(*children, **props)
class MenuGroupLabel(MenuBaseComponent):
"""An accessible label that is automatically associated with its parent group. Renders a <div> element."""
tag = "Menu.GroupLabel"
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu group label component."""
props["data-slot"] = "menu-group-label"
cls.set_class_name(ClassNames.GROUP_LABEL, props)
return super().create(*children, **props)
class MenuRadioGroup(MenuBaseComponent):
"""Groups related radio items. Renders a <div> element."""
|
# The uncontrolled value of the radio item that should be initially selected. To render a controlled radio group, use the value prop instead.
default_value: Var[str | int]
# The controlled value of the radio item that should be currently selected. To render an uncontrolled radio group, use the defaultValue prop instead.
value: Var[str | int]
# Function called when the selected value changes.
on_value_change: EventHandler[passthrough_event_spec(str | int, dict)]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio group component."""
props["data-slot"] = "menu-radio-group"
cls.set_class_name(ClassNames.RADIO_GROUP, props)
return super().create(*children, **props)
class MenuRadioItem(MenuBaseComponent):
"""A menu item th | tag = "Menu.RadioGroup" |
te the menu group label component."""
props["data-slot"] = "menu-group-label"
cls.set_class_name(ClassNames.GROUP_LABEL, props)
return super().create(*children, **props)
class MenuRadioGroup(MenuBaseComponent):
"""Groups related radio items. Renders a <div> element."""
tag = "Menu.RadioGroup"
# The uncontrolled value of the radio item that should be initially selected. To render a controlled radio group, use the value prop instead.
default_value: Var[str | int]
# The controlled value of the radio item that should be currently selected. To render an uncontrolled radio group, use the defaultValue prop instead.
value: Var[str | int]
# Function called when the selected value changes.
on_value_change: EventHandler[passthrough_event_spec(str | int, dict)]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
|
class MenuRadioItem(MenuBaseComponent):
"""A menu item that works like a radio button in a given group. Renders a <div> element."""
tag = "Menu.RadioItem"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Value of the radio item. This is the value that will be set in the MenuRadioGroup when the item is selected.
value: Var[str | int]
# Whether to close the menu when the item is clicked. Defaults to False.
close_on_click: Var[bool]
# 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Crea | def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio group component."""
props["data-slot"] = "menu-radio-group"
cls.set_class_name(ClassNames.RADIO_GROUP, props)
return super().create(*children, **props) |
sNames.GROUP_LABEL, props)
return super().create(*children, **props)
class MenuRadioGroup(MenuBaseComponent):
"""Groups related radio items. Renders a <div> element."""
tag = "Menu.RadioGroup"
# The uncontrolled value of the radio item that should be initially selected. To render a controlled radio group, use the value prop instead.
default_value: Var[str | int]
# The controlled value of the radio item that should be currently selected. To render an uncontrolled radio group, use the defaultValue prop instead.
value: Var[str | int]
# Function called when the selected value changes.
on_value_change: EventHandler[passthrough_event_spec(str | int, dict)]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio group component."""
|
cls.set_class_name(ClassNames.RADIO_GROUP, props)
return super().create(*children, **props)
class MenuRadioItem(MenuBaseComponent):
"""A menu item that works like a radio button in a given group. Renders a <div> element."""
tag = "Menu.RadioItem"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Value of the radio item. This is the value that will be set in the MenuRadioGroup when the item is selected.
value: Var[str | int]
# Whether to close the menu when the item is clicked. Defaults to False.
close_on_click: Var[bool]
# 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: | props["data-slot"] = "menu-radio-group" |
ems. Renders a <div> element."""
tag = "Menu.RadioGroup"
# The uncontrolled value of the radio item that should be initially selected. To render a controlled radio group, use the value prop instead.
default_value: Var[str | int]
# The controlled value of the radio item that should be currently selected. To render an uncontrolled radio group, use the defaultValue prop instead.
value: Var[str | int]
# Function called when the selected value changes.
on_value_change: EventHandler[passthrough_event_spec(str | int, dict)]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio group component."""
props["data-slot"] = "menu-radio-group"
cls.set_class_name(ClassNames.RADIO_GROUP, props)
return super().create(*children, **props)
|
class MenuRadioItemIndicator(MenuBaseComponent):
"""Indicates whether the radio item is selected. Renders a <div> element."""
tag = "Menu.RadioItemIndicator"
# Whether to keep the HTML element in the DOM when the radio item is inactive. Defaults to False.
keep_mounted: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio item indicator component."""
props["data-slot"] = "menu-radio-item-indicator"
cls.set_class_name(ClassNames.RADIO_ITEM_INDICATOR, props)
return super().create(*children, **props)
class MenuCheckboxItem(MenuBaseComponent):
"""A menu item that toggles a setting on or off. Renders a <div> element."""
tag = "Menu.CheckboxItem"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Whether the checkbox item is initially ticked. To ren | class MenuRadioItem(MenuBaseComponent):
"""A menu item that works like a radio button in a given group. Renders a <div> element."""
tag = "Menu.RadioItem"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Value of the radio item. This is the value that will be set in the MenuRadioGroup when the item is selected.
value: Var[str | int]
# Whether to close the menu when the item is clicked. Defaults to False.
close_on_click: Var[bool]
# 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio item component."""
props["data-slot"] = "menu-radio-item"
cls.set_class_name(ClassNames.RADIO_ITEM, props)
return super().create(*children, **props) |
ed. To render a controlled radio group, use the value prop instead.
default_value: Var[str | int]
# The controlled value of the radio item that should be currently selected. To render an uncontrolled radio group, use the defaultValue prop instead.
value: Var[str | int]
# Function called when the selected value changes.
on_value_change: EventHandler[passthrough_event_spec(str | int, dict)]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio group component."""
props["data-slot"] = "menu-radio-group"
cls.set_class_name(ClassNames.RADIO_GROUP, props)
return super().create(*children, **props)
class MenuRadioItem(MenuBaseComponent):
"""A menu item that works like a radio button in a given group. Renders a <div> element."""
|
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Value of the radio item. This is the value that will be set in the MenuRadioGroup when the item is selected.
value: Var[str | int]
# Whether to close the menu when the item is clicked. Defaults to False.
close_on_click: Var[bool]
# 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio item component."""
props["data-slot"] = "menu-radio-item"
cls.set_class_name(ClassNames.RADIO_ITEM, props)
return super().cr | tag = "Menu.RadioItem" |
s.RADIO_GROUP, props)
return super().create(*children, **props)
class MenuRadioItem(MenuBaseComponent):
"""A menu item that works like a radio button in a given group. Renders a <div> element."""
tag = "Menu.RadioItem"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Value of the radio item. This is the value that will be set in the MenuRadioGroup when the item is selected.
value: Var[str | int]
# Whether to close the menu when the item is clicked. Defaults to False.
close_on_click: Var[bool]
# 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
|
class MenuRadioItemIndicator(MenuBaseComponent):
"""Indicates whether the radio item is selected. Renders a <div> element."""
tag = "Menu.RadioItemIndicator"
# Whether to keep the HTML element in the DOM when the radio item is inactive. Defaults to False.
keep_mounted: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio item indicator component."""
props["data-slot"] = "menu-radio-item-indicator"
cls.set_class_name(ClassNames.RADIO_ITEM_INDICATOR, props)
return super().create(*children, **props)
class MenuCheckboxItem(MenuBaseComponent):
"""A menu item that toggles a setting on or off. Renders a <div> element."""
tag = "Menu.CheckboxItem"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Whether the checkbox item is initially ticked. To ren | def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio item component."""
props["data-slot"] = "menu-radio-item"
cls.set_class_name(ClassNames.RADIO_ITEM, props)
return super().create(*children, **props) |
"""A menu item that works like a radio button in a given group. Renders a <div> element."""
tag = "Menu.RadioItem"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Value of the radio item. This is the value that will be set in the MenuRadioGroup when the item is selected.
value: Var[str | int]
# Whether to close the menu when the item is clicked. Defaults to False.
close_on_click: Var[bool]
# 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio item component."""
|
cls.set_class_name(ClassNames.RADIO_ITEM, props)
return super().create(*children, **props)
class MenuRadioItemIndicator(MenuBaseComponent):
"""Indicates whether the radio item is selected. Renders a <div> element."""
tag = "Menu.RadioItemIndicator"
# Whether to keep the HTML element in the DOM when the radio item is inactive. Defaults to False.
keep_mounted: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio item indicator component."""
props["data-slot"] = "menu-radio-item-indicator"
cls.set_class_name(ClassNames.RADIO_ITEM_INDICATOR, props)
return super().create(*children, **props)
class MenuCheckboxItem(MenuBaseComponent):
"""A menu item that toggles a setting on or off. Renders a <div> element."""
tag = "Menu.CheckboxItem"
# Overrides the text label to use when the item is matched during | props["data-slot"] = "menu-radio-item" |
label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Value of the radio item. This is the value that will be set in the MenuRadioGroup when the item is selected.
value: Var[str | int]
# Whether to close the menu when the item is clicked. Defaults to False.
close_on_click: Var[bool]
# 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio item component."""
props["data-slot"] = "menu-radio-item"
cls.set_class_name(ClassNames.RADIO_ITEM, props)
return super().create(*children, **props)
|
class MenuCheckboxItem(MenuBaseComponent):
"""A menu item that toggles a setting on or off. Renders a <div> element."""
tag = "Menu.CheckboxItem"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Whether the checkbox item is initially ticked. To render a controlled checkbox item, use the checked prop instead. Defaults to False.
default_checked: Var[bool]
# Whether the checkbox item is ticked. To render an uncontrolled checkbox item, use the default_checked prop instead.
checked: Var[bool]
# Event handler called when the checkbox item is ticked or unticked.
on_checked_change: EventHandler[passthrough_event_spec(bool, dict)]
# Whether to close the menu when the item is clicked. Defaults to False.
close_on_click: Var[bool]
# 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 butto | class MenuRadioItemIndicator(MenuBaseComponent):
"""Indicates whether the radio item is selected. Renders a <div> element."""
tag = "Menu.RadioItemIndicator"
# Whether to keep the HTML element in the DOM when the radio item is inactive. Defaults to False.
keep_mounted: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio item indicator component."""
props["data-slot"] = "menu-radio-item-indicator"
cls.set_class_name(ClassNames.RADIO_ITEM_INDICATOR, props)
return super().create(*children, **props) |
value that will be set in the MenuRadioGroup when the item is selected.
value: Var[str | int]
# Whether to close the menu when the item is clicked. Defaults to False.
close_on_click: Var[bool]
# 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio item component."""
props["data-slot"] = "menu-radio-item"
cls.set_class_name(ClassNames.RADIO_ITEM, props)
return super().create(*children, **props)
class MenuRadioItemIndicator(MenuBaseComponent):
"""Indicates whether the radio item is selected. Renders a <div> element."""
|
# Whether to keep the HTML element in the DOM when the radio item is inactive. Defaults to False.
keep_mounted: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio item indicator component."""
props["data-slot"] = "menu-radio-item-indicator"
cls.set_class_name(ClassNames.RADIO_ITEM_INDICATOR, props)
return super().create(*children, **props)
class MenuCheckboxItem(MenuBaseComponent):
"""A menu item that toggles a setting on or off. Renders a <div> element."""
tag = "Menu.CheckboxItem"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Whether the checkbox item is initially ticked. To render a controlled checkbox item, use the checked prop instead. Defaults to False.
default_checked: Var[bool]
# Whether the checkbox item is ticked. To render an | tag = "Menu.RadioItemIndicator" |
enders 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio item component."""
props["data-slot"] = "menu-radio-item"
cls.set_class_name(ClassNames.RADIO_ITEM, props)
return super().create(*children, **props)
class MenuRadioItemIndicator(MenuBaseComponent):
"""Indicates whether the radio item is selected. Renders a <div> element."""
tag = "Menu.RadioItemIndicator"
# Whether to keep the HTML element in the DOM when the radio item is inactive. Defaults to False.
keep_mounted: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
|
class MenuCheckboxItem(MenuBaseComponent):
"""A menu item that toggles a setting on or off. Renders a <div> element."""
tag = "Menu.CheckboxItem"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Whether the checkbox item is initially ticked. To render a controlled checkbox item, use the checked prop instead. Defaults to False.
default_checked: Var[bool]
# Whether the checkbox item is ticked. To render an uncontrolled checkbox item, use the default_checked prop instead.
checked: Var[bool]
# Event handler called when the checkbox item is ticked or unticked.
on_checked_change: EventHandler[passthrough_event_spec(bool, dict)]
# Whether to close the menu when the item is clicked. Defaults to False.
close_on_click: Var[bool]
# 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 butto | def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio item indicator component."""
props["data-slot"] = "menu-radio-item-indicator"
cls.set_class_name(ClassNames.RADIO_ITEM_INDICATOR, props)
return super().create(*children, **props) |
e.g. <div>). Defaults to False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio item component."""
props["data-slot"] = "menu-radio-item"
cls.set_class_name(ClassNames.RADIO_ITEM, props)
return super().create(*children, **props)
class MenuRadioItemIndicator(MenuBaseComponent):
"""Indicates whether the radio item is selected. Renders a <div> element."""
tag = "Menu.RadioItemIndicator"
# Whether to keep the HTML element in the DOM when the radio item is inactive. Defaults to False.
keep_mounted: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio item indicator component."""
|
cls.set_class_name(ClassNames.RADIO_ITEM_INDICATOR, props)
return super().create(*children, **props)
class MenuCheckboxItem(MenuBaseComponent):
"""A menu item that toggles a setting on or off. Renders a <div> element."""
tag = "Menu.CheckboxItem"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Whether the checkbox item is initially ticked. To render a controlled checkbox item, use the checked prop instead. Defaults to False.
default_checked: Var[bool]
# Whether the checkbox item is ticked. To render an uncontrolled checkbox item, use the default_checked prop instead.
checked: Var[bool]
# Event handler called when the checkbox item is ticked or unticked.
on_checked_change: EventHandler[passthrough_event_spec(bool, dict)]
# Whether to close the menu when the item is clicked. Defaults to False.
close_on_click: Var[bool]
# Whether the component renders | props["data-slot"] = "menu-radio-item-indicator" |
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio item component."""
props["data-slot"] = "menu-radio-item"
cls.set_class_name(ClassNames.RADIO_ITEM, props)
return super().create(*children, **props)
class MenuRadioItemIndicator(MenuBaseComponent):
"""Indicates whether the radio item is selected. Renders a <div> element."""
tag = "Menu.RadioItemIndicator"
# Whether to keep the HTML element in the DOM when the radio item is inactive. Defaults to False.
keep_mounted: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio item indicator component."""
props["data-slot"] = "menu-radio-item-indicator"
cls.set_class_name(ClassNames.RADIO_ITEM_INDICATOR, props)
return super().create(*children, **props)
|
class MenuCheckboxItemIndicator(MenuBaseComponent):
"""Indicates whether the checkbox item is ticked. Renders a <div> element."""
tag = "Menu.CheckboxItemIndicator"
# Whether to keep the HTML element in the DOM when the checkbox item is not checked. Defaults to False.
keep_mounted: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu checkbox item indicator component."""
props["data-slot"] = "menu-checkbox-item-indicator"
cls.set_class_name(ClassNames.CHECKBOX_ITEM_INDICATOR, props)
return super().create(*children, **props)
class MenuSeparator(MenuBaseComponent):
"""A separator element accessible to screen readers. Renders a <div> element."""
tag = "Menu.Separator"
# The orientation of the separator. Defaults to 'horizontal'.
orientation: Var[LiteralMenuOrientation]
# The render prop
render_: Var[Compo | class MenuCheckboxItem(MenuBaseComponent):
"""A menu item that toggles a setting on or off. Renders a <div> element."""
tag = "Menu.CheckboxItem"
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Whether the checkbox item is initially ticked. To render a controlled checkbox item, use the checked prop instead. Defaults to False.
default_checked: Var[bool]
# Whether the checkbox item is ticked. To render an uncontrolled checkbox item, use the default_checked prop instead.
checked: Var[bool]
# Event handler called when the checkbox item is ticked or unticked.
on_checked_change: EventHandler[passthrough_event_spec(bool, dict)]
# Whether to close the menu when the item is clicked. Defaults to False.
close_on_click: Var[bool]
# 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu checkbox item component."""
props["data-slot"] = "menu-checkbox-item"
cls.set_class_name(ClassNames.CHECKBOX_ITEM, props)
return super().create(*children, **props) |
"""Create the menu radio item component."""
props["data-slot"] = "menu-radio-item"
cls.set_class_name(ClassNames.RADIO_ITEM, props)
return super().create(*children, **props)
class MenuRadioItemIndicator(MenuBaseComponent):
"""Indicates whether the radio item is selected. Renders a <div> element."""
tag = "Menu.RadioItemIndicator"
# Whether to keep the HTML element in the DOM when the radio item is inactive. Defaults to False.
keep_mounted: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu radio item indicator component."""
props["data-slot"] = "menu-radio-item-indicator"
cls.set_class_name(ClassNames.RADIO_ITEM_INDICATOR, props)
return super().create(*children, **props)
class MenuCheckboxItem(MenuBaseComponent):
"""A menu item that toggles a setting on or off. Renders a <div> element."""
|
# Overrides the text label to use when the item is matched during keyboard text navigation.
label: Var[str]
# Whether the checkbox item is initially ticked. To render a controlled checkbox item, use the checked prop instead. Defaults to False.
default_checked: Var[bool]
# Whether the checkbox item is ticked. To render an uncontrolled checkbox item, use the default_checked prop instead.
checked: Var[bool]
# Event handler called when the checkbox item is ticked or unticked.
on_checked_change: EventHandler[passthrough_event_spec(bool, dict)]
# Whether to close the menu when the item is clicked. Defaults to False.
close_on_click: Var[bool]
# 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: | tag = "Menu.CheckboxItem" |
navigation.
label: Var[str]
# Whether the checkbox item is initially ticked. To render a controlled checkbox item, use the checked prop instead. Defaults to False.
default_checked: Var[bool]
# Whether the checkbox item is ticked. To render an uncontrolled checkbox item, use the default_checked prop instead.
checked: Var[bool]
# Event handler called when the checkbox item is ticked or unticked.
on_checked_change: EventHandler[passthrough_event_spec(bool, dict)]
# Whether to close the menu when the item is clicked. Defaults to False.
close_on_click: Var[bool]
# 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
|
class MenuCheckboxItemIndicator(MenuBaseComponent):
"""Indicates whether the checkbox item is ticked. Renders a <div> element."""
tag = "Menu.CheckboxItemIndicator"
# Whether to keep the HTML element in the DOM when the checkbox item is not checked. Defaults to False.
keep_mounted: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu checkbox item indicator component."""
props["data-slot"] = "menu-checkbox-item-indicator"
cls.set_class_name(ClassNames.CHECKBOX_ITEM_INDICATOR, props)
return super().create(*children, **props)
class MenuSeparator(MenuBaseComponent):
"""A separator element accessible to screen readers. Renders a <div> element."""
tag = "Menu.Separator"
# The orientation of the separator. Defaults to 'horizontal'.
orientation: Var[LiteralMenuOrientation]
# The render prop
render_: Var[Compo | def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu checkbox item component."""
props["data-slot"] = "menu-checkbox-item"
cls.set_class_name(ClassNames.CHECKBOX_ITEM, props)
return super().create(*children, **props) |
item, use the checked prop instead. Defaults to False.
default_checked: Var[bool]
# Whether the checkbox item is ticked. To render an uncontrolled checkbox item, use the default_checked prop instead.
checked: Var[bool]
# Event handler called when the checkbox item is ticked or unticked.
on_checked_change: EventHandler[passthrough_event_spec(bool, dict)]
# Whether to close the menu when the item is clicked. Defaults to False.
close_on_click: Var[bool]
# 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu checkbox item component."""
|
cls.set_class_name(ClassNames.CHECKBOX_ITEM, props)
return super().create(*children, **props)
class MenuCheckboxItemIndicator(MenuBaseComponent):
"""Indicates whether the checkbox item is ticked. Renders a <div> element."""
tag = "Menu.CheckboxItemIndicator"
# Whether to keep the HTML element in the DOM when the checkbox item is not checked. Defaults to False.
keep_mounted: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu checkbox item indicator component."""
props["data-slot"] = "menu-checkbox-item-indicator"
cls.set_class_name(ClassNames.CHECKBOX_ITEM_INDICATOR, props)
return super().create(*children, **props)
class MenuSeparator(MenuBaseComponent):
"""A separator element accessible to screen readers. Renders a <div> element."""
tag = "Menu.Separator"
# The orientation of the separator. Defaul | props["data-slot"] = "menu-checkbox-item" |
d checkbox item, use the default_checked prop instead.
checked: Var[bool]
# Event handler called when the checkbox item is ticked or unticked.
on_checked_change: EventHandler[passthrough_event_spec(bool, dict)]
# Whether to close the menu when the item is clicked. Defaults to False.
close_on_click: Var[bool]
# 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu checkbox item component."""
props["data-slot"] = "menu-checkbox-item"
cls.set_class_name(ClassNames.CHECKBOX_ITEM, props)
return super().create(*children, **props)
|
class MenuSeparator(MenuBaseComponent):
"""A separator element accessible to screen readers. Renders a <div> element."""
tag = "Menu.Separator"
# The orientation of the separator. Defaults to 'horizontal'.
orientation: Var[LiteralMenuOrientation]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu separator component."""
props["data-slot"] = "menu-separator"
cls.set_class_name(ClassNames.SEPARATOR, props)
return super().create(*children, **props)
class HighLevelMenu(MenuRoot):
"""High level wrapper for the Menu component."""
# The trigger component to use for the menu
trigger: Var[Component | None]
# The list of items to display in the menu dropdown - can be strings or tuples of (label, on_click_handler)
items: Var[list[str | tuple[str, EventHandler]]]
# The placeholder text to display when no item is selected
| class MenuCheckboxItemIndicator(MenuBaseComponent):
"""Indicates whether the checkbox item is ticked. Renders a <div> element."""
tag = "Menu.CheckboxItemIndicator"
# Whether to keep the HTML element in the DOM when the checkbox item is not checked. Defaults to False.
keep_mounted: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu checkbox item indicator component."""
props["data-slot"] = "menu-checkbox-item-indicator"
cls.set_class_name(ClassNames.CHECKBOX_ITEM_INDICATOR, props)
return super().create(*children, **props) |
or unticked.
on_checked_change: EventHandler[passthrough_event_spec(bool, dict)]
# Whether to close the menu when the item is clicked. Defaults to False.
close_on_click: Var[bool]
# 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 False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu checkbox item component."""
props["data-slot"] = "menu-checkbox-item"
cls.set_class_name(ClassNames.CHECKBOX_ITEM, props)
return super().create(*children, **props)
class MenuCheckboxItemIndicator(MenuBaseComponent):
"""Indicates whether the checkbox item is ticked. Renders a <div> element."""
|
# Whether to keep the HTML element in the DOM when the checkbox item is not checked. Defaults to False.
keep_mounted: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu checkbox item indicator component."""
props["data-slot"] = "menu-checkbox-item-indicator"
cls.set_class_name(ClassNames.CHECKBOX_ITEM_INDICATOR, props)
return super().create(*children, **props)
class MenuSeparator(MenuBaseComponent):
"""A separator element accessible to screen readers. Renders a <div> element."""
tag = "Menu.Separator"
# The orientation of the separator. Defaults to 'horizontal'.
orientation: Var[LiteralMenuOrientation]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu separator component."""
props["data-slot"] = "menu-separa | tag = "Menu.CheckboxItemIndicator" |
n> element when replacing it via the render prop. Set to false if the rendered element is not a button (e.g. <div>). Defaults to False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu checkbox item component."""
props["data-slot"] = "menu-checkbox-item"
cls.set_class_name(ClassNames.CHECKBOX_ITEM, props)
return super().create(*children, **props)
class MenuCheckboxItemIndicator(MenuBaseComponent):
"""Indicates whether the checkbox item is ticked. Renders a <div> element."""
tag = "Menu.CheckboxItemIndicator"
# Whether to keep the HTML element in the DOM when the checkbox item is not checked. Defaults to False.
keep_mounted: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
|
class MenuSeparator(MenuBaseComponent):
"""A separator element accessible to screen readers. Renders a <div> element."""
tag = "Menu.Separator"
# The orientation of the separator. Defaults to 'horizontal'.
orientation: Var[LiteralMenuOrientation]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu separator component."""
props["data-slot"] = "menu-separator"
cls.set_class_name(ClassNames.SEPARATOR, props)
return super().create(*children, **props)
class HighLevelMenu(MenuRoot):
"""High level wrapper for the Menu component."""
# The trigger component to use for the menu
trigger: Var[Component | None]
# The list of items to display in the menu dropdown - can be strings or tuples of (label, on_click_handler)
items: Var[list[str | tuple[str, EventHandler]]]
# The placeholder text to display when no item is selected
| def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu checkbox item indicator component."""
props["data-slot"] = "menu-checkbox-item-indicator"
cls.set_class_name(ClassNames.CHECKBOX_ITEM_INDICATOR, props)
return super().create(*children, **props) |
False.
native_button: Var[bool]
# Whether the component should ignore user interaction. Defaults to False.
disabled: Var[bool]
# The render prop.
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu checkbox item component."""
props["data-slot"] = "menu-checkbox-item"
cls.set_class_name(ClassNames.CHECKBOX_ITEM, props)
return super().create(*children, **props)
class MenuCheckboxItemIndicator(MenuBaseComponent):
"""Indicates whether the checkbox item is ticked. Renders a <div> element."""
tag = "Menu.CheckboxItemIndicator"
# Whether to keep the HTML element in the DOM when the checkbox item is not checked. Defaults to False.
keep_mounted: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu checkbox item indicator component."""
|
cls.set_class_name(ClassNames.CHECKBOX_ITEM_INDICATOR, props)
return super().create(*children, **props)
class MenuSeparator(MenuBaseComponent):
"""A separator element accessible to screen readers. Renders a <div> element."""
tag = "Menu.Separator"
# The orientation of the separator. Defaults to 'horizontal'.
orientation: Var[LiteralMenuOrientation]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu separator component."""
props["data-slot"] = "menu-separator"
cls.set_class_name(ClassNames.SEPARATOR, props)
return super().create(*children, **props)
class HighLevelMenu(MenuRoot):
"""High level wrapper for the Menu component."""
# The trigger component to use for the menu
trigger: Var[Component | None]
# The list of items to display in the menu dropdown - can be strings or tuples of (label, on_click_handle | props["data-slot"] = "menu-checkbox-item-indicator" |
_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu checkbox item component."""
props["data-slot"] = "menu-checkbox-item"
cls.set_class_name(ClassNames.CHECKBOX_ITEM, props)
return super().create(*children, **props)
class MenuCheckboxItemIndicator(MenuBaseComponent):
"""Indicates whether the checkbox item is ticked. Renders a <div> element."""
tag = "Menu.CheckboxItemIndicator"
# Whether to keep the HTML element in the DOM when the checkbox item is not checked. Defaults to False.
keep_mounted: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu checkbox item indicator component."""
props["data-slot"] = "menu-checkbox-item-indicator"
cls.set_class_name(ClassNames.CHECKBOX_ITEM_INDICATOR, props)
return super().create(*children, **props)
|
class HighLevelMenu(MenuRoot):
"""High level wrapper for the Menu component."""
# The trigger component to use for the menu
trigger: Var[Component | None]
# The list of items to display in the menu dropdown - can be strings or tuples of (label, on_click_handler)
items: Var[list[str | tuple[str, EventHandler]]]
# The placeholder text to display when no item is selected
placeholder: Var[str]
# The size of the menu. Defaults to "md".
size: Var[LiteralMenuSize]
# Whether to close the menu when the item is clicked. Defaults to True.
close_on_click: Var[bool]
# Props for different component parts
_item_props = {"close_on_click"}
_trigger_props = {"placeholder", "size", "close_on_click"}
_positioner_props = {
"align",
"align_offset",
"side",
"arrow_padding",
"collision_padding",
"sticky",
"position_method",
"track_anchor",
"side_offset",
"collisi | class MenuSeparator(MenuBaseComponent):
"""A separator element accessible to screen readers. Renders a <div> element."""
tag = "Menu.Separator"
# The orientation of the separator. Defaults to 'horizontal'.
orientation: Var[LiteralMenuOrientation]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu separator component."""
props["data-slot"] = "menu-separator"
cls.set_class_name(ClassNames.SEPARATOR, props)
return super().create(*children, **props) |
x item component."""
props["data-slot"] = "menu-checkbox-item"
cls.set_class_name(ClassNames.CHECKBOX_ITEM, props)
return super().create(*children, **props)
class MenuCheckboxItemIndicator(MenuBaseComponent):
"""Indicates whether the checkbox item is ticked. Renders a <div> element."""
tag = "Menu.CheckboxItemIndicator"
# Whether to keep the HTML element in the DOM when the checkbox item is not checked. Defaults to False.
keep_mounted: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu checkbox item indicator component."""
props["data-slot"] = "menu-checkbox-item-indicator"
cls.set_class_name(ClassNames.CHECKBOX_ITEM_INDICATOR, props)
return super().create(*children, **props)
class MenuSeparator(MenuBaseComponent):
"""A separator element accessible to screen readers. Renders a <div> element."""
|
# The orientation of the separator. Defaults to 'horizontal'.
orientation: Var[LiteralMenuOrientation]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu separator component."""
props["data-slot"] = "menu-separator"
cls.set_class_name(ClassNames.SEPARATOR, props)
return super().create(*children, **props)
class HighLevelMenu(MenuRoot):
"""High level wrapper for the Menu component."""
# The trigger component to use for the menu
trigger: Var[Component | None]
# The list of items to display in the menu dropdown - can be strings or tuples of (label, on_click_handler)
items: Var[list[str | tuple[str, EventHandler]]]
# The placeholder text to display when no item is selected
placeholder: Var[str]
# The size of the menu. Defaults to "md".
size: Var[LiteralMenuSize]
# Whether to close the menu when the item is c | tag = "Menu.Separator" |
icator(MenuBaseComponent):
"""Indicates whether the checkbox item is ticked. Renders a <div> element."""
tag = "Menu.CheckboxItemIndicator"
# Whether to keep the HTML element in the DOM when the checkbox item is not checked. Defaults to False.
keep_mounted: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu checkbox item indicator component."""
props["data-slot"] = "menu-checkbox-item-indicator"
cls.set_class_name(ClassNames.CHECKBOX_ITEM_INDICATOR, props)
return super().create(*children, **props)
class MenuSeparator(MenuBaseComponent):
"""A separator element accessible to screen readers. Renders a <div> element."""
tag = "Menu.Separator"
# The orientation of the separator. Defaults to 'horizontal'.
orientation: Var[LiteralMenuOrientation]
# The render prop
render_: Var[Component]
@classmethod
|
class HighLevelMenu(MenuRoot):
"""High level wrapper for the Menu component."""
# The trigger component to use for the menu
trigger: Var[Component | None]
# The list of items to display in the menu dropdown - can be strings or tuples of (label, on_click_handler)
items: Var[list[str | tuple[str, EventHandler]]]
# The placeholder text to display when no item is selected
placeholder: Var[str]
# The size of the menu. Defaults to "md".
size: Var[LiteralMenuSize]
# Whether to close the menu when the item is clicked. Defaults to True.
close_on_click: Var[bool]
# Props for different component parts
_item_props = {"close_on_click"}
_trigger_props = {"placeholder", "size", "close_on_click"}
_positioner_props = {
"align",
"align_offset",
"side",
"arrow_padding",
"collision_padding",
"sticky",
"position_method",
"track_anchor",
"side_offset",
"collisi | def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu separator component."""
props["data-slot"] = "menu-separator"
cls.set_class_name(ClassNames.SEPARATOR, props)
return super().create(*children, **props) |
ag = "Menu.CheckboxItemIndicator"
# Whether to keep the HTML element in the DOM when the checkbox item is not checked. Defaults to False.
keep_mounted: Var[bool]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu checkbox item indicator component."""
props["data-slot"] = "menu-checkbox-item-indicator"
cls.set_class_name(ClassNames.CHECKBOX_ITEM_INDICATOR, props)
return super().create(*children, **props)
class MenuSeparator(MenuBaseComponent):
"""A separator element accessible to screen readers. Renders a <div> element."""
tag = "Menu.Separator"
# The orientation of the separator. Defaults to 'horizontal'.
orientation: Var[LiteralMenuOrientation]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu separator component."""
|
cls.set_class_name(ClassNames.SEPARATOR, props)
return super().create(*children, **props)
class HighLevelMenu(MenuRoot):
"""High level wrapper for the Menu component."""
# The trigger component to use for the menu
trigger: Var[Component | None]
# The list of items to display in the menu dropdown - can be strings or tuples of (label, on_click_handler)
items: Var[list[str | tuple[str, EventHandler]]]
# The placeholder text to display when no item is selected
placeholder: Var[str]
# The size of the menu. Defaults to "md".
size: Var[LiteralMenuSize]
# Whether to close the menu when the item is clicked. Defaults to True.
close_on_click: Var[bool]
# Props for different component parts
_item_props = {"close_on_click"}
_trigger_props = {"placeholder", "size", "close_on_click"}
_positioner_props = {
"align",
"align_offset",
"side",
"arrow_padding",
"collision_padding",
| props["data-slot"] = "menu-separator" |
entation]
# The render prop
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu separator component."""
props["data-slot"] = "menu-separator"
cls.set_class_name(ClassNames.SEPARATOR, props)
return super().create(*children, **props)
class HighLevelMenu(MenuRoot):
"""High level wrapper for the Menu component."""
# The trigger component to use for the menu
trigger: Var[Component | None]
# The list of items to display in the menu dropdown - can be strings or tuples of (label, on_click_handler)
items: Var[list[str | tuple[str, EventHandler]]]
# The placeholder text to display when no item is selected
placeholder: Var[str]
# The size of the menu. Defaults to "md".
size: Var[LiteralMenuSize]
# Whether to close the menu when the item is clicked. Defaults to True.
close_on_click: Var[bool]
# Props for different component parts
|
_trigger_props = {"placeholder", "size", "close_on_click"}
_positioner_props = {
"align",
"align_offset",
"side",
"arrow_padding",
"collision_padding",
"sticky",
"position_method",
"track_anchor",
"side_offset",
"collision_avoidance",
}
_portal_props = {"container"}
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create a menu component.
Args:
*children: Additional children to include in the menu.
**props: Additional properties to apply to the menu component.
Returns:
The menu component.
"""
# Extract props for different parts
item_props = {k: props.pop(k) for k in cls._item_props & props.keys()}
trigger_props = {k: props.pop(k) for k in cls._trigger_props & props.keys()}
positioner_props = {
k: props.pop(k) for k in cls._positioner_props & props | _item_props = {"close_on_click"} |
render_: Var[Component]
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create the menu separator component."""
props["data-slot"] = "menu-separator"
cls.set_class_name(ClassNames.SEPARATOR, props)
return super().create(*children, **props)
class HighLevelMenu(MenuRoot):
"""High level wrapper for the Menu component."""
# The trigger component to use for the menu
trigger: Var[Component | None]
# The list of items to display in the menu dropdown - can be strings or tuples of (label, on_click_handler)
items: Var[list[str | tuple[str, EventHandler]]]
# The placeholder text to display when no item is selected
placeholder: Var[str]
# The size of the menu. Defaults to "md".
size: Var[LiteralMenuSize]
# Whether to close the menu when the item is clicked. Defaults to True.
close_on_click: Var[bool]
# Props for different component parts
_item_props = {"close_on_click"}
|
_positioner_props = {
"align",
"align_offset",
"side",
"arrow_padding",
"collision_padding",
"sticky",
"position_method",
"track_anchor",
"side_offset",
"collision_avoidance",
}
_portal_props = {"container"}
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create a menu component.
Args:
*children: Additional children to include in the menu.
**props: Additional properties to apply to the menu component.
Returns:
The menu component.
"""
# Extract props for different parts
item_props = {k: props.pop(k) for k in cls._item_props & props.keys()}
trigger_props = {k: props.pop(k) for k in cls._trigger_props & props.keys()}
positioner_props = {
k: props.pop(k) for k in cls._positioner_props & props.keys()
}
portal_props = {k: props.pop(k) for k | _trigger_props = {"placeholder", "size", "close_on_click"} |
children, **props) -> BaseUIComponent:
"""Create the menu separator component."""
props["data-slot"] = "menu-separator"
cls.set_class_name(ClassNames.SEPARATOR, props)
return super().create(*children, **props)
class HighLevelMenu(MenuRoot):
"""High level wrapper for the Menu component."""
# The trigger component to use for the menu
trigger: Var[Component | None]
# The list of items to display in the menu dropdown - can be strings or tuples of (label, on_click_handler)
items: Var[list[str | tuple[str, EventHandler]]]
# The placeholder text to display when no item is selected
placeholder: Var[str]
# The size of the menu. Defaults to "md".
size: Var[LiteralMenuSize]
# Whether to close the menu when the item is clicked. Defaults to True.
close_on_click: Var[bool]
# Props for different component parts
_item_props = {"close_on_click"}
_trigger_props = {"placeholder", "size", "close_on_click"}
|
_portal_props = {"container"}
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create a menu component.
Args:
*children: Additional children to include in the menu.
**props: Additional properties to apply to the menu component.
Returns:
The menu component.
"""
# Extract props for different parts
item_props = {k: props.pop(k) for k in cls._item_props & props.keys()}
trigger_props = {k: props.pop(k) for k in cls._trigger_props & props.keys()}
positioner_props = {
k: props.pop(k) for k in cls._positioner_props & props.keys()
}
portal_props = {k: props.pop(k) for k in cls._portal_props & props.keys()}
trigger = props.pop("trigger", None)
items = props.pop("items", [])
size = trigger_props.get("size", "md")
trigger_label = trigger_props.get("placeholder", "Open Menu")
def create_menu_i | _positioner_props = {
"align",
"align_offset",
"side",
"arrow_padding",
"collision_padding",
"sticky",
"position_method",
"track_anchor",
"side_offset",
"collision_avoidance",
} |
nuRoot):
"""High level wrapper for the Menu component."""
# The trigger component to use for the menu
trigger: Var[Component | None]
# The list of items to display in the menu dropdown - can be strings or tuples of (label, on_click_handler)
items: Var[list[str | tuple[str, EventHandler]]]
# The placeholder text to display when no item is selected
placeholder: Var[str]
# The size of the menu. Defaults to "md".
size: Var[LiteralMenuSize]
# Whether to close the menu when the item is clicked. Defaults to True.
close_on_click: Var[bool]
# Props for different component parts
_item_props = {"close_on_click"}
_trigger_props = {"placeholder", "size", "close_on_click"}
_positioner_props = {
"align",
"align_offset",
"side",
"arrow_padding",
"collision_padding",
"sticky",
"position_method",
"track_anchor",
"side_offset",
"collision_avoidance",
}
|
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create a menu component.
Args:
*children: Additional children to include in the menu.
**props: Additional properties to apply to the menu component.
Returns:
The menu component.
"""
# Extract props for different parts
item_props = {k: props.pop(k) for k in cls._item_props & props.keys()}
trigger_props = {k: props.pop(k) for k in cls._trigger_props & props.keys()}
positioner_props = {
k: props.pop(k) for k in cls._positioner_props & props.keys()
}
portal_props = {k: props.pop(k) for k in cls._portal_props & props.keys()}
trigger = props.pop("trigger", None)
items = props.pop("items", [])
size = trigger_props.get("size", "md")
trigger_label = trigger_props.get("placeholder", "Open Menu")
def create_menu_item(item: str | tuple[str, EventHa | _portal_props = {"container"} |
ze of the menu. Defaults to "md".
size: Var[LiteralMenuSize]
# Whether to close the menu when the item is clicked. Defaults to True.
close_on_click: Var[bool]
# Props for different component parts
_item_props = {"close_on_click"}
_trigger_props = {"placeholder", "size", "close_on_click"}
_positioner_props = {
"align",
"align_offset",
"side",
"arrow_padding",
"collision_padding",
"sticky",
"position_method",
"track_anchor",
"side_offset",
"collision_avoidance",
}
_portal_props = {"container"}
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create a menu component.
Args:
*children: Additional children to include in the menu.
**props: Additional properties to apply to the menu component.
Returns:
The menu component.
"""
# Extract props for different parts
|
trigger_props = {k: props.pop(k) for k in cls._trigger_props & props.keys()}
positioner_props = {
k: props.pop(k) for k in cls._positioner_props & props.keys()
}
portal_props = {k: props.pop(k) for k in cls._portal_props & props.keys()}
trigger = props.pop("trigger", None)
items = props.pop("items", [])
size = trigger_props.get("size", "md")
trigger_label = trigger_props.get("placeholder", "Open Menu")
def create_menu_item(item: str | tuple[str, EventHandler]) -> BaseUIComponent:
if isinstance(item, tuple):
label, on_click_handler = item
return MenuItem.create(
render_=button(
label,
variant="ghost",
class_name=ClassNames.ITEM,
disabled=props.get("disabled", False),
on_click=on_click_handler,
siz | item_props = {k: props.pop(k) for k in cls._item_props & props.keys()} |
to close the menu when the item is clicked. Defaults to True.
close_on_click: Var[bool]
# Props for different component parts
_item_props = {"close_on_click"}
_trigger_props = {"placeholder", "size", "close_on_click"}
_positioner_props = {
"align",
"align_offset",
"side",
"arrow_padding",
"collision_padding",
"sticky",
"position_method",
"track_anchor",
"side_offset",
"collision_avoidance",
}
_portal_props = {"container"}
@classmethod
def create(cls, *children, **props) -> BaseUIComponent:
"""Create a menu component.
Args:
*children: Additional children to include in the menu.
**props: Additional properties to apply to the menu component.
Returns:
The menu component.
"""
# Extract props for different parts
item_props = {k: props.pop(k) for k in cls._item_props & props.keys()}
|
positioner_props = {
k: props.pop(k) for k in cls._positioner_props & props.keys()
}
portal_props = {k: props.pop(k) for k in cls._portal_props & props.keys()}
trigger = props.pop("trigger", None)
items = props.pop("items", [])
size = trigger_props.get("size", "md")
trigger_label = trigger_props.get("placeholder", "Open Menu")
def create_menu_item(item: str | tuple[str, EventHandler]) -> BaseUIComponent:
if isinstance(item, tuple):
label, on_click_handler = item
return MenuItem.create(
render_=button(
label,
variant="ghost",
class_name=ClassNames.ITEM,
disabled=props.get("disabled", False),
on_click=on_click_handler,
size=size,
type="button",
),
| trigger_props = {k: props.pop(k) for k in cls._trigger_props & props.keys()} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.