Snackbar

The snackbar component is used to give feedback after certain actions.

Props#

useSnackbar#

PropTypeDefaultDescription
actionstring | number | bigint | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<...>
containerStyleStylePropsOptional style overrides for the container wrapping the toast component.
descriptionstring | number | bigint | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<...>The description of the toast
durationnumber5000 ( = 5000ms )The delay before the toast hides (in milliseconds) If set to null, toast will never dismiss.
iconstring | number | bigint | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<...>A custom icon that will be displayed by the toast.
idToastIdThe id of the toast. Mostly used when you need to prevent duplicate. By default, we generate a unique id for each toast
isClosablebooleanfalseIf true, toast will show a close button
onCloseComplete() => voidCallback function to run side effects after the toast has closed.
positionToastPositionbottomThe placement of the toast
render(props: RenderProps) => ReactNodeRender a component toast component. Any component passed will receive 2 props: id and onClose.
status"info" | "warning" | "success" | "error" | "loading"The status of the toast.
titlestring | number | bigint | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | Promise<...>The title of the toast
variantstring

Was this helpful?