6 $renderer = $DIC->ui()->renderer();
8 $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.');
9 $popover =
$factory->popover()->standard($content);
10 $button =
$factory->button()->standard(
'Auto Popover',
'#')
11 ->withOnClick($popover->getShowSignal());
13 $content =
$factory->legacy(
'The position of this popover is either on top or bottom of the triggerer, based on the available space');
14 $popover2 =
$factory->popover()->standard($content)
15 ->withVerticalPosition();
16 $button2 =
$factory->button()->standard(
'Vertical Popover',
'#')
17 ->withOnClick($popover2->getShowSignal());
19 $content =
$factory->legacy(
'The position of this popover is either on the left or right of the triggerer, based on the available space');
20 $popover3 =
$factory->popover()->standard($content)
21 ->withHorizontalPosition();
22 $button3 =
$factory->button()->standard(
'Horizontal Popover',
'#')
23 ->withOnClick($popover3->getShowSignal());
25 $buttons = implode(
' ', [$renderer->render($button), $renderer->render($button2), $renderer->render($button3)]);
27 return $buttons . $renderer->render([$popover, $popover2, $popover3]);
show_popover_with_different_positions()