Skip to content

Popover

Wraps its children in a <span> carrying Bootstrap’s popover data attributes; a click on the children toggles it. tabler.js initializes every data-bs-toggle="popover" element on page load; for content added later (a Turbo frame, a Live Component render), create the popover yourself with Popover.getOrCreateInstance(element) (import { Popover } from '@tabler/core').

title is optional:

The popover flips to the opposite side when there is no room for the requested one.

By default, only a click on the trigger closes the popover. With data-bs-trigger="focus", any click elsewhere does. The focus must land on the wrapper itself, so make it focusable with tabindex="0" and role="button", and style it as a button:

Prop Type Default Description
content string — Body text, required (data-bs-content)
title string? null Heading (data-bs-title)
placement string 'top' top bottom left right (data-bs-placement)

Other attributes go to the <span>, including Bootstrap options such as data-bs-trigger or data-bs-custom-class. The title and the content are escaped: they are plain text.