CraftUI

Popover

A framed panel anchored to a trigger, for interactive content.

Installation

npx shadcn@latest add @runqora/craft-popover

Usage

import {
  Popover,
  PopoverContent,
  PopoverDescription,
  PopoverTitle,
  PopoverTrigger,
} from "@/components/craft/popover";

<Popover>
  <PopoverTrigger>Seed</PopoverTrigger>
  <PopoverContent>
    <PopoverTitle>World seed</PopoverTitle>
    <PopoverDescription>Share it to make the same world.</PopoverDescription>
  </PopoverContent>
</Popover>;

Props

PopoverContent

Prop

Type

Accessibility

  • The popover is a dialog named by PopoverTitle and described by PopoverDescription.
  • Focus moves into it when it opens, Escape closes it, and focus returns to the trigger.
  • Use a Tooltip for a short hint, and a popover when there's something to do.

Customization

The panel is 18rem wide. Change it with className on PopoverContent, which never grows past the space on screen.

Dependencies

Source

On this page