Skip to content

Popover

Floating panel anchored to a trigger.

Installation

bun add @xerobi/ui
import { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger } from "@xerobi/ui/popover"

This component is client-side. In Astro, hydrate it with a client directive.

Examples

Default

import { Button } from "@xerobi/ui/button"
import { Popover, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger } from "@xerobi/ui/popover"

export function PopoverDefault() {
  return (
    <Popover>
      <PopoverTrigger render={<Button variant="outline">Open popover</Button>} />
      <PopoverContent>
        <PopoverHeader>
          <PopoverTitle>Dimensions</PopoverTitle>
          <PopoverDescription>Set the dimensions for the layer.</PopoverDescription>
        </PopoverHeader>
      </PopoverContent>
    </Popover>
  )
}

API reference

Popover

Also accepts every prop of Base UI Popover.

No props of its own.

PopoverContent

No props of its own.

PopoverDescription

No props of its own.

PopoverHeader

Also accepts every prop of <div> element.

No props of its own.

PopoverTitle

No props of its own.

PopoverTrigger

No props of its own.

Styling hooks: [data-slot="popover"], [data-slot="popover-trigger"], [data-slot="popover-content"], [data-slot="popover-header"], [data-slot="popover-title"], [data-slot="popover-description"].

Search documentation

Search pages, components and blocks.