@base-ui-components/react
Version:
Base UI is a library of headless ('unstyled') React components and low-level hooks. You gain complete control over your app's CSS and accessibility features.
30 lines • 976 B
TypeScript
import * as React from 'react';
import type { ToastManager } from "../createToastManager.js";
/**
* Provides a context for creating and managing toasts.
*
* Documentation: [Base UI Toast](https://base-ui.com/react/components/toast)
*/
export declare const ToastProvider: React.FC<ToastProvider.Props>;
export interface ToastProviderProps {
children?: React.ReactNode;
/**
* 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.
* @default 5000
*/
timeout?: number;
/**
* The maximum number of toasts that can be displayed at once.
* When the limit is reached, the oldest toast will be removed to make room for the new one.
* @default 3
*/
limit?: number;
/**
* A global manager for toasts to use outside of a React component.
*/
toastManager?: ToastManager;
}
export declare namespace ToastProvider {
type Props = ToastProviderProps;
}