Netzo Logo

hover-card

For sighted users to preview content available behind a link.

shadcn/ui radix-ui Storybook Figma

Usage

After installation components can be imported and used directly.

import {
  HoverCard,
  HoverCardContent,
  HoverCardTrigger,
} from 'netzo/components/hover-card.tsx'

Examples

Working examples to copy-paste into projects under components/.

Default

import {
  Avatar,
  AvatarFallback,
  AvatarImage,
} from "netzo/components/avatar.tsx";
import { Button } from "netzo/components/button.tsx";
import {
  HoverCard,
  HoverCardContent,
  HoverCardTrigger,
} from "netzo/components/hover-card.tsx";

export default () => {
  return (
    <HoverCard>
      <HoverCardTrigger asChild>
        <Button variant="link">@nextjs</Button>
      </HoverCardTrigger>
      <HoverCardContent className="w-80">
        <div className="flex justify-between space-x-4">
          <Avatar>
            <AvatarImage src="https://github.com/vercel.png" />
            <AvatarFallback>VC</AvatarFallback>
          </Avatar>
          <div className="space-y-1">
            <h4 className="text-sm font-semibold">@nextjs</h4>
            <p className="text-sm">
              The React Framework – created and maintained by @vercel.
            </p>
            <div className="flex items-center pt-2">
              <i className="mdi-calendar mr-2 h-4 w-4 opacity-70" />{" "}
              <span className="text-xs text-muted-foreground">
                Joined December 2021
              </span>
            </div>
          </div>
        </div>
      </HoverCardContent>
    </HoverCard>
  );
};