my/ui

Command Palette

Search for a command to run...

All components

Interactive Tooltip Popover

tooltips

Origin UI component.

responsive · 420px

Install

Same command in any shadcn project — React (Vite/CRA), Next.js, Remix, Astro, and more:

$npx shadcn@latest add https://your-domain/r/comp-384.json

Usage

import Cmp from "@/registry/origin-ui/comp-384";

export default function Demo() {
  return <Cmp />;
}

Component source

import { Button } from "@/components/ui/button";
import {
  Popover,
  PopoverContent,
  PopoverTrigger,
} from "@/components/ui/popover";

export default function Component() {
  return (
    <Popover>
      <PopoverTrigger asChild>
        <Button variant="outline">Tooltip-like popover</Button>
      </PopoverTrigger>
      <PopoverContent className="max-w-[280px] py-3 shadow-none" side="top">
        <div className="space-y-3">
          <div className="space-y-1">
            <p className="font-medium text-[13px]">Popover with button</p>
            <p className="text-muted-foreground text-xs">
              I am a popover that would like to look like a tooltip. I
              can&lsquo;t be a tooltip because of the interactive element inside
              me.
            </p>
          </div>
          <Button className="h-7 px-2" size="sm">
            Know more
          </Button>
        </div>
      </PopoverContent>
    </Popover>
  );
}

Source: Origin UI