Type to search Tours, Hints, options, and events.

to navigate · Enter to open · Esc to close

Documentation

Hints

Group options, per-Hint options, and the eight controller actions.

Hints use the separate driver.js/hints entrypoint and the pentiminax--ux-driver--hints controller. For the introduction, see Hints. Every option below can be set in all three authoring forms.

Create

Component

<twig:Driver:Hints id="orders-help">
    ...
</twig:Driver:Hints>

Twig builder

{% set hints = create_hints('orders-help') %}

PHP builder

$hints = $hintsBuilder->create('orders-help');

HintsBuilder is an autowired service — type-hint it in a controller and Symfony injects it. The id is required and is what ux_hints_action() targets.

Add a Hint

Component

<twig:Driver:Hint hintId="filters" title="Filters" description="Narrow the list first">
    <button type="button">Filters</button>
</twig:Driver:Hint>

Twig builder

{% set hints = hints.addHint('.filters', 'filters', 'Filters', 'Narrow the list first') %}

PHP builder

$hints->addHint(
    element: '.filters',
    id: 'filters',
    title: 'Filters',
    description: 'Narrow the list first',
    side: 'bottom',
    align: 'start',
    options: [],
);

Group options

Option or methodTypeDefault
autostartboolbundle true
beacon / beacon(){side, align, animate, className}Driver.js default
buttonText / buttonText()string or trusted markupDriver.js default
popoverClass / popoverClass()stringnone
popoverOffset / popoverOffset()intDriver.js default
overlay / overlay()boolDriver.js default
overlayColor / overlayColor()stringDriver.js default
overlayOpacity / overlayOpacity()floatDriver.js default

autostart is the one option with no builder method: pass false as the second argument to ux_hints(hints, false), or set :autostart="false" on the component.

Hint options

Option or propTypeDefault
hintId / idstringDriver.js falls back to the index
elementselector or DOM elementrequired in the builder; the component host in Twig
titlestring or trusted markupnull
descriptionstring or trusted markupnull
sidetop, right, bottom, leftbottom
alignstart, center, endstart
tagHTML tag namediv
beacon{side, align, animate, className}group value, then Driver.js default
popoverClassstringnull
showButtonboolDriver.js default
buttonTextstring or trusted markupgroup value, then Driver.js default
dataarraynull

Beacon side and align take the same values as the Hint’s own. Give every Hint an explicit hintId if anything targets it by action — the index fallback shifts whenever the group changes.

Actions

ActionEffectParam
showResolves the hints and shows every beaconnone
hideRemoves every beaconnone
openOpens one Hint’s popoverhintId
closeCloses the open popover, keeping the beaconsnone
dismissRetires one beaconhintId
restoreBrings one dismissed beacon backhintId
restoreAllBrings every dismissed beacon backnone
refreshRecomputes beacon positionsnone

ux_hints_action() prints the matching data-action (and hintId param when needed):

<button {{ ux_hints_action('restore', {hintId: 'export'}) }}>
    Restore export hint
</button>

restoreAll calls Driver.js restore() for every Hint, using the id when present and the zero-based index when it is not.