{"instruction": "\"\"\"Custom avatar component.\"\"\"\n\nfrom reflex.components.component import Component, ComponentNamespace\n", "input": "\nfrom reflex.utils.imports import ImportVar\nfrom reflex.vars.base import Var\n\nfrom reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent\n\n\nclass ClassNames:\n \"\"\"Class names for avatar components.\"\"\"\n\n ROOT = \"shrink-0 inline-flex size-6 items-center justify-center overflow-hidden rounded-full bg-secondary-1 align-middle text-base font-medium text-secondary-12 select-none\"\n IMAGE = \"size-full object-cover shrink-0\"\n FALLBACK = \"flex size-full items-center justify-center text-sm animate-pulse bg-secondary-6\"\n\n\nclass AvatarBaseComponent(BaseUIComponent):\n \"\"\"Base component for avatar components.\"\"\"\n\n library = f\"{PACKAGE_NAME}/avatar\"\n\n @property\n def import_var(self):\n \"\"\"Return the import variable for the avatar component.\"\"\"\n return ImportVar(tag=\"Avatar\", package_path=\"\", install=False)\n\n\nclass AvatarRoot(AvatarBaseComponent):\n \"\"\"Displays a user's profile picture, initials, or fallback icon.\"\"\"\n\n tag = \"Avatar.Root\"\n\n # The c", "output": "from reflex.event import EventHandler, passthrough_event_spec"} {"instruction": "\"\"\"Badge component.\"\"\"\n\nfrom typing import Literal\n\nfrom reflex.components.el import Span\n", "input": "\n\nfrom reflex_ui.components.component import CoreComponent\n\nBaseColorType = Literal[\n \"primary\",\n \"secondary\",\n \"info\",\n \"success\",\n \"warning\",\n \"destructive\",\n \"gray\",\n \"mauve\",\n \"slate\",\n \"sage\",\n \"olive\",\n \"sand\",\n \"tomato\",\n \"red\",\n \"ruby\",\n \"crimson\",\n \"pink\",\n \"plum\",\n \"purple\",\n \"violet\",\n \"iris\",\n \"indigo\",\n \"blue\",\n \"cyan\",\n \"teal\",\n \"jade\",\n \"green\",\n \"grass\",\n \"brown\",\n \"orange\",\n \"sky\",\n \"mint\",\n \"lime\",\n \"yellow\",\n \"amber\",\n \"gold\",\n \"bronze\",\n]\nLiteralBadgeVariant = Literal[\"solid\", \"soft\"]\nLiteralBadgeSize = Literal[\"xs\", \"sm\", \"md\"]\n\nDEFAULT_BASE_CLASSES = \"inline-flex items-center font-medium [&_svg]:pointer-events-none [&_svg]:shrink-0 gap-1.5\"\n\n# Light colors that need dark text on solid backgrounds for better contrast\nLIGHT_COLORS = {\"sky\", \"mint\", \"lime\", \"yellow\", \"amber\", \"secondary\"}\n\nBADGE_VARIANTS = {\n \"size\": {\n \"xs\": \"px-1.5 py-0.5 h-4 rou", "output": "from reflex.vars.base import Var"} {"instruction": " size = props.pop(\"size\", \"md\")\n cls.validate_size(size)\n\n loading = props.pop(\"loading\", False)\n disabled = props.pop(\"disabled\", False)\n\n button_classes = f\"{DEFAULT_CLASS_NAME} {BUTTON_VARIANTS['variant'][variant]} {BUTTON_VARIANTS['size'][size]}\"\n\n cls.set_class_name(button_classes, props)\n\n children_list = list(children)\n\n if isinstance(loading, Var):\n props[\"disabled\"] = cond(loading, True, disabled)\n children_list.insert(0, cond(loading, spinner()))\n else:\n props[\"disabled\"] = True if loading else disabled\n children_list.insert(0, spinner()) if loading else None\n\n return super().create(*children_list, **props)\n\n @staticmethod\n def validate_variant(variant: LiteralButtonVariant):\n \"\"\"Validate the button variant.\"\"\"\n if variant not in BUTTON_VARIANTS[\"variant\"]:\n available_variants = \", \".join(BUTTON_VARIANTS[\"variant\"].keys())\n ", "input": "\n raise ValueError(message)\n\n @staticmethod\n def validate_size(size: LiteralButtonSize):\n \"\"\"Validate the button size.\"\"\"\n if size not in BUTTON_VARIANTS[\"size\"]:\n available_sizes = \", \".join(BUTTON_VARIANTS[\"size\"].keys())\n message = f\"Invalid size: {size}. Available sizes: {available_sizes}\"\n raise ValueError(message)\n\n def _exclude_props(self) -> list[str]:\n return [\n *super()._exclude_props(),\n \"size\",\n \"variant\",\n \"loading\",\n ]\n\n\nbutton = Button.create\n", "output": "message = (\n f\"Invalid variant: {variant}. Available variants: {available_variants}\"\n )"} {"instruction": "\"\"\"Custom card component.\"\"\"\n\nfrom reflex.components.component import Component, ComponentNamespace\nfrom reflex.components.el import Div\nfrom reflex.vars.base import Var\n\nfrom reflex_ui.components.component import CoreComponent\n\n\nclass ClassNames:\n \"\"\"Class names for the card component.\"\"\"\n\n ROOT = \"rounded-ui-xl border border-secondary-a4 bg-secondary-1 shadow-small\"\n ", "input": "\n TITLE = \"text-2xl font-semibold text-secondary-12\"\n DESCRIPTION = \"text-sm text-secondary-11 font-[450]\"\n CONTENT = \"flex flex-col gap-4 px-6 pb-6\"\n FOOTER = \"flex flex-row justify-between items-center px-6 pb-6\"\n\n\nclass CardComponent(Div, CoreComponent):\n \"\"\"Base component for the card component.\"\"\"\n\n\nclass CardRoot(CardComponent):\n \"\"\"A card component that displays content in a card format.\"\"\"\n\n @classmethod\n def create(cls, *children, **props):\n \"\"\"Create the card component.\"\"\"\n props[\"data-slot\"] = \"card\"\n cls.set_class_name(ClassNames.ROOT, props)\n return super().create(*children, **props)\n\n\nclass CardHeader(CardComponent):\n \"\"\"A header component for the card.\"\"\"\n\n @classmethod\n def create(cls, *children, **props):\n \"\"\"Create the card header component.\"\"\"\n props[\"data-slot\"] = \"card-header\"\n cls.set_class_name(ClassNames.HEADER, props)\n return super().create(*children, **props)\n\n\nclass CardT", "output": "HEADER = \"flex flex-col gap-2 p-6\""} {"instruction": "\"card-title\"\n cls.set_class_name(ClassNames.TITLE, props)\n return super().create(*children, **props)\n\n\nclass CardDescription(CardComponent):\n \"\"\"A description component for the card.\"\"\"\n\n @classmethod\n def create(cls, *children, **props):\n \"\"\"Create the card description component.\"\"\"\n props[\"data-slot\"] = \"card-description\"\n cls.set_class_name(ClassNames.DESCRIPTION, props)\n return super().create(*children, **props)\n\n\nclass CardContent(CardComponent):\n \"\"\"A content component for the card.\"\"\"\n\n @classmethod\n def create(cls, *children, **props):\n \"\"\"Create the card content component.\"\"\"\n props[\"data-slot\"] = \"card-content\"\n cls.set_class_name(ClassNames.CONTENT, props)\n return super().create(*children, **props)\n\n\nclass CardFooter(CardComponent):\n \"\"\"A footer component for the card.\"\"\"\n\n @classmethod\n def create(cls, *children, **props):\n \"\"\"Create the card footer component.\"\"\"\n ", "input": "\n cls.set_class_name(ClassNames.FOOTER, props)\n return super().create(*children, **props)\n\n\nclass HighLevelCard(CardComponent):\n \"\"\"A high level card component that displays content in a card format.\"\"\"\n\n # Card props\n title: Var[str | Component | None]\n description: Var[str | Component | None]\n content: Var[str | Component | None]\n footer: Var[str | Component | None]\n\n @classmethod\n def create(cls, *children, **props):\n \"\"\"Create the card component.\"\"\"\n title = props.pop(\"title\", \"\")\n description = props.pop(\"description\", \"\")\n content = props.pop(\"content\", \"\")\n footer = props.pop(\"footer\", \"\")\n\n return CardRoot.create(\n (\n CardHeader.create(\n CardTitle.create(title) if title is not None else None,\n (\n CardDescription.create(description)\n if description is not None\n else Non", "output": "props[\"data-slot\"] = \"card-footer\""} {"instruction": ":bottom-[-8px] data-[side=top]:rotate-180\"\n POSITIONER = \"outline-none\"\n GROUP = \"p-1\"\n GROUP_LABEL = \"px-2 py-1.5 text-sm font-semibold\"\n RADIO_GROUP = \"\"\n RADIO_ITEM = \"grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1\"\n RADIO_ITEM_INDICATOR = \"text-current\"\n CHECKBOX_ITEM = \"grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1\"\n CHECKBOX_ITEM_INDICATOR = \"text-current\"\n SUBMENU_TRIGGER = \"grid min-w-(--anchor-width) grid-cols-[1fr_auto] items-center gap-2 text-sm select-none font-[450] text-secondary-11 cursor-pointer outline-none data-[highlighted]:bg-secondary-3 scroll-m-1\"\n\n\nclass ContextMenuBaseComponent(BaseUIComponent):\n \"\"\"Base component for context menu components.\"\"\"\n\n ", "input": "\n\n @property\n def import_var(self):\n \"\"\"Return the import variable for the context menu component.\"\"\"\n return ImportVar(tag=\"ContextMenu\", package_path=\"\", install=False)\n\n\nclass ContextMenuRoot(ContextMenuBaseComponent):\n \"\"\"Groups all parts of the context menu. Doesn't render its own HTML element.\"\"\"\n\n tag = \"ContextMenu.Root\"\n\n # Whether the context menu is initially open. To render a controlled context menu, use the open prop instead. Defaults to False.\n default_open: Var[bool]\n\n # Whether the context menu is currently open.\n open: Var[bool]\n\n # Event handler called when the context menu is opened or closed.\n on_open_change: EventHandler[passthrough_event_spec(bool, dict)]\n\n # A ref to imperative actions. When specified, the context menu will not be unmounted when closed. Instead, the unmount function must be called to unmount the context menu manually. Useful when the context menu's animation is controlled by an external library.\n ", "output": "library = f\"{PACKAGE_NAME}/context-menu\""} {"instruction": " = \"context-menu-radio-item\"\n cls.set_class_name(ClassNames.RADIO_ITEM, props)\n return super().create(*children, **props)\n\n\nclass ContextMenuRadioItemIndicator(ContextMenuBaseComponent):\n \"\"\"Indicates whether the radio item is selected. Renders a
element.\"\"\"\n\n tag = \"ContextMenu.RadioItemIndicator\"\n\n # Whether to keep the indicator mounted in the DOM when the radio item is not checked. Defaults to False.\n keep_mounted: Var[bool]\n\n # The render prop.\n render_: Var[Component]\n\n @classmethod\n def create(cls, *children, **props) -> BaseUIComponent:\n \"\"\"Create the context menu radio item indicator component.\"\"\"\n props[\"data-slot\"] = \"context-menu-radio-item-indicator\"\n cls.set_class_name(ClassNames.RADIO_ITEM_INDICATOR, props)\n return super().create(*children, **props)\n\n\nclass ContextMenuCheckboxItem(ContextMenuBaseComponent):\n \"\"\"A context menu item that toggles a setting on or off. Renders a
element.\"\"\"\n\n ", "input": "\n\n # Overrides the text label to use when the item is matched during keyboard text navigation.\n label: Var[str]\n\n # Whether the checkbox item is initially checked. To render a controlled checkbox item, use the checked prop instead. Defaults to False.\n default_checked: Var[bool]\n\n # Whether the checkbox item is currently checked. To render an uncontrolled checkbox item, use the default_checked prop instead.\n checked: Var[bool]\n\n # Event handler called when the checkbox item is ticked or unticked.\n on_checked_change: EventHandler[passthrough_event_spec(bool, dict)]\n\n # Whether to close the context menu when the item is clicked. Defaults to False.\n close_on_click: Var[bool]\n\n # Whether the component renders a native button element when replacing it via the render prop. Set to true if the rendered element is a native button. Defaults to False.\n native_button: Var[bool]\n\n # Whether the component should ignore user interaction. Defaults to False.\n di", "output": "tag = \"ContextMenu.CheckboxItem\""} {"instruction": " the render prop. Set to true if the rendered element is a native button. Defaults to False.\n native_button: Var[bool]\n\n # Whether the component should ignore user interaction. Defaults to False.\n disabled: Var[bool]\n\n # The render prop.\n render_: Var[Component]\n\n @classmethod\n def create(cls, *children, **props) -> BaseUIComponent:\n \"\"\"Create the context menu checkbox item component.\"\"\"\n props[\"data-slot\"] = \"context-menu-checkbox-item\"\n cls.set_class_name(ClassNames.CHECKBOX_ITEM, props)\n return super().create(*children, **props)\n\n\nclass ContextMenuCheckboxItemIndicator(ContextMenuBaseComponent):\n \"\"\"Indicates whether the checkbox item is ticked. Renders a
element.\"\"\"\n\n tag = \"ContextMenu.CheckboxItemIndicator\"\n\n # Whether to keep the indicator mounted in the DOM when the checkbox item is not checked. Defaults to False.\n keep_mounted: Var[bool]\n\n # The render prop.\n render_: Var[Component]\n\n @classmethod\n ", "input": "\n\n\nclass ContextMenuSubmenuRoot(ContextMenuBaseComponent):\n \"\"\"Groups all parts of a submenu. Doesn't render its own HTML element.\"\"\"\n\n tag = \"ContextMenu.SubmenuRoot\"\n\n # Whether the submenu is initially open. To render a controlled submenu, use the open prop instead. Defaults to False.\n default_open: Var[bool]\n\n # Whether the submenu is currently open.\n open: Var[bool]\n\n # Event handler called when the submenu is opened or closed.\n on_open_change: EventHandler[passthrough_event_spec(bool, dict)]\n\n # When in a submenu, determines whether pressing the Escape key closes the entire menu, or only the current child menu. Defaults to True.\n close_parent_on_esc: Var[bool]\n\n # Event handler called after any animations complete when the submenu is closed.\n on_open_change_complete: EventHandler[passthrough_event_spec(bool)]\n\n # Whether the component should ignore user interaction. Defaults to False.\n disabled: Var[bool]\n\n # Whether the submenu should", "output": "def create(cls, *children, **props) -> BaseUIComponent:\n \"\"\"Create the context menu checkbox item indicator component.\"\"\"\n props[\"data-slot\"] = \"context-menu-checkbox-item-indicator\"\n cls.set_class_name(ClassNames.CHECKBOX_ITEM_INDICATOR, props)\n return super().create(*children, **props)"} {"instruction": "the component should ignore user interaction. Defaults to False.\n disabled: Var[bool]\n\n # The render prop.\n render_: Var[Component]\n\n @classmethod\n def create(cls, *children, **props) -> BaseUIComponent:\n \"\"\"Create the context menu checkbox item component.\"\"\"\n props[\"data-slot\"] = \"context-menu-checkbox-item\"\n cls.set_class_name(ClassNames.CHECKBOX_ITEM, props)\n return super().create(*children, **props)\n\n\nclass ContextMenuCheckboxItemIndicator(ContextMenuBaseComponent):\n \"\"\"Indicates whether the checkbox item is ticked. Renders a
element.\"\"\"\n\n tag = \"ContextMenu.CheckboxItemIndicator\"\n\n # Whether to keep the indicator mounted in the DOM when the checkbox item is not checked. Defaults to False.\n keep_mounted: Var[bool]\n\n # The render prop.\n render_: Var[Component]\n\n @classmethod\n def create(cls, *children, **props) -> BaseUIComponent:\n \"\"\"Create the context menu checkbox item indicator component.\"\"\"\n ", "input": "\n cls.set_class_name(ClassNames.CHECKBOX_ITEM_INDICATOR, props)\n return super().create(*children, **props)\n\n\nclass ContextMenuSubmenuRoot(ContextMenuBaseComponent):\n \"\"\"Groups all parts of a submenu. Doesn't render its own HTML element.\"\"\"\n\n tag = \"ContextMenu.SubmenuRoot\"\n\n # Whether the submenu is initially open. To render a controlled submenu, use the open prop instead. Defaults to False.\n default_open: Var[bool]\n\n # Whether the submenu is currently open.\n open: Var[bool]\n\n # Event handler called when the submenu is opened or closed.\n on_open_change: EventHandler[passthrough_event_spec(bool, dict)]\n\n # When in a submenu, determines whether pressing the Escape key closes the entire menu, or only the current child menu. Defaults to True.\n close_parent_on_esc: Var[bool]\n\n # Event handler called after any animations complete when the submenu is closed.\n on_open_change_complete: EventHandler[passthrough_event_spec(bool)]\n\n # Whether th", "output": "props[\"data-slot\"] = \"context-menu-checkbox-item-indicator\""} {"instruction": "placing it via the render prop. Set to true if the rendered element is a native button. Defaults to False.\n native_button: Var[bool]\n\n # The render prop.\n render_: Var[Component]\n\n @classmethod\n def create(cls, *children, **props) -> BaseUIComponent:\n \"\"\"Create the context menu submenu trigger component.\"\"\"\n props[\"data-slot\"] = \"context-menu-submenu-trigger\"\n cls.set_class_name(ClassNames.SUBMENU_TRIGGER, props)\n return super().create(*children, **props)\n\n\nclass HighLevelContextMenu(ContextMenuRoot):\n \"\"\"High level wrapper for the ContextMenu component.\"\"\"\n\n # The trigger component to use for the context menu\n trigger: Var[Component | None]\n\n # The list of items to display in the context menu - can be strings or tuples of (label, on_click_handler)\n items: Var[list[str | tuple[str, EventHandler]]]\n\n # The size of the context menu. Defaults to \"md\".\n size: Var[LiteralMenuSize]\n\n # Props for different component parts\n ", "input": "\n _positioner_props = {\n \"align\",\n \"align_offset\",\n \"side\",\n \"arrow_padding\",\n \"collision_padding\",\n \"sticky\",\n \"position_method\",\n \"track_anchor\",\n \"side_offset\",\n \"collision_avoidance\",\n \"collision_boundary\",\n }\n _portal_props = {\"container\", \"keep_mounted\"}\n\n @classmethod\n def create(cls, *children, **props) -> BaseUIComponent:\n \"\"\"Create a context menu component.\n\n Args:\n *children: Additional children to include in the context menu.\n **props: Additional properties to apply to the context menu component.\n\n Returns:\n The context menu component.\n \"\"\"\n # Extract props for different parts\n item_props = {k: props.pop(k) for k in cls._item_props & props.keys()}\n positioner_props = {\n k: props.pop(k) for k in cls._positioner_props & props.keys()\n }\n portal_props = {k: props.pop(k) for k in cls", "output": "_item_props = {\"close_on_click\"}"} {"instruction": "\"\"\"Custom dialog component.\"\"\"\n\nfrom typing import Literal\n\nfrom reflex.components.component import Component, ComponentNamespace\nfrom reflex.components.el import Div\nfrom reflex.event import EventHandler, passthrough_event_spec\nfrom reflex.utils.imports import ImportVar\nfrom reflex.vars.base import Var\n\nfrom reflex_ui.components.base.button import button\nfrom reflex_ui.components.base_ui import PACKAGE_NAME, BaseUIComponent\nfrom reflex_ui.components.icons.hugeicon import hi\n\n\n", "input": "\n\n\nclass DialogBaseComponent(BaseUIComponent):\n \"\"\"Base component for dialog components.\"\"\"\n\n library = f\"{PACKAGE_NAME}/dialog\"\n\n @property\n def import_var(self):\n \"\"\"Return the import variable for the dialog component.\"\"\"\n return ImportVar(tag=\"Dialog\", package_path=\"\", install=False)\n\n\nclass DialogRoot(DialogBaseComponent):\n \"\"\"Groups all parts of the dialog. Doesn't render its own HTML element.\"\"\"\n\n tag = \"Dialog.Root\"\n\n # Whether the dialog is initially open. To render a controlled dialog, use the open prop instead.\n default_open: Var[bool]\n\n # Whether the dialog is currently open.\n open: Var[bool]\n\n # Event handler called when the dialog is opened or closed\n on_open_change: EventHandler[passthrough_event_spec(bool, dict)]\n\n # Determines whether the dialog should close on outside clicks. Defaults to True.\n dismissible: Var[bool]\n\n # Determines if the dialog enters a modal state when open.\n # - True: user interaction is ", "output": "class ClassNames:\n \"\"\"Class names for dialog components.\"\"\"\n\n BACKDROP = \"fixed inset-0 bg-black opacity-40 transition-all duration-150 data-[ending-style]:opacity-0 data-[starting-style]:opacity-0 dark:opacity-80\"\n POPUP = \"fixed top-1/2 left-1/2 -mt-8 w-[32rem] max-w-[calc(100vw-3rem)] -translate-x-1/2 -translate-y-1/2 rounded-ui-xl border border-secondary-a4 bg-secondary-1 shadow-large transition-all duration-150 data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[starting-style]:scale-90 data-[starting-style]:opacity-0\"\n TITLE = \"text-2xl font-semibold text-secondary-12\"\n DESCRIPTION = \"text-sm text-secondary-11 font-[450]\"\n HEADER = \"flex flex-col gap-2 px-6 pt-6 pb-4\"\n CONTENT = \"flex flex-col gap-4 px-6 pb-6\"\n TRIGGER = \"\"\n CLOSE = \"\""} {"instruction": " class_name=\"flex flex-row justify-between items-baseline gap-1\",\n ),\n (\n DialogDescription.create(description)\n if description is not None\n else None\n ),\n data_slot=\"dialog-header\",\n class_name=ClassNames.HEADER,\n ),\n Div.create(\n content,\n data_slot=\"dialog-content\",\n class_name=ClassNames.CONTENT,\n ),\n *children,\n class_name=class_name,\n ),\n ),\n **props,\n )\n\n def _exclude_props(self) -> list[str]:\n return [\n *super()._exclude_props(),\n \"trigger\",\n \"content\",\n \"title\",\n \"description\",\n ]\n\n\n", "input": "\n\n\ndialog = Dialog()\n", "output": "class Dialog(ComponentNamespace):\n \"\"\"Namespace for Dialog components.\"\"\"\n\n root = staticmethod(DialogRoot.create)\n trigger = staticmethod(DialogTrigger.create)\n portal = staticmethod(DialogPortal.create)\n backdrop = staticmethod(DialogBackdrop.create)\n popup = staticmethod(DialogPopup.create)\n title = staticmethod(DialogTitle.create)\n description = staticmethod(DialogDescription.create)\n close = staticmethod(DialogClose.create)\n class_names = ClassNames\n __call__ = staticmethod(HighLevelDialog.create)"} {"instruction": "ss_name(ClassNames.DESCRIPTION, props)\n return super().create(*children, **props)\n\n\nclass DrawerHandle(DrawerBaseComponent):\n \"\"\"An optional handle to drag the drawer.\"\"\"\n\n tag = \"Drawer.Handle\"\n\n alias = \"Vaul\" + tag\n\n @classmethod\n def create(cls, *children, **props) -> Component:\n \"\"\"Create the drawer handle component.\"\"\"\n props[\"data-slot\"] = \"drawer-handle\"\n cls.set_class_name(ClassNames.HANDLE, props)\n return super().create(*children, **props)\n\n\nclass HighLevelDrawer(DrawerRoot):\n \"\"\"High level wrapper for the Drawer component.\"\"\"\n\n # Drawer props\n trigger: Var[Component | None]\n content: Var[str | Component | None]\n title: Var[str | Component | None]\n description: Var[str | Component | None]\n\n @classmethod\n def create(cls, *children, **props) -> Component:\n \"\"\"Create the high level drawer component.\"\"\"\n trigger = props.pop(\"trigger\", None)\n content = props.pop(\"content\", None)\n ", "input": "\n description = props.pop(\"description\", None)\n\n return super().create(\n DrawerTrigger.create(render_=trigger) if trigger is not None else None,\n DrawerPortal.create(\n DrawerOverlay.create(),\n DrawerContent.create(\n DrawerTitle.create(title) if title is not None else None,\n (\n DrawerDescription.create(description)\n if description is not None\n else None\n ),\n content,\n *children,\n ),\n ),\n **props,\n )\n\n def _exclude_props(self) -> list[str]:\n return [\n *super()._exclude_props(),\n \"trigger\",\n \"content\",\n \"title\",\n \"description\",\n ]\n\n\nclass Drawer(ComponentNamespace):\n \"\"\"A namespace for Drawer components.\"\"\"\n\n root = staticmethod(DrawerRoot.cre", "output": "title = props.pop(\"title\", None)"} {"instruction": " collision boundary. Defaults to 5.\n collision_padding: Var[int]\n\n # An element or a rectangle that delimits the area that the popup is confined to. Defaults to the \"clipping-ancestors\".\n collision_boundary: Var[str]\n\n # Whether to maintain the popup in the viewport after the anchor element was scrolled out of view. Defaults to False.\n sticky: Var[bool]\n\n # Whether the popup tracks any layout shift of its positioning anchor. Defaults to True.\n track_anchor: Var[bool]\n\n # Determines which CSS position property to use. Defaults to \"absolute\".\n position_method: Var[LiteralPositionMethod]\n\n # The render prop.\n render_: Var[Component]\n\n @classmethod\n def create(cls, *children, **props) -> BaseUIComponent:\n \"\"\"Create the menu positioner component.\"\"\"\n props[\"data-slot\"] = \"menu-positioner\"\n props.setdefault(\"side_offset\", 4)\n cls.set_class_name(ClassNames.POSITIONER, props)\n return super().create(*children, **props)\n\n\n", "input": "\n\n\nclass MenuArrow(MenuBaseComponent):\n \"\"\"Displays an element positioned against the menu anchor. Renders a
element.\"\"\"\n\n tag = \"Menu.Arrow\"\n\n # The render prop\n render_: Var[Component]\n\n @classmethod\n def create(cls, *children, **props) -> BaseUIComponent:\n \"\"\"Create the menu arrow component.\"\"\"\n props[\"data-slot\"] = \"menu-arrow\"\n cls.set_class_name(ClassNames.ARROW, props)\n return super().create(*children, **props)\n\n\nclass MenuItem(MenuBaseComponent):\n \"\"\"An individual interactive item in the menu. Renders a
element.\"\"\"\n\n tag = \"Menu.Item\"\n\n # Overrides the text label to use when the item is matched during keyboard text navigation.\n label: Var[str]\n\n # Whether to close the menu when the item is clicked. Defaults to True.\n close_on_click: Var[bool]\n\n # Whether the component renders a native