import type { Meta, StoryObj } from 'storybook-solidjs-vite'; import { HoverCard } from './hover-card'; import { Button } from './button'; import { componentDescription } from '../stories/docs/element-controls'; const meta = { title: 'Solid (Advanced)/Primitives/HoverCard', component: HoverCard, tags: ['autodocs'], parameters: { layout: 'padded', docs: { description: componentDescription([ 'A floating card that opens when its trigger is hovered or focused, built on the kit\'s DIY overlay core (positioning + dismiss + presence — no third-party dependency). Portals into the active shadow root so it never clips, and a transparent "safe bridge" keeps it open while the pointer travels from trigger to card.', '**When to use:** to reveal supplementary, non-essential context on hover — a user/profile preview, a link or citation preview, an attachment summary. For an actionable menu use `Dropdown`; for a one-line label use `Tooltip`.', '**How to use:** pass the trigger element as `trigger` and the card body as `children`. Tune `openDelay` / `closeDelay` (ms) to taste.', ]), }, }, argTypes: { trigger: { control: false, description: 'The element that opens the card on hover/focus.' }, children: { control: false, description: 'The card contents.' }, openDelay: { control: 'number', description: 'Delay (ms) before the card opens. Default 0.' }, closeDelay: { control: 'number', description: 'Delay (ms) before the card closes after the pointer leaves. Default 300.' }, class: { control: 'text', description: 'Extra classes applied to the card body.' }, }, args: { trigger: , children: (
Ada Lovelace
Wrote the first algorithm intended for a machine. Joined in 1843.
See the{' '}
Custom elements — MDN developer.mozilla.org Define your own HTML elements with the CustomElementRegistry.