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/popover.md.
v0.0.57
  • 简体中文
  • Popover

    数据展示@rockshin/tao-ui

    在触发器附近展示补充信息或轻量交互内容。

    何时使用

    内容比 Tooltip 更丰富,但不需要完整 Modal 时使用 Popover。

    推荐

    • 选择与触发方式匹配的交互。
    • 内容保持紧凑并靠近触发器。

    避免

    • 不要在 Popover 中承载长流程。

    代码演示

    基础用法

    TSX

    悬停、聚焦与点击

    TSX

    弹出位置与箭头

    TSX

    受控弹层与内部关闭

    内容中的按钮可以更新 open,完成后明确关闭弹层。

    TSX

    键盘焦点触发

    trigger=focus 可用于键盘聚焦时展示辅助内容,关键说明也应在页面可见。

    TSX

    箭头与延迟

    悬停延迟使用秒,arrow 控制是否展示箭头。

    TSX

    弹层中的表单

    弹层可以容纳输入和操作;提交后反馈结果并关闭。

    Workspace
    TSX

    API

    Popover

    属性说明类型默认值
    titleHeader content of the popup.PopoverRender-
    contentBody content of the popup.PopoverRender-
    triggerHow the popup opens. Defaults to 'hover'.PopoverTrigger | PopoverTrigger[] | undefinedhover
    placementPopup position relative to the trigger. Defaults to 'top'.PopoverPlacement | undefinedtop
    mouseEnterDelayHover delay in seconds before opening. Defaults to 0.1.number | undefined0.1
    mouseLeaveDelayHover delay in seconds before closing. Defaults to 0.1.number | undefined0.1
    arrowShow a pointing arrow on the popup. Defaults to true.boolean | { pointAtCenter?: boolean | undefined; } | undefinedtrue
    destroyOnHiddenUnmount the popup content while closed. Defaults to false.boolean | undefined-
    destroyTooltipOnHide@deprecated Use destroyOnHidden instead.boolean | undefined-
    classNameMerged onto the popup root.string | undefined-
    style节点样式CSSProperties | undefined-
    childrenExactly one trigger element.ReactNode (必填)-