19 declare(strict_types=1);
39 $factory = $DIC->ui()->factory();
42 $content = $factory->legacy()->content(
'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.');
43 $popover = $factory->popover()->standard($content);
44 $button = $factory->button()->standard(
'Auto Popover',
'#')
45 ->withOnClick($popover->getShowSignal());
47 $content = $factory->legacy()->content(
'The position of this popover is either on top or bottom of the triggerer, based on the available space');
48 $popover2 = $factory->popover()->standard($content)
49 ->withVerticalPosition();
50 $button2 = $factory->button()->standard(
'Vertical Popover',
'#')
51 ->withOnClick($popover2->getShowSignal());
53 $content = $factory->legacy()->content(
'The position of this popover is either on the left or right of the triggerer, based on the available space');
54 $popover3 = $factory->popover()->standard($content)
55 ->withHorizontalPosition();
56 $button3 = $factory->button()->standard(
'Horizontal Popover',
'#')
57 ->withOnClick($popover3->getShowSignal());
61 return $buttons .
$renderer->render([$popover, $popover2, $popover3]);
show_popover_with_different_positions()
description: > Example for rendering a standard popover with different positions.