For AI agents: the complete documentation index is available at https://rickyshin93.github.io/tao-ui/zh/llms.txt, the full documentation bundle is available at https://rickyshin93.github.io/tao-ui/zh/llms-full.txt, and this page is available as Markdown at https://rickyshin93.github.io/tao-ui/zh/components/dropdown.md.
v0.0.57
  • 简体中文
  • Dropdown

    导航@rockshin/tao-ui

    从触发器打开一组相关操作或选项。

    何时使用

    多个次要操作需要紧凑收纳在一个触发器后时使用 Dropdown。

    推荐

    • 菜单项按任务关系分组。
    • 危险操作使用 danger 语义。
    • 键盘可达并保持清晰焦点。

    避免

    • 不要隐藏唯一的主要操作。

    代码演示

    API

    属性说明类型默认值
    childrenTrigger element (a single React element).ReactNode (必填)-
    triggerHow the menu opens. Defaults to ['click'].DropdownTrigger[] | undefined-
    placementDefaults to 'bottomLeft'. Ignored for contextMenu.DropdownPlacement | undefined-
    disabled是否禁用boolean | undefined-
    arrowShow a pointing arrow on the menu. Defaults to false.boolean | undefined-
    classNameMerged onto the floating content.string | undefined-
    style节点样式CSSProperties | undefined-
    属性说明类型默认值
    childrenMain button content.ReactNode-
    onClickMain button click handler.(() => void) | undefined-
    iconIcon for the trigger button. Defaults to an ellipsis.ReactNode-
    triggerHow the menu opens. Defaults to ['click'].DropdownTrigger[] | undefined-
    placementDefaults to 'bottomLeft'. Ignored for contextMenu.DropdownPlacement | undefined-
    disabled是否禁用boolean | undefined-
    arrowShow a pointing arrow on the menu. Defaults to false.boolean | undefined-
    classNameMerged onto the floating content.string | undefined-
    style节点样式CSSProperties | undefined-