Skip to content

Popover

Popover::make() anchors a floating panel to a trigger of your choice. Clicking the trigger opens the panel; its content is a regular component schema.

Popover::make('plan-details')
->trigger([Text::make('Pro plan')])
->schema([
Stack::make()->gap(Gap::Small)->schema([
Heading::make('Pro plan', 3),
Text::make('Unlimited seats, priority support, and SSO.'),
]),
]);

->side() and ->align() place the panel relative to the trigger, taking the PopoverSide (Top, Right, Bottom, Left) and PopoverAlign (Start, Center, End) enums. The default is below the trigger, aligned to its start edge.

use Lattice\Ui\Enums\PopoverAlign;
use Lattice\Ui\Enums\PopoverSide;
Popover::make('details')
->side(PopoverSide::Right)
->align(PopoverAlign::Center)
->trigger([Badge::make('3 members')])
->schema([/* … */]);

Popover content stays unmounted until the popover opens. Put a lazy fragment inside and the server request happens on first open — the popover shows the fragment’s skeleton while it loads:

Popover::make('customer-card')
->trigger([Text::make('Acme Inc.')])
->schema([
Fragment::lazy(CustomerCardFragment::class, ['customerId' => $customerId]),
]);

For the same pattern on a table cell, see the text column’s ->popover(). For an ⓘ info popover with trusted HTML content, reach for Tooltip instead.