@fayegram-ai/faye-ui/feedback/toast
Public exports and dependency-resolved component properties, with usage and rendering guidance.
Import
import { Toast } from '@fayegram-ai/faye-ui/feedback/toast';Usage and behavior guide · API JSON
This entry declares a client boundary. Follow the rendering guide for framework integration.
Public exports
| Name | Kind | Resolved declaration type |
|---|---|---|
Toast | value | { readonly Provider: import("react").FC<import("@base-ui/react").ToastProviderProps>; readonly useToastManager: typeof Base.useToastManager; readonly createToastManager: typeof Base.createToastManager; readonly Viewport: { (input: Omit<import("@base-ui/react").ToastViewportProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & { variants?: { readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "tone"> | undefined; } | undefined; }): import("react").ReactElement; displayName: string; }; readonly Root: { (input: Omit<import("@base-ui/react").ToastRootProps, "ref"> & import("react").RefAttributes<HTMLDivElement> & { variants?:… (full type in API JSON) |
Toast
Public component; use the linked family guide for complete composition and behavior.
Dependency-resolved declaration properties. Common React/native HTML attributes are omitted from the table; use the full declaration and React/native references. Generic and union restrictions remain authoritative in TypeScript.
Toast.Provider
| Property | Required | Type | Meaning |
|---|---|---|---|
children | No | ReactNode | See the usage contract and declaration. |
limit | No | number | undefined | The maximum number of toasts that can be displayed at once. When the limit is exceeded, the oldest toasts are marked as limited (via the data-limited attribute) rather than removed, so they can be hidden or animated out. |
timeout | No | number | undefined | The default amount of time (in ms) before a toast is auto dismissed. A value of 0 will prevent the toast from being dismissed automatically. |
toastManager | No | ToastManager<any> | undefined | A global manager for toasts to use outside of a React component. |
Toast.Viewport
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: ToastViewportState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ToastViewportState> | undefined | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. |
style | No | CSSProperties | ((state: ToastViewportState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "tone"> | undefined; } | undefined | See the usage contract and declaration. |
Toast.Root
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: ToastRootState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ToastRootState> | undefined | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. |
style | No | CSSProperties | ((state: ToastRootState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
swipeDirection | No | "left" | "right" | "up" | "down" | ("left" | "right" | "up" | "down")[] | undefined | Direction(s) in which the toast can be swiped to dismiss. |
toast | Yes | ToastRootToastObject<any> | The toast to render. |
variants | No | { readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "tone"> | undefined; } | undefined | See the usage contract and declaration. |
Toast.Positioner
| Property | Required | Type | Meaning |
|---|---|---|---|
align | No | Align | undefined | How to align the popup relative to the specified side. |
alignOffset | No | number | OffsetFunction | undefined | Additional offset along the alignment axis in pixels. Also accepts a function that returns the offset to read the dimensions of the anchor and positioner elements, along with its side and alignment. The function takes a data object parameter with the following properties: - data.anchor: the dimensions of the anchor element with properties width and height. - data.positioner: the dimensions of the positioner element with properties width and height. - data.side: which side of the anchor element the positioner is aligned against. - data.align: how the positioner is aligned relative to the specified side. |
anchor | No | Element | null | undefined | An element to position the toast against. |
arrowPadding | No | number | undefined | Minimum distance to maintain between the arrow and the edges of the popup. Use it to prevent the arrow element from hanging out of the rounded corners of a popup. |
className | No | string | ((state: ToastPositionerState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
collisionAvoidance | No | CollisionAvoidance | undefined | Determines how to handle collisions when positioning the popup. side controls overflow on the preferred placement axis (top/bottom or left/right): - 'flip': keep the requested side when it fits; otherwise try the opposite side (top and bottom, or left and right). - 'shift': never change side; keep the requested side and move the popup within the clipping boundary so it stays visible. - 'none': do not correct side-axis overflow. align controls overflow on the alignment axis (start/center/end): - 'flip': keep side, but swap start and end when the requested alignment overflows. - 'shift': keep side and requested alignment, then nudge the popup along the alignment axis to fit. - 'none': do not correct alignment-axis overflow. fallbackAxisSide controls fallback behavior on the perpendicular axis when the preferred axis cannot fit: - 'start': allow perpendicular fallback and try the logical start side first (top before bottom, or left before right in LTR). - 'end': allow perpendicular fallback and try the logical end side first (bottom before top, or right before left in LTR). - 'none': do not fallback to the perpendicular axis. When side is 'shift', explicitly setting align only supports 'shift' or 'none'. If align is omitted, it defaults to 'flip'. |
collisionBoundary | No | Boundary | undefined | An element or a rectangle that delimits the area that the popup is confined to. |
collisionPadding | No | Padding | undefined | Additional space to maintain from the edge of the collision boundary. |
disableAnchorTracking | No | boolean | undefined | Whether to disable the popup from tracking any layout shift of its positioning anchor. |
positionMethod | No | "absolute" | "fixed" | undefined | Determines which CSS position property to use. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ToastPositionerState> | undefined | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. |
side | No | Side | undefined | Which side of the anchor element to align the toast against. May automatically change to avoid collisions. |
sideOffset | No | number | OffsetFunction | undefined | Distance between the anchor and the popup in pixels. Also accepts a function that returns the distance to read the dimensions of the anchor and positioner elements, along with its side and alignment. The function takes a data object parameter with the following properties: - data.anchor: the dimensions of the anchor element with properties width and height. - data.positioner: the dimensions of the positioner element with properties width and height. - data.side: which side of the anchor element the positioner is aligned against. - data.align: how the positioner is aligned relative to the specified side. |
sticky | No | boolean | undefined | Whether to maintain the popup in the viewport after the anchor element was scrolled out of view. |
style | No | CSSProperties | ((state: ToastPositionerState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
toast | Yes | ToastObject<any> | The toast object associated with the positioner. |
variants | No | { readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "tone"> | undefined; } | undefined | See the usage contract and declaration. |
Toast.Arrow
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: ToastArrowState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ToastArrowState> | undefined | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. |
style | No | CSSProperties | ((state: ToastArrowState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "tone"> | undefined; } | undefined | See the usage contract and declaration. |
Toast.Content
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: ToastContentState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ToastContentState> | undefined | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. |
style | No | CSSProperties | ((state: ToastContentState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "tone"> | undefined; } | undefined | See the usage contract and declaration. |
Toast.Icon
| Property | Required | Type | Meaning |
|---|---|---|---|
variants | No | { readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "tone"> | undefined; } | undefined | See the usage contract and declaration. |
Toast.Message
| Property | Required | Type | Meaning |
|---|---|---|---|
variants | No | { readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "tone"> | undefined; } | undefined | See the usage contract and declaration. |
Toast.Actions
| Property | Required | Type | Meaning |
|---|---|---|---|
variants | No | { readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "tone"> | undefined; } | undefined | See the usage contract and declaration. |
Toast.Title
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: ToastTitleState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ToastTitleState> | undefined | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. |
style | No | CSSProperties | ((state: ToastTitleState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "tone"> | undefined; } | undefined | See the usage contract and declaration. |
Toast.Description
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: ToastDescriptionState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ToastDescriptionState> | undefined | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. |
style | No | CSSProperties | ((state: ToastDescriptionState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "tone"> | undefined; } | undefined | See the usage contract and declaration. |
Toast.Close
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: ToastCloseState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
nativeButton | No | boolean | undefined | Whether the component renders a native <button> element when replacing it via the render prop. Set to false if the rendered element is not a button (for example, <div>). |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ToastCloseState> | undefined | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. |
style | No | CSSProperties | ((state: ToastCloseState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "tone"> | undefined; } | undefined | See the usage contract and declaration. |
Toast.Action
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: ToastActionState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
nativeButton | No | boolean | undefined | Whether the component renders a native <button> element when replacing it via the render prop. Set to false if the rendered element is not a button (for example, <div>). |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ToastActionState> | undefined | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. |
style | No | CSSProperties | ((state: ToastActionState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
variants | No | { readonly size?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "size"> | undefined; readonly tone?: import("@fayegram-ai/faye-ui/contracts/visual-variants").VisualVariant<"toast", "tone"> | undefined; } | undefined | See the usage contract and declaration. |
Toast.Portal
| Property | Required | Type | Meaning |
|---|---|---|---|
className | No | string | ((state: ToastPortalState) => string | undefined) | undefined | CSS class applied to the element, or a function that returns a class based on the component's state. |
container | No | HTMLElement | ShadowRoot | RefObject<HTMLElement | ShadowRoot | null> | null | undefined | A parent element to render the portal element into. |
render | No | ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, ToastPortalState> | undefined | Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render. |
style | No | CSSProperties | ((state: ToastPortalState) => React.CSSProperties | undefined) | undefined | Style applied to the element, or a function that returns a style object based on the component's state. |
Defaults and customization
Descriptor defaults: {"size":"md","tone":"neutral"}. Parts: viewport, positioner, arrow, root, content, icon, message, actions, title, description, close, action. Explicit instance props take precedence over configured defaults.
Use semantic tokens, public part hooks and customization sheets. Keep visual configuration separate from application state.
State, events and accessibility
For interactive controls, pair a controlled value/open prop with its corresponding change callback; default props initialize uncontrolled state. Keep application validation and submission policy explicit. Name controls with visible labels, name icon-only actions on the button, and preserve focus and dismissal behavior when replacing parts. Use native form names and submit/reset types where supported. See the usage guide for component-specific behavior and live examples.
Declaration authority
Generated from packages/faye-ui/dist/feedback/toast.d.ts after the semantic package build. Common native/React attributes are intentionally omitted from property tables. Generic overloads, discriminated unions and complete inherited attributes remain authoritative in installed TypeScript declarations. React DOM attributes and Base UI component contracts describe the inherited foundations.