# Help Bubble Tooltip URL: /react/components/help-bubble-tooltip Source: https://github.com/daangn/seed-design/blob/dev/docs/content/react/components/help-bubble-tooltip.mdx A tooltip-style Help Bubble that displays supplementary information when the pointer hovers over or focuses on an element. 사용 가능 버전: @seed-design/react@2.0.0, @seed-design/css@2.0.0 ## Preview ```tsx import { IconQuestionmarkCircleFill } from "@karrotmarket/react-monochrome-icon"; import { Icon } from "@seed-design/react"; import { HelpBubbleTooltipTrigger } from "seed-design/ui/help-bubble-tooltip"; import { ActionButton } from "seed-design/ui/action-button"; export default function HelpBubbleTooltipPreview() { return ( } /> ); } ``` ## Installation - npm: npx @seed-design/cli@latest add ui:help-bubble-tooltip - pnpm: pnpm dlx @seed-design/cli@latest add ui:help-bubble-tooltip - yarn: yarn dlx @seed-design/cli@latest add ui:help-bubble-tooltip - bun: bun x @seed-design/cli@latest add ui:help-bubble-tooltip ## Props ### `HelpBubbleTooltipTrigger` ### `HelpBubbleTooltipDelayGroup` ## Examples ### Hover & Focus Moving the pointer over (hover) or using the keyboard to focus on the `children` of `HelpBubbleTooltipTrigger` opens the Help Bubble Tooltip. The `children` should contain a focusable element like a `button`. Help Bubble Tooltip does not include a Close Button or internal interaction elements. If you need to open and close by clicking ([Toggletip](https://inclusive-components.design/tooltips-toggletips/)), or if you need a Close Button, use [Help Bubble](/react/components/help-bubble). ```tsx import { IconExclamationmarkCircleFill } from "@karrotmarket/react-monochrome-icon"; import { HelpBubbleTooltipTrigger } from "seed-design/ui/help-bubble-tooltip"; import { ActionButton } from "seed-design/ui/action-button"; import { Icon } from "@seed-design/react"; export default function HelpBubbleHover() { return ( } /> ); } ``` ### Delay `openDelay` controls the time until opening after the pointer moves in, and `closeDelay` controls the time until closing after the pointer moves away. The defaults are `200ms` and `100ms` respectively, and neither delay is applied when opening by focus. ```tsx import { IconClockFill } from "@karrotmarket/react-monochrome-icon"; import { HStack, Icon } from "@seed-design/react"; import { HelpBubbleTooltipTrigger } from "seed-design/ui/help-bubble-tooltip"; import { ActionButton } from "seed-design/ui/action-button"; export default function HelpBubbleTooltipDelay() { return ( } /> } /> ); } ``` ### Delay Group Once one Help Bubble Trigger in the same `HelpBubbleTooltipDelayGroup` is open, moving the pointer to another trigger in the same group opens it immediately without `openDelay`. You can specify `openDelay` or `closeDelay` in `HelpBubbleTooltipDelayGroup` to control the delays of triggers within the group uniformly. If you directly set `openDelay` or `closeDelay` on a `HelpBubbleTooltipTrigger` within the group, that value takes precedence over the group delay. ```tsx import { IconBellFill, IconMagnifyingglassFill, IconPencilFill, IconPersonCircleFill, } from "@karrotmarket/react-monochrome-icon"; import { HStack, PrefixIcon } from "@seed-design/react"; import { HelpBubbleTooltipDelayGroup, HelpBubbleTooltipTrigger, } from "seed-design/ui/help-bubble-tooltip"; import { ActionButton } from "seed-design/ui/action-button"; export default function HelpBubbleTooltipDelayGroupExample() { return ( } /> 검색 } /> 글쓰기 } /> 알림 } /> 프로필 ); } ``` ### Keep Open on Content Hover By default, moving the pointer over the Help Bubble Tooltip is considered leaving the trigger and it closes. With `keepOpenOnContentHover`, moving the pointer over the Help Bubble Tooltip does not close it, and you can interact with the content, such as dragging to select text inside the Help Bubble Tooltip. ```tsx import { IconEyeFill } from "@karrotmarket/react-monochrome-icon"; import { HStack, Icon } from "@seed-design/react"; import { HelpBubbleTooltipTrigger } from "seed-design/ui/help-bubble-tooltip"; import { ActionButton } from "seed-design/ui/action-button"; export default function HelpBubbleTooltipKeepOpenOnContentHover() { return ( } /> } /> ); } ``` ### Placement ```tsx import { IconStarFill } from "@karrotmarket/react-monochrome-icon"; import { Box, Icon } from "@seed-design/react"; import { HelpBubbleTooltipTrigger } from "seed-design/ui/help-bubble-tooltip"; import { ActionButton } from "seed-design/ui/action-button"; export default function HelpBubbleTooltipPlacement() { return (
} /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> } />
); } ``` ### Flip ```tsx import { IconHeartFill } from "@karrotmarket/react-monochrome-icon"; import { Icon } from "@seed-design/react"; import { HelpBubbleTooltipTrigger } from "seed-design/ui/help-bubble-tooltip"; import { ActionButton } from "seed-design/ui/action-button"; export default function HelpBubbleTooltipFlip() { return ( } /> ); } ``` ### Description You can add a description below `title` using `description`. ```tsx import { IconBookmarkFill } from "@karrotmarket/react-monochrome-icon"; import { Icon } from "@seed-design/react"; import { HelpBubbleTooltipTrigger } from "seed-design/ui/help-bubble-tooltip"; import { ActionButton } from "seed-design/ui/action-button"; export default function HelpBubbleTooltipDescription() { return ( } /> ); } ``` ### Title Only ```tsx import { IconGiftFill } from "@karrotmarket/react-monochrome-icon"; import { Icon } from "@seed-design/react"; import { HelpBubbleTooltipTrigger } from "seed-design/ui/help-bubble-tooltip"; import { ActionButton } from "seed-design/ui/action-button"; export default function HelpBubbleTooltipTitleOnly() { return ( } /> ); } ``` ### Setting Width Manually `content` has a default maximum width. Specifying `maxWidth` in `contentProps` overrides this default, and specifying `none` removes the maximum width limit. ```tsx import { HStack } from "@seed-design/react"; import { HelpBubbleTooltipTrigger } from "seed-design/ui/help-bubble-tooltip"; import { ActionButton } from "seed-design/ui/action-button"; const TITLE = "Pariatur aliqua commodo eu Lorem minim anim. Lorem ipsum voluptate eu duis eiusmod consequat."; const MAX_WIDTHS = ["200px", "400px", "none"] as const; export default function HelpBubbleTooltipWidth() { return ( {MAX_WIDTHS.map((maxWidth) => ( {maxWidth} ))} ); } ``` ### Line Breaks ```tsx import { IconFlagFill } from "@karrotmarket/react-monochrome-icon"; import { HStack, Icon } from "@seed-design/react"; import { HelpBubbleTooltipTrigger } from "seed-design/ui/help-bubble-tooltip"; import { ActionButton } from "seed-design/ui/action-button"; export default function HelpBubbleTooltipLineBreaks() { return ( Breaking
lines
using
`<br />`s } > } />
} />
); } ``` ### `z-index` Offset ```tsx import { IconGearFill } from "@karrotmarket/react-monochrome-icon"; import { Flex, HStack, Icon, VStack } from "@seed-design/react"; import { useState } from "react"; import { HelpBubbleTooltipTrigger } from "seed-design/ui/help-bubble-tooltip"; import { ActionButton } from "seed-design/ui/action-button"; import { Slider } from "seed-design/ui/slider"; export default function HelpBubbleTooltipZIndexOffset() { const [zIndexOffset, setZIndexOffset] = useState(5); return ( {Array.from({ length: 5 }, (_, i) => ( {i + 100} ))} } /> setZIndexOffset(value)} markers={[0, 5]} getAriaLabel={() => "zIndexOffset"} hideValueIndicator /> ); } ``` ### Accessibility #### Icon-only Button The content of Help Bubble Tooltip functions as a description of the trigger, not as a replacement for the trigger's name. Regardless of whether Help Bubble Tooltip is used, always provide `aria-label` for buttons with only icons and no text. ```tsx {/* Provide aria-label to the icon-only ActionButton. */} {/* [!code highlight] */} } /> ``` #### Disabled Triggers By default, `