-
Notifications
You must be signed in to change notification settings - Fork 0
Tooltip
📝 Generated from
docs/components/tooltip.md. Edit it there; changes made in the wiki are overwritten.
The GridTooltip component provides a lightweight, accessible tooltip for any HTML or React element. It is commonly used within columns, actions, or toolbars to display extra information when a user hovers over or focuses a component.
-
Portal Rendering: Tooltips are portalled into the closest
DataGridThemeProvider(.ogx-theme-provider), so they use the theme's overlay colours like the grid's menus and panels, or intodocument.bodyoutside a provider. They areposition: fixedand follow the target when the page or a container scrolls. - Dynamic Calculation: Tooltips calculate their placement relative to the target element when they open.
- Support for React Elements: It wraps its child element to attach event listeners and calculate position.
-
Customizable Delays: Support for
enterDelayandleaveDelay.
Wrap any React element with the GridTooltip and provide a title.
import { GridTooltip } from '@opencorestack/opengridx';
<GridTooltip title="Click to Export">
<button onClick={handleExport}>
Export as Excel
</button>
</GridTooltip>You can choose from four different placements: top, bottom, left, or right.
<GridTooltip title="Top Placement" placement="top">
<span>Hover me</span>
</GridTooltip>
<GridTooltip title="Bottom Placement" placement="bottom">
<span>Hover me</span>
</GridTooltip>
<GridTooltip title="Left Placement" placement="left">
<span>Hover me</span>
</GridTooltip>
<GridTooltip title="Right Placement" placement="right">
<span>Hover me</span>
</GridTooltip>| Property | Type | Default | Description |
|---|---|---|---|
title |
React.ReactNode |
— | Content (text, JSX, etc.) to show inside the tooltip. |
children |
React.ReactElement |
— | The target element the tooltip is attached to. |
placement |
'top', 'bottom', 'left', 'right'
|
'top' |
Direction where the tooltip appears. |
enterDelay |
number |
200 |
Delay (ms) before showing the tooltip on hover or focus. |
leaveDelay |
number |
0 |
Delay (ms) before hiding the tooltip on mouse leave or blur. |
The internal tooltip component is not replaceable via the slots API. For column-header tooltips, set the description field on GridColDef — it renders as the native title attribute on the header cell (v2.0.0+):
{ field: 'revenue', headerName: 'Revenue', description: 'Total billed revenue for the period' }- The tooltip opens on hover and on keyboard focus of the child (focus events bubble to the wrapper), and closes on mouse leave, blur or Escape.
- The open tooltip has
role="tooltip"and an id, and the child'saria-describedbyreferences it (added to anyaria-describedbythe child already has) while it is open. - The tooltip describes its child; it does not name it. Icon-only buttons still need an
aria-label.
OpenGridX 3.2.2 · MIT · This wiki is generated from docs/ on every push to main. To fix a page, open a PR against the source file.
Start here
Components
- DataGrid
- Header
- Row
- Cell
- Toolbar
- Pagination
- Filter Panel
- Tooltip
- Column Visibility
- Column Grouping
- Column Resizing
- Empty State
- Error Overlay
- Aggregation Footer
Features
- Virtualization
- Filtering & Search
- Sorting & Pagination
- Custom Pagination
- Editing & Reordering
- Row Selection
- Clipboard
- Pinning
- State Persistence
- Aggregation & Pivot
- Tree Data & Grouping
- Cell Spanning
- Master-Detail
- Keyboard & Accessibility
- List View
- Infinite Scroll
- Data Source
- Loading States
- Toolbar Customization
- Export (CSV, Excel, JSON, Print)
- PDF Export
Customization
Upgrading
Contributing
- Contributing
- Testing
- Roadmap
- DataGrid orchestration
- GridRowMeta
- useGridControlledState
- useGridRowPipeline
- useGridColumns
- useGridVirtualization
- useGridVisibleRows
- useGridScrollSync
- useGridStateSnapshot