Duostrap Hover Card
A hover preview card styled with archived Duostrap link ink and popover chrome over Base Hover Card.
Duostrap Hover Card pairs Base Hover Card’s delayed open/close and collision-aware positioning with Bootstrap link styling, a 276px max-width .popover shell and a 150ms linear opacity fade.
Preview
Section titled “Preview”Hover or focus @proto-ui for 150ms to open the Duostrap popover card. Moving into the card keeps it open while hovered.
Web Components React Vue Vue 2
Loading interactive preview… The article and source are ready to read. Interactive controls will appear here when ready.
<wc-duostrap-hover-card-root open-delay="150" close-delay="250">
<wc-duostrap-hover-card-trigger>
@proto-ui
</wc-duostrap-hover-card-trigger>
<wc-duostrap-hover-card-content
side="bottom"
align="center"
side-offset="6"
>
<div class="font-bold text-sm">Proto UI</div>
<p class="text-sm">
Host-neutral interaction protocols rendered with classic
Duostrap popover chrome.
</p>
<span class="text-xs text-muted-foreground">
Joined December 2024
</span>
</wc-duostrap-hover-card-content>
</wc-duostrap-hover-card-root>Installation
Section titled “Installation”Use @proto.ui/prototypes-duostrap/hover-card and your host adapter from the same workspace revision. The React example adapts the exported prototypes directly with @proto.ui/adapter-react.
import * as React from 'react';import { createReactAdapter } from '@proto.ui/adapter-react';import * as proto from '@proto.ui/prototypes-duostrap/hover-card';
const adapt = createReactAdapter(React);const BootstrapHoverCardRoot = adapt(proto.hoverCardRoot);const BootstrapHoverCardTrigger = adapt(proto.hoverCardTrigger);const BootstrapHoverCardContent = adapt(proto.hoverCardContent);
export function Example() { return ( <BootstrapHoverCardRoot openDelay={150} closeDelay={250}> <BootstrapHoverCardTrigger>@proto-ui</BootstrapHoverCardTrigger> <BootstrapHoverCardContent side="bottom" align="center" sideOffset={6}> Host-neutral interaction protocols rendered with Duostrap popover chrome. </BootstrapHoverCardContent> </BootstrapHoverCardRoot> );}Composition and styling
Section titled “Composition and styling”BootstrapHoverCardRoot├── BootstrapHoverCardTrigger└── BootstrapHoverCardContent- Trigger uses the Duostrap link color (
#08c) at rest. Hover and focus apply the theme foreground and an underline in both color schemes. - Content projects the archived
.popovershell (max-width: 276px,6pxborder radius,9px 14pxinner padding) with a150mslinear fade.
Examples
Section titled “Examples” Web Components React Vue Vue 2
Loading interactive preview… The article and source are ready to read. Interactive controls will appear here when ready.
<div class="flex flex-wrap items-center justify-center gap-4">
<wc-duostrap-hover-card-root open-delay="100" close-delay="150">
<wc-duostrap-hover-card-trigger>
Left
</wc-duostrap-hover-card-trigger>
<wc-duostrap-hover-card-content
side="left"
align="center"
side-offset="6"
>
Opens on the left side.
</wc-duostrap-hover-card-content>
</wc-duostrap-hover-card-root>
<wc-duostrap-hover-card-root open-delay="100" close-delay="150">
<wc-duostrap-hover-card-trigger>
Top
</wc-duostrap-hover-card-trigger>
<wc-duostrap-hover-card-content
side="top"
align="center"
side-offset="6"
>
Opens on the top side.
</wc-duostrap-hover-card-content>
</wc-duostrap-hover-card-root>
<wc-duostrap-hover-card-root open-delay="100" close-delay="150">
<wc-duostrap-hover-card-trigger>
Bottom
</wc-duostrap-hover-card-trigger>
<wc-duostrap-hover-card-content
side="bottom"
align="center"
side-offset="6"
>
Opens on the bottom side.
</wc-duostrap-hover-card-content>
</wc-duostrap-hover-card-root>
<wc-duostrap-hover-card-root open-delay="100" close-delay="150">
<wc-duostrap-hover-card-trigger>
Right
</wc-duostrap-hover-card-trigger>
<wc-duostrap-hover-card-content
side="right"
align="center"
side-offset="6"
>
Opens on the right side.
</wc-duostrap-hover-card-content>
</wc-duostrap-hover-card-root>
</div>Trigger Delays
Section titled “Trigger Delays” Web Components React Vue Vue 2
Loading interactive preview… The article and source are ready to read. Interactive controls will appear here when ready.
<div class="flex flex-wrap items-center justify-center gap-6">
<wc-duostrap-hover-card-root open-delay="50" close-delay="100">
<wc-duostrap-hover-card-trigger>
Quick preview (50ms)
</wc-duostrap-hover-card-trigger>
<wc-duostrap-hover-card-content
side="bottom"
align="center"
side-offset="6"
>
Appears after 50ms with the classic 150ms linear fade.
</wc-duostrap-hover-card-content>
</wc-duostrap-hover-card-root>
<wc-duostrap-hover-card-root open-delay="450" close-delay="300">
<wc-duostrap-hover-card-trigger>
Standard preview (450ms)
</wc-duostrap-hover-card-trigger>
<wc-duostrap-hover-card-content
side="bottom"
align="center"
side-offset="6"
>
Waits 450ms before opening and stays open while hovered.
</wc-duostrap-hover-card-content>
</wc-duostrap-hover-card-root>
</div>Disabled
Section titled “Disabled” Web Components React Vue Vue 2
Loading interactive preview… The article and source are ready to read. Interactive controls will appear here when ready.
<div class="flex flex-wrap items-center justify-center gap-6">
<wc-duostrap-hover-card-root open-delay="100" close-delay="150">
<wc-duostrap-hover-card-trigger>
Active link
</wc-duostrap-hover-card-trigger>
<wc-duostrap-hover-card-content
side="bottom"
align="center"
side-offset="6"
>
Hover or focus the link to show the Duostrap popover.
</wc-duostrap-hover-card-content>
</wc-duostrap-hover-card-root>
<wc-duostrap-hover-card-root
disabled
open-delay="100"
close-delay="150"
>
<wc-duostrap-hover-card-trigger>
Disabled link
</wc-duostrap-hover-card-trigger>
<wc-duostrap-hover-card-content
side="bottom"
align="center"
side-offset="6"
>
Disabled links do not open a hover card.
</wc-duostrap-hover-card-content>
</wc-duostrap-hover-card-root>
</div>| Prop | Type | Default |
|---|---|---|
open | boolean undefined | uncontrolled |
defaultOpen | boolean | false |
disabled | boolean | false |
openDelay | number | 700 |
closeDelay | number | 300 |
- Exposed state & methods:
open,openHoverCard(reason?),close(reason?),toggle(reason?) - Exposed events:
openChange({ open: boolean; reason: string | null })
Trigger
Section titled “Trigger”| Prop | Type | Default |
|---|---|---|
disabled | boolean | false |
Content
Section titled “Content”| Prop | Type | Default |
|---|---|---|
side | 'top' 'right' 'bottom' 'left' | 'bottom' |
align | 'start' 'center' 'end' | 'center' |
sideOffset | number | 4 |
alignOffset | number | 0 |
avoidCollisions | boolean | true |
collisionPadding | number | 0 |
enterDuration | number | 150 |
leaveDuration | number | 150 |