0.0.4 • Published 5 years ago

react-introducer v0.0.4

Weekly downloads
-
License
MIT
Repository
-
Last release
5 years ago

react-introducer

主要用于新手引导

live demo

useage

import {Intro, getController} from 'react-introducer';

<Intro
 tooltip={<div>不添加则显示默认</div>}
 step={1} name="引导1">包裹需要引导的节点</Intro>

const controller = getController('引导1');

controller.start();

api

属性说明类型默认值
name用于处理引导的命名空间, 同一个页面可以添加多个不同name的Intro节点string'global'
step用于设置step的步骤, 最小值是1number必填
tooltip用于显示提示框ReactNode默认Tooltip
placement提示框位置,可选 top left right bottom topLeft topRight bottomLeft bottomRight leftTop leftBottom rightTop rightBottomstring e.g:'top', 'left''top'

tooltipProps

属性说明类型默认值
step当前处于的步骤number
count当前介绍总步骤number
start开始介绍function() => void
end结束介绍function() => void
goToStep根据Intro实例跳转到指定介绍function(step: Intro) => void
prevStep跳转到上一步function() => void
nextStep跳转到下一步function() => void
goToStepNumber根据step跳转到指定步骤function(step: number) => void