ToggleTip#

Github

ToggleTip is an interactive component that combines toggling and tipping. It is mainly used to dynamically display or hide supplementary information in the user interface.

import { ToggleTip, ToggleTipActions } from "wis/toggleTip"

API Reference#

ToggleTip#

NameTypeDefaultDescription
sidetop right left bottomtopThe preferred side of the trigger to render against when open. May change when collisions occur.
alignstart center endcenterThe preferred alignment against the trigger. May change when collisions occur.
textstringnoneThe content text to render in the toggleTip.
openbooleannoneThe controlled open state of the toggleTip. Must be used in conjunction with onOpen
defaultOpenbooleannoneThe open state of the toggleTip when it is initially rendered.
onOpen(open: boolean) => voidnoneEvent handler called when the toggleTip is open state change.

ToggleTipActions#

None

Method#

import { useRef } from "react" import { ToggleTip, type ToggleTipRef } from "wis/toggleTip" function () { const toggleTip = useRef<ToggleTipRef>(null); return <ToggleTip ref={toggleTip} text="The tip content" /> }

Type Definition

interface ToggleTipRef { show: () => void; hide: () => void; }

show(): void#

Display the toggle tip content

hide(): void#

Hide the toggle tip content