FormsPopoverGroup
Searchastronomic.dev# PopoverGroup
To name a set of options in a Popover's panel, like Min and Max.
Static: no JavaScript.
## Usage
```astro
import PopoverGroup from "@astronomic-dev/ui/components/PopoverGroup.astro";
```
## Examples
### A named list
A fieldset with its legend above the options. Open the panel to see it.
```astro
---
import Popover from "@astronomic-dev/ui/components/Popover.astro";
import PopoverGroup from "@astronomic-dev/ui/components/PopoverGroup.astro";
import PopoverOption from "@astronomic-dev/ui/components/PopoverOption.astro";
import { sorts } from "../_data/vega.ts";
---
<div class="grid max-w-xs">
<Popover label="Sort" triggerText="Newest" summary="choices">
<PopoverGroup legend="Sort by">
{sorts.map((sort, i) => <PopoverOption type="radio" name="sort" value={sort.value} checked={i === 0}>{sort.label}</PopoverOption>)}
</PopoverGroup>
</Popover>
</div>
```
## Props
### PopoverGroup
| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `legend` | `string` | None | Required. The group's name, shown above its options. |
| `legendHidden` | `boolean` | `false` | Keeps the legend for screen readers only, when the panel's own name says it all. |
| `end` | `"min" \| "max"` | None | In a Popover with summary="range": which end this group's radios set. |
| `class` | `string` | None | More classes for the fieldset, merged with cn(), so yours win on conflicts. |
| Slot | Description |
| --- | --- |
| `default` | The PopoverOptions. |
Any other attribute goes on the <fieldset>.
## Accessibility
- A native fieldset and legend, so a screen reader says the group's name as focus enters it.
PopoverGroup
FreeTo name a set of options in a Popover's panel, like Min and Max.
- File
- PopoverGroup.astro
- Group
- Forms
- Kind
- Static: no JavaScript
- Examples
- 1
Examples
Drag the orange handle to set the width. Frames get real breakpoints.
- Static
- Interactive
- Framed
A named list
A fieldset with its legend above the options. Open the panel to see it.
Force statemain.astro
examples/popovergroup/main.astro
---
import Popover from "@astronomic-dev/ui/components/Popover.astro";
import PopoverGroup from "@astronomic-dev/ui/components/PopoverGroup.astro";
import PopoverOption from "@astronomic-dev/ui/components/PopoverOption.astro";
import { sorts } from "../_data/vega.ts";
---
<div class="grid max-w-xs">
<Popover label="Sort" triggerText="Newest" summary="choices">
<PopoverGroup legend="Sort by">
{sorts.map((sort, i) => <PopoverOption type="radio" name="sort" value={sort.value} checked={i === 0}>{sort.label}</PopoverOption>)}
</PopoverGroup>
</Popover>
</div>Minimal · Light