AssistantModal
A modal chat UI usually displayed in the bottom right corner of the screen.
Anatomy
API Reference
Root
Contains all parts of the assistant modal.
AssistantModalPrimitiveRootProps
defaultOpen:
The open state of the assistant modal when it is initially rendered. Use when you do not need to control its open state.
open?:
Not recommended. The controlled open state of the assistant modal. Must be used in conjunction with onOpenChange.
onOpenChange?:
Event handler called when the open state of the assistant modal changes.
modal:
The modality of the assistant modal. When set to true, interaction with outside elements will be disabled and only modal content will be visible to screen readers.
Trigger
A button that toggles the open state of the assistant modal. AssistantModalPrimitive.Content
will position itself against this button.
This primitive renders a <button>
element unless asChild
is set.
AssistantModalPrimitiveTriggerProps
asChild:
Change the default rendered element for the one passed as a child, merging their props and behavior.
Read the Composition guide for more details.
Anchor
The anchor element that the assistant modal is attached to. Defaults to the Trigger
element.
This primitive renders a <div>
element unless asChild
is set.
Content
The component that pops out when the assistant modal is open.
This primitive renders a <div>
element unless asChild
is set.
AssistantModalPrimitiveContentProps
asChild:
Change the default rendered element for the one passed as a child, merging their props and behavior.
Read the Composition guide for more details.
side:
The side of the assistant modal to position against.
align:
The alignment of the assistant modal to position against.
dissmissOnInteractOutside:
Dismiss the assistant modal when the user interacts outside of it.
Refer to radix-ui's Documentation for Popover.Content for more details.