ui/popover.tsx

shadcn-storybook-registry · bases/base/components/ui/popover.tsx · typescript · MIT
ui

A customizable popover component for displaying contextual content in overlays, useful for menus, tooltips, or settings panels.

// Source: https://github.com/lloydrichards/shadcn-storybook-registry | License: MIT | Copyright 2025 shadcn
// Provided via justclaw.it.com; keep this notice with the code.
"use client";

import { Popover as PopoverPrimitive } from "@base-ui/react/popover";
import * as React from "react";

import { cn } from "@/bases/base/lib/utils";

function Popover({ ...props }: PopoverPrimitive.Root.Props) {
  return <PopoverPrimitive.Root data-slot="popover" {...props} />;
}

function PopoverTrigger({ ...props }: PopoverPrimitive.Trigger.Props) {
  return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />;
}

function PopoverContent({
  className,
  align = "center",
  alignOffset = 0,
  side = "bottom",
  sideOffset = 4,
  ...props
}: PopoverPrimitive.Popup.Props &
  Pick<
    Popov

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key