# HoverCard

Supply UI 1.1.0. On top of the page.

A small card when a link is hovered or focused: a person, a record. Never the only way to the information

A small card that opens when a link is hovered or focused: a person, a record. Never the only way to reach the information.

## Options

| Option | Type | Default | What it does |
| --- | --- | --- | --- |
| `children` (needed) | `ReactElement<Record<string, unknown>, string \| JSXElementConstructor<any>>` |  | The link the card belongs to. |
| `content` (needed) | `ReactNode` |  | What shows in the card: a short summary of what the link leads to. |

## CSS parts

With the CSS in parts (`/ui/css/`), it needs: `components/button.css`, `components/card.css`, `components/table.css`, `components/tabs.css`, `components/popups.css`, `components/dialog.css`, `components/icons.css`, `components/input-group.css`, `components/calendar.css`, `components/button-group-toggle.css`, `components/code-input.css`, `components/tab-bar.css`, `components/command-palette.css`, `components/prose.css`, `components/carousel-arrows.css`, `components/page-transitions.css`, `parts/carousel.css`, `parts/calendar.css`, `parts/date-time-typed-part.css`, `parts/listbox.css`, `parts/date-picker.css`, `parts/board.css`, besides the ones every page loads.

## In the examples

- Who is on today: A name opens a card about the person (https://www.supply.family/ui/#scene-shifts)

## On top of the page: notes

**States.** Closed, opening (fades and rises), open, closing (fades before what it changed appears: `afterClose`). While open, focus is inside and Escape closes it; when it closes, focus goes back to what opened it.

**Do**
- Name every dialog, drawer and popover (`DialogTitle`, `DrawerTitle`, or `aria-label`).
- Use `AlertDialog` for anything that cannot be undone, with the action named on its button ("Delete 3 files").
- Use a `Drawer` on a phone for what a `Popover` does on a computer.

**Don't**
- Don't open a dialog from a dialog; change what the open one shows instead.
- Don't put the only way to do something in a right-click menu or a tooltip.
- Don't use a toast for something the person must not miss: that is an `Alert` on the page.
