Popover
A button that opens a non-modal panel on the native popover API, anchored with a viewport-clamped fallback.
beta
Try it
Lanes
A lane is a pool of model capacity.<Popover id="playground-popover" label="What is a lane?" heading="Lanes">A lane is a pool of model capacity.</Popover>Examples
Quick help
Model pools
A model pool is a group of model capacity. Requests are routed to the first healthy pool in your plan.
<script lang="ts">
import Popover from '@tcpsystems/ui/foundation/Popover';
const uid = $props.id();
</script>
<Popover id={uid} label="What is a model pool?" heading="Model pools">
<p>A model pool is a group of model capacity. Requests are routed to the first healthy pool in your plan.</p>
</Popover>Variants
Secondary
Default trigger for most panels.
Ghost
Low emphasis for toolbars.
Primary
Use for the main action on a page.
<script lang="ts">
import Cluster from '@tcpsystems/ui/foundation/Cluster';
import Popover from '@tcpsystems/ui/foundation/Popover';
const uid = $props.id();
</script>
<Cluster>
<Popover id="{uid}-a" label="Secondary" heading="Secondary"><p>Default trigger for most panels.</p></Popover>
<Popover id="{uid}-b" label="Ghost" variant="ghost" heading="Ghost"><p>Low emphasis for toolbars.</p></Popover>
<Popover id="{uid}-c" label="Primary" variant="primary" heading="Primary"><p>Use for the main action on a page.</p></Popover>
</Cluster>Without heading
Press / to search, g then d for the dashboard, ? to show this list.
<script lang="ts">
import Popover from '@tcpsystems/ui/foundation/Popover';
const uid = $props.id();
</script>
<Popover id={uid} label="Keyboard shortcuts">
<p>Press / to search, g then d for the dashboard, ? to show this list.</p>
</Popover>Interactive
Unread alerts
3 alerts need your attention.
<script lang="ts">
import Button from '@tcpsystems/ui/foundation/Button';
import Popover from '@tcpsystems/ui/foundation/Popover';
const uid = $props.id();
let count = $state(3);
</script>
<Popover id={uid} label="Notifications ({count})" heading="Unread alerts">
<p>{count === 0 ? 'You are all caught up.' : `${count} alerts need your attention.`}</p>
<Button size="sm" disabled={count === 0} onclick={() => (count = 0)}>Mark all read</Button>
</Popover>API
import Popover from '@tcpsystems/ui/foundation/Popover';| Prop | Type | Default |
|---|---|---|
id | string | none |
label | string | none |
heading? | string | none |
variant? | 'secondary' | 'ghost' | 'primary' | 'secondary' |
| Snippet |
|---|
children |
| Hook | Kind |
|---|---|
.tcp-pop | Root class |
data-variant | Data attribute |