Tooltip
A Tooltip component is a small, informative pop-up that appears when a user hovers over or focuses on an element, such as a button or icon. It provides additional context or explanations about that element without cluttering the interface. Tooltips enhance user experience by offering helpful hints, instructions, or details, ensuring that information is accessible without overwhelming the layout.
Rendered live, with the same build of the library you install.
Tooltip.tsx
import { NButton, NTooltip } from '@nayan-ui/react';const Tooltip = () => {return (<div><NTooltip message="This is a tooltip!"><NButton>Hover me</NButton></NTooltip></div>);};export default Tooltip;
| Name | Type | Default | Details |
|---|---|---|---|
| message | React.ReactNode | Required | Tooltip message or content. |
| className | string | ' ' | You can customise by passing tailwind classes. |
| triggerClassName | string | ' ' | You can customise by passing tailwind classes. |
| children | React.ReactNode | Required | Tooltip trigger content. |
| placement | 'top' | 'bottom' | 'left' | 'right' | Optional | Placement of the tooltip. |
| delayShow | number | Optional | Delay in ms before showing. |
| delayHide | number | Optional | Delay in ms before hiding. |
| id | string | Optional | ID for accessibility. |
| ariaLabel | string | Optional | ARIA label for accessibility. |
| triggerProps | React.HTMLAttributes<HTMLElement> | Optional | Props for trigger element. |
| contentProps | React.HTMLAttributes<HTMLDivElement> | Optional | Props for content element. |
Other components solving nearby problems.
- React Tooltip
- React Tooltip Component
- Custom Tooltip in React
- React Tooltip Library
- Example Tooltip in React
- React Tooltip with Hooks
- Tooltip Positioning in React
- React Tooltip Accessibility
- Tooltip Animation in React
- Styling React Tooltip
- Tooltip Trigger Options in React
- React Tooltip API
- React Tooltip Usage Examples
- Hover Tooltip in React
- Click Tooltip in React
- React Tooltip Position
- Responsive React Tooltip
- React Tooltip Tips
- Tooltip Interaction in React
- Advanced React Tooltip
- Implementing Tooltip in React