Preview Card
A link that shows a destination preview without interrupting keyboard or screen reader navigation.
The principles of good typography remain in the digital age.
Usage guidelines
- Protect screen reader users' current context: Exposing each preview to screen readers would force people through its contents before they could continue through the page. Keep the link as the only accessible interface, and include all the previewed information at its destination.
- Keep popup content supplementary: Don't put unique or essential information in the popup unless it's also on the linked page. For the reason above, the card's content isn't reachable by touch, keyboard or screen reader: it's a visual progressive enhancement for sighted mouse and keyboard users only.
Anatomy
Import the primitives and assemble the parts:
@using Blazix.Primitives
<PreviewCardRoot>
<PreviewCardTrigger />
<PreviewCardPortal>
<PreviewCardBackdrop />
<PreviewCardPositioner>
<PreviewCardPopup>
<PreviewCardArrow />
<PreviewCardViewport />
</PreviewCardPopup>
</PreviewCardPositioner>
</PreviewCardPortal>
</PreviewCardRoot>API Reference
PreviewCardRoot
Doesn't render its own HTML element.
PreviewCardTrigger
Renders a <a> element.
Other attributes are passed to the element it renders.
PreviewCardPortal
Doesn't render its own HTML element.
PreviewCardBackdrop
Renders a <div> element.
Other attributes are passed to the element it renders.
PreviewCardPositioner
Doesn't render its own HTML element.
PreviewCardPopup
Renders a <div> element.
Other attributes are passed to the element it renders.
PreviewCardArrow
Renders a <div> element.
Other attributes are passed to the element it renders.
PreviewCardViewport
Renders a <div> element.
Other attributes are passed to the element it renders.