Skip to content

Popover

A small anchored surface for contextual information.

OverlayMenu
npx shadcn@latest add @silicon-ui/popover

Installation

With the shadcn CLI

npx shadcn@latest add @silicon-ui/popover

Manually

  1. Install the dependencies

    npm install @radix-ui/react-popover
  2. Copy these files into your project

    • components/silicon-ui/popover/popover.tsx
    • components/silicon-ui/popover/popover.module.css

    Shared with other components. Skip any you already have.

    • components/silicon-ui/lib/escape.ts
  3. Add the foundation, once per app, for the design and motion tokens

    npx shadcn@latest add @silicon-ui/silicon-foundation

Usage

usage.tsx
import { Popover } from "@/components/silicon-ui/popover/popover";

API reference

Popover

Accepts the props of PopoverProps.

PopoverClose

Accepts the props of ButtonHTMLAttributes.

PopoverTrigger

Accepts the props of ButtonHTMLAttributes.

PopoverContent

Accepts the props of PopoverContentImplProps, PopperContentProps, DismissableLayerProps, PopoverContentProps.

Dependencies

npm
@radix-ui/react-popover
Registry
None