When to use
- Filter, sort, and group controls of a table.
- A picker under a button.
When not to
- A list of commands: use MenuButton.
Examples
A filter
import { Button, Popover, PopoverContent, PopoverTrigger, Select, Switch } from '@kition/tessera-ui'
import { FunnelIcon } from '@kition/tessera-icons/react'
export default function Demo() {
return (
<Popover>
<PopoverTrigger asChild>
<Button variant="secondary" size="sm">
<FunnelIcon /> Filter
</Button>
</PopoverTrigger>
<PopoverContent align="start">
<div style={{ display: 'grid', gap: 12, padding: 14 }}>
<strong style={{ fontSize: 13 }}>Show records where</strong>
<Select size="md" defaultValue="open">
<option value="open">Status is Open</option>
<option value="done">Status is Done</option>
</Select>
<label style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', fontSize: 13 }}>
Include archived <Switch aria-label="Include archived" />
</label>
</div>
</PopoverContent>
</Popover>
)
}Props
Popover
Floating content anchored to a trigger: filters, pickers, small forms.
No props.
Also takes the attributes of its HTML element (`className`, `aria-*`, events…).
PopoverContent
The popover's panel: 12px radius, a hairline, the floating shadow; 288px wide unless className says otherwise.
No props.
Also takes the attributes of its HTML element (`className`, `aria-*`, events…).
Used in
2 of Kition's 16 kits use these components.
Cube
Table