Hover Card
Preview supplementary information.
Examples
Preview supplementary information
Map the components and verify existing behavior.
React code
import { HoverCard, PopoverContent } from "@accelerate/react/components";
export function Example() {
return (
<>
<HoverCard>
<a href="/migration/">Migration guide</a>
<PopoverContent>
<strong>Start with one workflow</strong>
<p>Map the components and verify existing behavior.</p>
</PopoverContent>
</HoverCard>
</>
);
}Angular code
import { Component } from "@angular/core";
import { AccHoverCard, AccPopoverContent } from "@accelerate/angular/components";
@Component({
selector: "app-example",
imports: [
AccHoverCard,
AccPopoverContent,
],
template: `
<div accHoverCard>
<a href="/migration/">Migration guide</a>
<div accPopoverContent>
<strong>Start with one workflow</strong>
<p>Map the components and verify existing behavior.</p>
</div>
</div>
`,
})
export class Example {}Installation
Source preview. The expanded component catalog is ahead of the public npm releases. To run these examples in your own application, use packages built from the SDK source used for the previews or a release that includes the APIs below.
- React
@accelerate/ui@0.4.0and@accelerate/react@0.4.0- Angular
@accelerate/ui@0.4.0and@accelerate/angular@0.2.0
Load @accelerate/ui/theme.css and put acc-theme on the app or the region using Accelerator components. See the framework setup guide for the theme and adapter conventions.
Usage
Place a link or button before PopoverContent. Pointer and focus reveal the preview. Keep essential content accessible through the trigger.
Import the React component HoverCard from @accelerate/react/components. For Angular, add AccHoverCard to the standalone component’s imports and use <div accHoverCard>.
Examples use these React parts: HoverCard, PopoverContent. The Angular examples show the corresponding directives and template hosts.
API reference
- Trigger
- Use a link or button as the focus target.
- PopoverContent
- Reveals supplemental content on pointer entry or keyboard focus.