@octopusdeploy/design-system-components
Version:
The design systems component library.
43 lines (42 loc) • 1.69 kB
TypeScript
import type React from "react";
export interface SnackbarProps {
/**
* Controls whether the Snackbar is being shown.
*/
open: boolean;
/**
* Controls the width of the snackbar. Use `"large"` for longer content.
*/
size?: Size;
/**
* Specifies how long the Snackbar will remain open, in ms. After the time has elapsed, the Snackbar will invoke the `onClose` callback.
*/
autoHideDuration?: number;
/**
* The content or message that will be displayed within the Snackbar.
*/
content: string | React.ReactNode;
/**
* The callback is invoked when the `autoHideDuration` has elapsed, or when the user clicks anywhere outside the Snackbar. This callback should be used to change the `open` state, controlled in a parent component.
*/
onClose?(): void;
/**
* Controls the text alignment of the content within the Snackbar.
*/
textAlign?: TextAlign;
/**
* Called when the transition to close the snackbar exits.
*/
onExited?: () => void;
}
export type Size = "large" | "small";
export type TextAlign = "center" | "left";
export declare function Snackbar({ open, content, size, onClose, autoHideDuration, textAlign, onExited }: SnackbarProps): import("react/jsx-runtime").JSX.Element;
interface CustomSnackbarProps extends Omit<SnackbarProps, "content" | "textAlign"> {
/**
* Content component for the snackbar. Must have a single root element.
*/
children: React.ReactElement;
}
export declare function DeprecatedCustomSnackbar({ open, children, size, onClose, autoHideDuration }: CustomSnackbarProps): import("react/jsx-runtime").JSX.Element;
export {};