UIPin
ComponentsIconsIllustrationsMotionTemplatesApps
Boards
UIPin

Free, open-source UI components, icons, illustrations, motion, templates and apps, in one search. Every item links to its source and licence.

UIPin is free. If it saved you time, you can keep it running:

Buy me a coffee
ComponentsIconsIllustrationsMotionTemplatesAppsLibrariesCompareNew this weekMCP for agentsBoardsPrivacy

Components, icons and artwork belong to their authors and are shown under their open-source licences.

shadcn/ui/Hover Card

Overlays
1 of 4
Compiling

Theme it

Every preview, live

Brand colour

Corner radius

Font

Recolours shadcn’s tokens, Tailwind’s accent colours and colours set in the code. Red, amber and green classes stay, since they usually mean error, warning or success.

4 versions·4 librariesCompare all hover cards →

  • shadcn/ui
  • 8bitcn
  • Eldora UI
  • HextaUI

Hover Card

npx shadcn@latest add https://ui.shadcn.com/r/styles/new-york-v4/hover-card.json
Open in v0 Docs Repo
Library
shadcn/ui
License
MIT
Stack
React · Tailwind CSS · radix
Packages
cnradix-ui
Also adds
avatar, button
Size
44 lines
Demo
From shadcn/ui

Code

registry/new-york-v4/ui/hover-card.tsx

"use client"

import * as React from "react"
import { cn } from "cn"
import { HoverCard as HoverCardPrimitive } from "radix-ui"

function HoverCard({
  ...props
}: React.ComponentProps<typeof HoverCardPrimitive.Root>) {
  return <HoverCardPrimitive.Root data-slot="hover-card" {...props} />
}

function HoverCardTrigger({
  ...props
}: React.ComponentProps<typeof HoverCardPrimitive.Trigger>) {
  return (
    <HoverCardPrimitive.Trigger data-slot="hover-card-trigger" {...props} />
  )
}

function HoverCardContent({
  className,
  align = "center",
  sideOffset = 4,
  ...props
}: React.ComponentProps<typeof HoverCardPrimitive.Content>) {
  return (
    <HoverCardPrimitive.Portal data-slot="hover-card-portal">
      <HoverCardPrimitive.Content
        data-slot="hover-card-content"
        align={align}
        sideOffset={sideOffset}
        className={cn(
          "z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
          className
        )}
        {...props}
      />
    </HoverCardPrimitive.Portal>
  )
}

export { HoverCard, HoverCardTrigger, HoverCardContent }

More like this

Native select

HextaUI·Inputs & forms

Combobox

shadcn/ui·Inputs & forms

Terminal

Magic UI·Media & 3D

Collapsible

HextaUI·Data display

Shift Card

Cult UI·Cards

Ai Sources

SmoothUI·Text effects

Github Inline Comments

Eldora UI·Other

Transition Panel

Motion Primitives·Other

Logo Loop

React Bits·Media & 3DMIT+

Bento Grid

Magic UI·Cards

Border Trail

Motion Primitives·Cursor & effects

Collapsible

shadcn/ui·Data display

Questionnaire

HextaUI·Inputs & forms

Falling Text

React Bits·Text effectsMIT+

Vote Tally

Cult UI·Data display