Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Hover Card examples · Preview

Event Preview Hover Card for React

An event name that opens a card with its status, description, date, time and attendees.

Framework
UI library

An event name opens a card with an Upcoming badge, a short description and three lines for the date, the time and the number of attendees. Use it in calendars, agendas and activity feeds where the name alone isn't enough.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

FAQ

What is in the card?

The title with an Upcoming Badge, the description, then a calendar, a clock and a people icon, each beside its detail: Monday, January 15, 2024, 2:00 PM - 3:30 PM (90 min) and 12 attendees.

How is the event name made the trigger?

HoverCardTrigger takes the event name through render, a button with its classes.

How wide is the card?

w-80 on the card, for the extra content. The class is on HoverCardContent. max-w-full keeps it inside narrow screens.

How do I change how fast the card opens and closes?

The card opens a moment after the pointer rests on the trigger and stays up long enough for the pointer to move into it. Both delays are in milliseconds. The demo sets delay 10 and closeDelay 100 on HoverCardTrigger. side and align on HoverCardContent place it.

Does the card open from the keyboard and on touch screens?

Focusing the event name opens the card, moving focus away or pressing Escape closes it. Touch screens have no hover, so keep what matters reachable elsewhere, or use a Popover when the card has to open on a tap.