3 declare(strict_types=1);
23 $factory = $DIC->ui()->factory();
26 $content = $factory->legacy(
'The position of this popover is calculated automatically based on the available space. Note that the max width CSS setting is used here, as this text is quite long.');
27 $popover = $factory->popover()->standard($content);
28 $button = $factory->button()->standard(
'Auto Popover',
'#')
29 ->withOnClick($popover->getShowSignal());
31 $content = $factory->legacy(
'The position of this popover is either on top or bottom of the triggerer, based on the available space');
32 $popover2 = $factory->popover()->standard($content)
33 ->withVerticalPosition();
34 $button2 = $factory->button()->standard(
'Vertical Popover',
'#')
35 ->withOnClick($popover2->getShowSignal());
37 $content = $factory->legacy(
'The position of this popover is either on the left or right of the triggerer, based on the available space');
38 $popover3 = $factory->popover()->standard($content)
39 ->withHorizontalPosition();
40 $button3 = $factory->button()->standard(
'Horizontal Popover',
'#')
41 ->withOnClick($popover3->getShowSignal());
45 return $buttons .
$renderer->render([$popover, $popover2, $popover3]);
show_popover_with_different_positions()
description: > Example for rendering a standard popover with different positions.