Popover
A Brutalist-styled non-modal floating dialog anchored to a trigger for compact interactive content.
Popover displays a Brutalist non-modal floating panel with crisp 2px borders and hard offset shadows anchored to a trigger, without locking background scroll or trapping Tab navigation.
Preview
Section titled “Preview”<brutalist-popover-root>
<brutalist-popover-trigger>
Open popover
</brutalist-popover-trigger>
<brutalist-popover-content class="w-80">
<brutalist-popover-title>Dimensions</brutalist-popover-title>
<brutalist-popover-description>
Set the dimensions for the layer.
</brutalist-popover-description>
<div class="grid gap-2">
<label>
Width
<input value="100%" />
</label>
<label>
Height
<input value="25px" />
</label>
</div>
<brutalist-popover-close>Done</brutalist-popover-close>
</brutalist-popover-content>
</brutalist-popover-root>Installation
Section titled “Installation”Brutalist Popover will be available starting in 0.3.0-rc.1 and later releases (currently available from workspace source). Import the prototypes directly from @proto.ui/prototypes-brutalist/popover and adapt them for your target runtime:
import { popoverRoot, popoverTrigger, popoverContent, popoverTitle, popoverDescription, popoverClose,} from '@proto.ui/prototypes-brutalist/popover';<BrutalistPopover> <BrutalistPopoverTrigger>Open Popover</BrutalistPopoverTrigger> <BrutalistPopoverContent align="start"> <BrutalistPopoverTitle>Dimensions</BrutalistPopoverTitle> <BrutalistPopoverDescription>Set the dimensions for the layer.</BrutalistPopoverDescription> </BrutalistPopoverContent></BrutalistPopover>Composition
Section titled “Composition”BrutalistPopoverRoot├── BrutalistPopoverTrigger└── BrutalistPopoverContent ├── BrutalistPopoverTitle ├── BrutalistPopoverDescription └── BrutalistPopoverClose- Brutalist visual grammar:
TriggerandCloseuserounded-base(5px), 2px black borders, 4px zero-blur offset shadows, and instant press-only snap;Contentuses a 3px foreground offset shadow without hover or press translation. - Positioning & dismissal: Supports
side,align,sideOffset,alignOffset, andcollisionPadding. Outside presses,Escape,Close, and focus moving outside bothTriggerandContentrequest dismissal.
Examples
Section titled “Examples”A simple popover with a title and description aligned to the start edge.
<brutalist-popover-root>
<brutalist-popover-trigger>
Open Popover
</brutalist-popover-trigger>
<brutalist-popover-content id="brutalist-basic-content">
<brutalist-popover-title>Dimensions</brutalist-popover-title>
<brutalist-popover-description>
Set the dimensions for the layer.
</brutalist-popover-description>
</brutalist-popover-content>
</brutalist-popover-root>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
setElementProps(
document.querySelector('#brutalist-basic-content'),
{ align: 'start' }
);
</script>Use align on Content to control alignment (start, center, or end).
<div id="brutalist-align" class="flex gap-6">
<brutalist-popover-root>
<brutalist-popover-trigger>Start</brutalist-popover-trigger>
<brutalist-popover-content data-align="start" class="w-44">
Aligned to start.
</brutalist-popover-content>
</brutalist-popover-root>
<brutalist-popover-root>
<brutalist-popover-trigger>Center</brutalist-popover-trigger>
<brutalist-popover-content data-align="center" class="w-44">
Aligned to center.
</brutalist-popover-content>
</brutalist-popover-root>
<brutalist-popover-root>
<brutalist-popover-trigger>End</brutalist-popover-trigger>
<brutalist-popover-content data-align="end" class="w-44">
Aligned to end.
</brutalist-popover-content>
</brutalist-popover-root>
</div>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
document
.querySelectorAll('#brutalist-align brutalist-popover-content')
.forEach((el) => {
setElementProps(el, { align: el.getAttribute('data-align') });
});
</script>Controlled
Section titled “Controlled”Pass open and handle openChange to control the popover externally.
<brutalist-popover-root id="brutalist-ctrl-root">
<brutalist-popover-trigger>
Quick settings
</brutalist-popover-trigger>
<brutalist-popover-content class="w-72">
<brutalist-popover-title>Notifications</brutalist-popover-title>
<brutalist-popover-description>
Controlled by parent state via open and openChange.
</brutalist-popover-description>
<brutalist-popover-close>Dismiss</brutalist-popover-close>
</brutalist-popover-content>
</brutalist-popover-root>
<brutalist-button id="brutalist-ctrl-open">
Open externally
</brutalist-button>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
const root = document.querySelector('#brutalist-ctrl-root');
const sync = (open) => setElementProps(root, { open });
sync(false);
root.addEventListener('openChange', (e) => sync(e.detail.open));
document
.querySelector('#brutalist-ctrl-open')
.addEventListener('click', () => sync(true));
</script>Navigation Presentation
Section titled “Navigation Presentation”Set presentation="navigation" on Trigger and Content to render a scrollable anchored navigation panel that preserves native browser link behavior.
<brutalist-popover-root>
<brutalist-popover-trigger id="brutalist-nav-trigger">
Menu
</brutalist-popover-trigger>
<brutalist-popover-content id="brutalist-nav-content">
<brutalist-popover-title>
Documentation navigation
</brutalist-popover-title>
<nav class="flex flex-col">
<a href="#navigation-section-01">Navigation section 01</a>
<a href="#navigation-section-02">Navigation section 02</a>
<a href="#navigation-section-03">Navigation section 03</a>
</nav>
</brutalist-popover-content>
</brutalist-popover-root>
<script type="module">
import { setElementProps } from '@proto.ui/adapter-web-component';
setElementProps(
document.querySelector('#brutalist-nav-trigger'),
{ presentation: 'navigation' }
);
setElementProps(
document.querySelector('#brutalist-nav-content'),
{ presentation: 'navigation' }
);
</script>Root exposes read-only state open, methods openPopover, close, and toggle, and the openChange event.
| Prop | Type | Default |
|---|---|---|
open (Root) | boolean undefined | uncontrolled |
defaultOpen (Root) | boolean | false |
disabled (Root / Trigger / Close) | boolean | false |
a11yLabel (Root) | string | '' |
side (Content) | 'top' 'right' 'bottom' 'left' | 'bottom' |
align (Content) | 'start' 'center' 'end' | 'center' |
sideOffset (Content) | number | 4 |
alignOffset (Content) | number | 0 |
collisionPadding (Content) | number | 8 |
presentation (Trigger / Content) | 'default' 'navigation' | 'default' |
enterDuration / leaveDuration (Content) | number | 0 |