Arctic Design
Get StartedFoundationsComponentsExamples
K

Snackbar

Provides brief messages or notifications that appear temporarily at the bottom of the screen.

Usage
Variant
import {
SnackbarProvider,
EnqueueSnackbarProps,
useSnackbar,
Button,
Center,
} from '@arctic-kit/snow';
function Demo({ enqueueProps }: { enqueueProps: EnqueueSnackbarProps }) {
const { enqueueSnackbar, closeSnackbar } = useSnackbar();
return (
<Center>
<Button onClick={() => enqueueSnackbar(enqueueProps)}>
Show notification
</Button>
<Button color='secondary' onClick={() => closeSnackbar()}>
Close all
</Button>
</Center>
);
}
function RootApp(props: EnqueueSnackbarProps) {
return (
<SnackbarProvider>
<Demo
enqueueProps={{
variant:"info",
title:"Notification received",
message:"Lorem ipsum dolor sit amet, consectetur adipiscing elit"
}}
/>
</SnackbarProvider>
);
}

API Reference

PropsTypeDefault
autoHideDurationnumber | null | undefined---
onClose(key?: SnackbarKey | undefined) => void---