ReScript Shadcn
Get started
  • Installation
Components
  • Accordion
  • Alert
  • AlertDialog
  • AspectRatio
  • Attachment
  • Avatar
  • Badge
  • Breadcrumb
  • Bubble
  • Button
  • ButtonGroup
  • Calendar
  • Card
  • Carousel
  • Chart
  • Checkbox
  • Collapsible
  • Combobox
  • Command
  • ContextMenu
  • DataTable
  • DatePicker
  • Dialog
  • Direction
  • Drawer
  • DropdownMenu
  • Empty
  • Field
  • HoverCard
  • Input
  • InputGroup
  • InputOtp
  • Item
  • Kbd
  • Label
  • Marker
  • Menubar
  • Message
  • MessageScroller
  • NativeSelect
  • NavigationMenu
  • Pagination
  • Popover
  • Progress
  • RadioGroup
  • Resizable
  • ScrollArea
  • Select
  • Separator
  • Sheet
  • Sidebar
  • Skeleton
  • Slider
  • Sonner
  • Spinner
  • Switch
  • Table
  • Tabs
  • Textarea
  • Toast
  • Toggle
  • ToggleGroup
  • Tooltip
  • Typography

Popover

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

Installation#

npx shadcn@latest add @rescript-shadcn/Popover

Usage#

<Popover>
  <Popover.Trigger render={<Button variant=Outline />}>
    {"Open Popover"->React.string}
  </Popover.Trigger>
  <Popover.Content>
    <h4 className="leading-none font-medium"> {"Title"->React.string} </h4>
    <p className="text-muted-foreground text-sm"> {"Description text here."->React.string} </p>
  </Popover.Content>
</Popover>

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.

API Reference#

See the Base UI Popover documentation.

@react.component
let make = () =>
  <Popover>
@react.component
let make = () => {
  <Popover>
@react.component
let make = () => {
  <div className="flex gap-6">
@react.component
let make = () => {
  <Popover>