Skip to main content
PROYECTOVIVIANA

Popover

Popover displays contextual content anchored to a trigger, without leaving the current view. PopoverTrigger pairs a focusable trigger with the Popover, and PopoverHeader / PopoverFooter give it the standard title-and-actions layout.

Import

import {
  Popover,
  PopoverTrigger,
  PopoverHeader,
  PopoverFooter
} from '@proyecto-viviana/solid-spectrum';

Header and footer

A trigger followed by a Popover. The header takes a title and optional description; the footer holds the actions.

<PopoverTrigger>
  <Button variant="secondary">Settings</Button>
  <Popover placement="bottom" size="M">
    <PopoverHeader
      title="Notifications"
      description="Choose how you'd like to be reached."
    />
    <PopoverFooter>
      <Button variant="secondary" fillStyle="outline">Cancel</Button>
      <Button variant="accent">Save</Button>
    </PopoverFooter>
  </Popover>
</PopoverTrigger>

Sizes

The size prop scales the popover's width. Each of S, M, and L widens the surface a step.

<Popover size="S">…</Popover>
<Popover size="M">…</Popover>
<Popover size="L">…</Popover>

PopoverTrigger Props

Props

PropTypeDefaultDescription
childrenJSX.ElementThe trigger element followed by a Popover

Popover Props

Props

PropTypeDefaultDescription
placement'top' | 'bottom' | 'start' | 'end' | …'bottom'Preferred side of the trigger; flips when space is tight
size'S' | 'M' | 'L''M'Width of the popover surface
childrenJSX.ElementThe popover body, usually a PopoverHeader and PopoverFooter

PopoverHeader Props

Props

PropTypeDefaultDescription
titlestringThe popover's heading
descriptionstringOptional supporting text under the title

PopoverFooter Props

Props

PropTypeDefaultDescription
childrenJSX.ElementFooter content, typically buttons

Accessibility

  • The trigger exposes aria-haspopup and aria-expanded
  • The popover renders with role="dialog" and moves focus inside on open
  • Focus is trapped within the popover while it is open
  • Escape or an outside click dismisses it and restores focus to the trigger
  • The header title names the dialog for assistive technology