Component

Popover

A lightweight floating surface for compact actions and contextual details.

Preview

Installation

Install the package, then import the component and shared stylesheet in your app.

Package install

Install the package when you want components imported from axie-ui.

install
pnpm add axie-ui

Import

code
import "axie-ui/styles.css";import { Popover } from "axie-ui";

Registry install

Use the direct URL when you want shadcn to copy editable source into your app. This works without the official registry and does not install axie-ui.

registry
pnpm dlx shadcn@latest add https://axie.alexi.life/r/popover.json

Copied source import

code
import "@/styles/axie.css";import { Popover } from "@/components/axie/popover";

Prefer @axie/popover? Add the Axie namespace once from the Installation page, then use that shorthand.

Usage

code
import { Button, Popover } from "axie-ui";export function Example() {  return (    <Popover content={<div>Content</div>}>      <Button>Open</Button>    </Popover>  );}

Accessibility

  • Use popovers for supplemental content, not required form steps.
  • Close on Escape and outside interaction.
  • Keep the trigger and floating content close in the DOM when possible.

API Reference

PropTypeDefaultDescription
alignstart | center | endcenterHorizontal alignment against the trigger.
contentReactNode-Popover content.
openboolean-Controlled open state.
onOpenChange(open: boolean) => void-Called when open state changes.