120k

Popover

Displays rich content in a portal, triggered by a button.

Installation

pnpm dlx shadcn@latest add @force-ui-vue/popover

Usage

<script setup lang="ts">
import {
  Popover,
  PopoverContent,
  PopoverDescription,
  PopoverHeader,
  PopoverTitle,
  PopoverTrigger,
} from "@/components/ui/popover"
</script>
<template>
  <Popover>
    <PopoverTrigger as-child>
      <Button variant="outline">Open Popover</Button>
    </PopoverTrigger>
    <PopoverContent>
      <PopoverHeader>
        <PopoverTitle>Title</PopoverTitle>
        <PopoverDescription>Description text here.</PopoverDescription>
      </PopoverHeader>
    </PopoverContent>
  </Popover>
</template>

Composition

Use the following composition to build a Popover:

Popover
├── PopoverTrigger
└── PopoverContent

Examples

Basic

A simple popover with a header, title, and description.

Align

Use the align prop on PopoverContent to control the horizontal alignment.

With Form

A popover with form fields inside.

RTL

To enable RTL support in Force UI, see the RTL configuration guide.

API Reference

See the Radix UI Popover documentation.