diff --git a/packages/react/src/docs/components/Tooltip.mdx b/packages/react/src/docs/components/Tooltip.mdx index 0b01cac..42ef25b 100644 --- a/packages/react/src/docs/components/Tooltip.mdx +++ b/packages/react/src/docs/components/Tooltip.mdx @@ -184,3 +184,20 @@ import { Tooltip, TooltipContent } from "@components/Tooltip"; + +### Controlled + + + + Preview + Code + + + + + + + + + + \ No newline at end of file diff --git a/packages/react/src/docs/components/TooltipBlocks/Examples/Controlled.tsx b/packages/react/src/docs/components/TooltipBlocks/Examples/Controlled.tsx new file mode 100644 index 0000000..a9b72ce --- /dev/null +++ b/packages/react/src/docs/components/TooltipBlocks/Examples/Controlled.tsx @@ -0,0 +1,16 @@ +import { Button } from "@components/Button"; +import { Tooltip, TooltipContent } from "@components/Tooltip"; +import { useState } from "react"; + +export function Controlled() { + const [opened, setOpened] = useState(false); + + return ( + + +

Tooltip!

+
+ +
+ ); +} diff --git a/packages/react/src/docs/components/TooltipBlocks/Examples/index.ts b/packages/react/src/docs/components/TooltipBlocks/Examples/index.ts index 1f08d68..239edf9 100644 --- a/packages/react/src/docs/components/TooltipBlocks/Examples/index.ts +++ b/packages/react/src/docs/components/TooltipBlocks/Examples/index.ts @@ -5,5 +5,15 @@ import { Top } from "./Top"; import { NoDelay } from "./NoDelay"; import { EarlyDelay } from "./EarlyDelay"; import { LateDelay } from "./LateDelay"; +import { Controlled } from "./Controlled"; -export default { Bottom, Left, Right, Top, NoDelay, EarlyDelay, LateDelay }; +export default { + Bottom, + Left, + Right, + Top, + NoDelay, + EarlyDelay, + LateDelay, + Controlled, +};