Usage
To create a callout, import and compose the following <Callout>
components:
Title icon
You can pass a FontAwesome icon
into <CalloutTitle>
.
Buttons
To display buttons in your callout, you can pass primaryAction
, primaryActionText
, secondaryAction
, and secondaryActionText
to <CalloutContent>
.
Close button
To display a close button on the callout, set showCloseButton
on <CalloutContent>
.
Arrows
To display an arrow pointing to the trigger, set withArrow
on <CalloutContent>
.
Images
To display an image in the callout, import <CalloutImg>
. Pass an <img>
or NextJS <Image>
component as a child.
API Reference
Callout
Prop | Type | Default |
---|---|---|
defaultOpen | boolean | |
modal | boolean | false |
onOpenChange | (open: boolean) => void | |
open | boolean |
CalloutContent
Inherits properties from Radix Popover.Content
and HTMLElement
.
Prop | Type | Default |
---|---|---|
children | ReactNode | |
align | "start" "center" "end" | "center" |
alignOffset | number | 0 |
asChild | boolean | false |
onCloseAction | MouseEventHandler<HTMLButtonElement> | |
portalContainer | HTMLElement | |
primaryAction | MouseEventHandler<HTMLButtonElement> | |
primaryActionText | string | |
secondaryAction | MouseEventHandler<HTMLButtonElement> | |
secondaryActionText | string | |
showCloseButton | boolean | false |
side | "top" "right" "bottom" "left" | "bottom" |
sideOffset | number | 10 |
withArrow | boolean | false |
CalloutTrigger
Prop | Type | Default |
---|---|---|
asChild | boolean | false |
CalloutTitle
Prop | Type | Default |
---|---|---|
title | string | |
icon | IconDefinition |
CalloutDescription
Prop | Type | Default |
---|---|---|
children | ReactNode |
CalloutImg
Prop | Type | Default |
---|---|---|
children | ReactNode |