# Tooltip Tooltip is a small, contextual popup that appears when you hover over, tap or focus on a UI element (like a button or icon). It provides quick explanatory text or a hint about the element\'s function without permanently cluttering the screen. **Category:** Components **Storybook:** https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-tooltip--introduction ## Variants documented in Storybook - Tooltips: https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-tooltip--tooltips ## Framework setup ### HTML / CDN ```html ``` ### React ```bash npm install ux4g-web-components ``` ```jsx import 'ux4g-web-components/styles.css'; import 'ux4g-web-components/design-system'; ``` ### Angular Update `angular.json`: ```json { "styles": [ "node_modules/ux4g-web-components/styles/ux4g.css", "src/styles.css" ], "scripts": [ "node_modules/ux4g-web-components/dist/runtime/design-system.js" ] } ``` ## Code examples The snippets below are extracted from the Storybook canvas for Tooltip. Each example shows the rendered HTML, the equivalent React JSX, and the Angular template markup. ### 1. Introduction — Introduction HTML: ```html
Tooltip is a small, contextual popup that appears when you hover over, tap or focus on a UI element (like a button or icon). It provides quick explanatory text or a hint about the element's function without permanently cluttering the screen.
Explore interactive tooltips with various placements and sizes.
Quickly copy placement and size utilities for tooltips.
ux4g-tooltip-top-left
|
ux4g-tooltip-top-center
|
ux4g-tooltip-top-right
|
ux4g-tooltip-left-center
|
ux4g-tooltip-bottom-left
|
ux4g-tooltip-bottom-center
|
ux4g-tooltip-bottom-right
|
ux4g-tooltip-right-center
|
|
Small (S)
ux4g-tooltip-s
|
|
Extra Small (XS)
ux4g-tooltip-xs
|
Tooltip is a small, contextual popup that appears when you hover over, tap or focus on a UI element (like a button or icon). It provides quick explanatory text or a hint about the element's function without permanently cluttering the screen.
Explore interactive tooltips with various placements and sizes.
Quickly copy placement and size utilities for tooltips.
ux4g-tooltip-top-left
|
ux4g-tooltip-top-center
|
ux4g-tooltip-top-right
|
ux4g-tooltip-left-center
|
ux4g-tooltip-bottom-left
|
ux4g-tooltip-bottom-center
|
ux4g-tooltip-bottom-right
|
ux4g-tooltip-right-center
|
|
Small (S)
ux4g-tooltip-s
|
|
Extra Small (XS)
ux4g-tooltip-xs
|
Tooltip is a small, contextual popup that appears when you hover over, tap or focus on a UI element (like a button or icon). It provides quick explanatory text or a hint about the element's function without permanently cluttering the screen.
Explore interactive tooltips with various placements and sizes.
Quickly copy placement and size utilities for tooltips.
ux4g-tooltip-top-left
|
ux4g-tooltip-top-center
|
ux4g-tooltip-top-right
|
ux4g-tooltip-left-center
|
ux4g-tooltip-bottom-left
|
ux4g-tooltip-bottom-center
|
ux4g-tooltip-bottom-right
|
ux4g-tooltip-right-center
|
|
Small (S)
ux4g-tooltip-s
|
|
Extra Small (XS)
ux4g-tooltip-xs
|