UNPKG

material-you-react

Version:

Material You: Material You (M3) Design system and its components for simple integration with Next.Js or other react-based frameworks

30 lines (29 loc) 1.29 kB
import React from "react"; type BaseSnackBarProps = { supportingText: string; action?: string; actionCallback?: (...args: any[]) => any; icon?: string; duration?: number; offset?: string; enterTransition?: "slide" | "grow"; align?: "start" | "center"; }; type SnackBarProps = (Omit<BaseSnackBarProps, "longerAction"> & { variant: "singleLine"; }) | (BaseSnackBarProps & { variant: "twoLine"; }); /** * A component for displaying brief messages to users, with optional actions. * The SnackBar component supports single-line and two-line variants. * * @param {string} `supportingText` - The main message text displayed inside the SnackBar. * @param {string} `action` - The label for the action button. Optional. * @param {Function} `actionCallback` - A callback function executed when the action button is clicked. Optional. * @param {string} `icon` - The material icon name to display next to the action. Optional. * @param {number} [duration=5] - The duration (in seconds) for which the SnackBar is visible. Defaults to 5 seconds. * @param {'singleLine' | 'twoLine'} `variant` - The layout variant of the SnackBar: either single-line or two-line. */ export default function SnackBar(props: SnackBarProps): React.JSX.Element | null; export {};