- How
tooltipTypeselects the tooltip component for the entire form - How
tooltipPropsdefine per-component tooltip content and behavior - Where tooltips render and how they are localized
- How to build and register a custom tooltip component
Overview
FormEngine applies tooltips by wrapping rendered components with a tooltip component selected by the form-level tooltipType. The wrapper is only used when a tooltip component is resolved fromtooltipType and a component has
tooltipProps defined in JSON. The tooltip component
receives the wrapped component as children.
tooltipType must reference a component with the tooltip role. If it is not set, the viewer store picks the first component with that
role from the active view and stores it in the form settings.
Select the Tooltip Component
Use the top-level tooltipType setting in your form JSON to choose which tooltip component should wrap the fields.| Setting | Location | Type | Description |
|---|---|---|---|
| tooltipType | Form JSON (root) | string | Tooltip component type with the tooltip role; defaults to first match. |
Configure Tooltip Props
Per-component tooltip configuration lives in tooltipProps. These props are passed directly to the tooltip wrapper component and are localized using thetooltip localization type while sharing the same data root as the wrapped
component.
For a full localization walkthrough, see
Example: Tooltip Localization.
The available tooltip props depend on the chosen UI library. For example:
- Material UI (
MuiTooltip):title,placement,arrow,followCursor,enterDelay,leaveDelay, and related behavior flags. - Rsuite (
RsTooltip):text,placement,trigger.
Where Tooltips Render
Tooltips are applied when tooltipProps is present on standard components (for example, input fields). Containers, templates, and repeaters are not wrapped, even iftooltipProps is defined on them.
Example: Tooltip on a Field
This form enables a tooltip for the email field usingMuiTooltip:
Live example
live
Create a Custom Tooltip
A custom tooltip is a wrapper component that renderschildren and uses props you expose through tooltipProps. To make it available in a
form:
- Build a React component that accepts
childrenand your tooltip props. - Register it with
define(...)and mark it with.componentRole('tooltip'). - Add the tooltip component to the view and set
tooltipTypeto its type.
Example: Simple Tooltip Component
SimpleTooltip.tsx
Live example
live
Summary
- Set
tooltipTypeto a tooltip component in the view. If you omit it, the viewer falls back to the first component with thetooltiprole. - Use
tooltipPropsto opt specific components into tooltips. The props are localized with thetooltiptype. - Tooltips wrap standard components and repeaters only; containers and templates are ignored.
- Register custom tooltips with
componentRole('tooltip')and include them in the view.
For more information:
- Localization
- Forms JSON
- Components Library
- Custom Components
- ComponentStore tooltipProps API