@intility/bifrost-react
Version:
React library for Intility's design system, Bifrost.
23 lines (22 loc) • 1 kB
TypeScript
import { ReactNode } from "react";
import { MessageProps } from "../Message/Message.js";
export type FloatingMessageProps = {
/** Maximum number of messages to display at a time (default 3) */
max?: number;
/** Duration in ms to display a message. Recommended between 4000-10000. Set to 0 for no timeout. (default 7000) */
timeout?: number;
/** Place mesages at top of screen (default bottom) */
top?: boolean;
/** Align messages to the left (default right) */
left?: boolean;
};
export type FloatingMessageType = {
id: number;
message: ReactNode;
options?: Omit<MessageProps, "header">;
};
/**
* Provider for stacking floating notifications (aka toast or snackbar) via `useFloatingMessage()` hook
*/
export default function FloatingMessage({ children, max, timeout, top, left, }: React.PropsWithChildren<FloatingMessageProps>): import("react/jsx-runtime").JSX.Element;
export declare function FloatingMessageStack(): import("react/jsx-runtime").JSX.Element;