@app-studio/components
HoverCard
Displays rich content on hover, with customizable trigger and content presentation.
View component sourceImport
ts
import { HoverCard } from '@app-studio/components';New to the library? Complete installation and provider setup first.
Interactive examples
Try the component, then open Code to copy the complete example.
import React from 'react';
import { HoverCard } from '@app-studio/components';
import { Text, Vertical, View } from 'app-studio';
import { Button } from '@app-studio/components';
export const DefaultHoverCard = () => {
return (
<Vertical gap={20} width="100%" maxWidth={400}>
<View>
<Text marginBottom={10}>Default HoverCard</Text>
<HoverCard>
<HoverCard.Trigger>
<Button>Hover Me</Button>
</HoverCard.Trigger>
<HoverCard.Content>
<Text>
The React Framework – created and maintained by @vercel.
</Text>
</HoverCard.Content>
</HoverCard>
</View>
<View>
<Text marginBottom={10}>HoverCard with different positions</Text>
<HoverCard>
<HoverCard.Trigger>
<Button>Hover for Top Position</Button>
</HoverCard.Trigger>
<HoverCard.Content side="top">
<Text>This content appears above the trigger.</Text>
</HoverCard.Content>
</HoverCard>
</View>
<View>
<Text marginBottom={10}>HoverCard with custom styling</Text>
<HoverCard>
<HoverCard.Trigger>
<Button variant="outline">Custom Styled HoverCard</Button>
</HoverCard.Trigger>
<HoverCard.Content
views={{
container: {
backgroundColor: 'color-blue',
color: 'color-white',
borderRadius: '8px',
padding: '16px',
},
}}
>
<Text color="white">
This HoverCard has custom styling with a primary background color-
</Text>
</HoverCard.Content>
</HoverCard>
</View>
</Vertical>
);
};Props
Required props are marked below. A dash indicates an unspecified default. Design system configuration can override implementation defaults.
Scroll horizontally to see every column.
| Prop | Type | Default | Description |
|---|---|---|---|
children | View typestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | — | Content rendered inside the component.Source |
views | { container?: ViewProps; content?: ViewProps; } | — | Style overrides for the named internal parts.Source |
openDelay | number | — | See the type and source declaration for this property.Source |
closeDelay | number | — | See the type and source declaration for this property.Source |
HoverCard.Trigger
Scroll horizontally to see every column.
| Prop | Type | Default | Description |
|---|---|---|---|
children Required | View typestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | — | Content rendered inside the component.Source |
views | { container?: ViewProps; } | — | Style overrides for the named internal parts.Source |
asChild | boolean | — | See the type and source declaration for this property.Source |
HoverCard.Content
Scroll horizontally to see every column.
| Prop | Type | Default | Description |
|---|---|---|---|
children Required | View typestring | number | bigint | boolean | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | React.ReactPortal | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | null | — | Content rendered inside the component.Source |
views | { container?: ViewProps; } | — | Style overrides for the named internal parts.Source |
side | "bottom" | "left" | "right" | "top" | — | See the type and source declaration for this property.Source |
align | "start" | "center" | "end" | — | See the type and source declaration for this property.Source |
sideOffset | number | — | See the type and source declaration for this property.Source |
For shared layout, color, and responsive properties, read Styling & composition and Responsive layouts. Additional native element attributes depend on the target platform.
Usage guidance
- Give controls a visible label or an accessible name, and verify keyboard interaction. See Accessibility.
- For controlled inputs, update the value from the callback shown in the props table. Keep application state in your component or form library.
- These previews run in the browser. Check React Native setup for platform requirements and differences.