Skip to content

Guide ​

基于 Tooltip 的功能引导提示系统,支持标题、描述和图片。通过锚点 ref 联动触发器与内容,适合在输入框、按钮等元素旁挂载一枚 tips 图标,hover 后展示说明信息。

Anatomy ​

  • Guide引导根节点,继承 Tooltip 全部能力(含 touchable)
    • GuideAnchor将包装元素注册为锚点 ref,供 GuideTrigger 定位
    • GuideTrigger触发器,默认渲染 i-tripo:tips 图标并自动绑定锚点
    • GuideContent浮层内容,提供 title / description / img 等预设布局

基本用法 ​

纯文字引导

hover GuideTrigger 图标时展示标题 + 描述。

提示词

纯文字引导(无title)

hover GuideTrigger 图标时展示标题 + 描述。

提示词

带图片 ​

img + title + description

HD Texture

自定义内容(Slot) ​

每个点位(img / title / description)都提供同名具名 slot,传入即覆盖对应 prop 的默认渲染,其余点位仍走 prop。下例用 #img slot 把图片位替换为轮播,title / description 依旧由 prop 提供。

#img slot 渲染轮播

图片点位用 Carousel 覆盖,标题与描述仍走 prop。

风格预览

触摸设备 ​

touchable

触摸设备上允许点击触发(而非仅 hover)。

点击或悬停

API ​

Guide Props ​

继承 TooltipProps,额外提供:

名称 类型 默认值 说明
touchablebooleanfalse触摸设备上支持点击触发

GuideTrigger Props ​

继承 Omit<TooltipTriggerProps, 'reference'>,默认内容为 i-tripo:tips 图标并自动绑定锚点 ref。

GuideAnchor ​

无 Props,将包装元素注册为锚点 ref。

GuideContent Props ​

名称 类型 默认值 说明
titlestring—引导标题
descriptionstring—引导描述文字
imgstring—图片 URL
altstring—图片 alt 文字
classstring—容器 class

GuideContent Slots ​

插槽 作用域 说明
default—自定义整块内容,替代内置的 img / title / description 布局
img—覆盖图片点位,回落到 img / alt prop
title—覆盖标题点位,回落到 title prop
description—覆盖描述点位,回落到 description prop

基于 MIT 协议发布(内部使用)