Person information beside a real link
Preview a project owner before following their link. The complete information remains in the destination section for touch, keyboard and assistive technology users.
Keyboard
- Tab focuses the person link; Enter follows its real destination.
- Base UI may show a visual preview on keyboard focus after the same delay.
- Escape dismisses a shown preview. Its supplementary content is outside the tab and screen reader order.
States covered
- Hover and focus timing
- Real destination
- Supplementary person metadata
- No popup actions
Install this complete example and its component dependencies.
npx shadcn@latest add https://ui.bld8.dev/r/example-preview-person.jsonComplete source
/*!
MIT License
Copyright (c) 2026 Jaison
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
'use client';
import '@bld8/ui/styles.css';
import { PreviewCard, PreviewCardTrigger, PreviewCardPopup } from '@bld8/ui/preview-card';
export function PersonPreviewExample() {
return <div style={{ width: '100%', display: 'grid', gap: 28 }}>
<PreviewCard>
<p style={{ margin: 0 }}>Project owner: <PreviewCardTrigger href="#preview-person-details" delay={350} closeDelay={200}>Maya Chen</PreviewCardTrigger></p>
<PreviewCardPopup className="person-preview">
<div className="bui-preview-heading"><span className="bui-preview-avatar">MC</span><div><p className="bui-preview-title">Maya Chen</p><p className="bui-preview-meta">Design systems · Sydney</p></div></div>
<p className="bui-preview-description">Maintains the shared component library and reviews interaction changes.</p>
<div className="bui-preview-facts"><span>Owner of Atlas</span><span>UTC+11</span></div>
</PreviewCardPopup>
</PreviewCard>
<section id="preview-person-details" style={{ paddingTop: 16, borderTop: '1px solid var(--bui-line)' }}><strong>Maya Chen</strong><p className="bui-hint">Design systems, Sydney (UTC+11). Maintains the shared component library, reviews interaction changes and owns the Atlas project.</p></section>
<p className="bui-hint">Sample person data. Follow the link to read the same information; use a Popover when the popup needs actions.</p>
</div>;
}