HextaUI

Hover card: Side

Set side and align on <HoverCardContent />. Logical sides like inline-end follow the reading direction, and the card flips or shifts when it would leave the screen.

import { Button } from "@/components/ui/button"
import {
  HoverCard,
  HoverCardContent,
  HoverCardTrigger,
} from "@/components/ui/hover-card"

const sides = ["top", "inline-end", "bottom", "inline-start"] as const

export function HoverCardSides() {
  return (
    <div className="flex flex-wrap items-center justify-center gap-2">
      {sides.map((side) => (
        <HoverCard key={side}>
          <HoverCardTrigger
            href="#"
            delay={200}
            render={
              <Button variant="outline" nativeButton={false} render={<a />} />
            }
          >
            {side}
          </HoverCardTrigger>
          <HoverCardContent side={side} className="w-48">
            Opens on the {side} side, and flips when there isn’t room.
          </HoverCardContent>
        </HoverCard>
      ))}
    </div>
  )
}

This adds the example as components/examples/hover-card/sides.tsx, together with the Hover card component and the HextaUI theme tokens it needs.

pnpm dlx shadcn@latest add https://hextaui.com/r/hover-card-sides.json

To add only the component, follow the Hover card installation.

Props in this example

The Hover card props this example sets, from the API reference.

PropTypeDefault
href
string–
delayMilliseconds before hover or focus opens the card.
number600
renderRender your own link, such as <Button variant="link" /> or a router link.
ReactElement | (props, state) => ReactElement<a>
PropTypeDefault
side
"top" | "bottom" | "left" | "right" | "inline-start" | "inline-end""bottom"

Every prop is in the Hover card API reference.

See them all, with keyboard support and accessibility notes, on the Hover card page.