프로젝트
GitHub에서 보기
iamhosseindhv/notistack
소개
서로 겹쳐 쌓아 표시할 수 있는 고도로 사용자 지정 가능한 알림 스낵바(토스트)
웹 및 앱 개발측정된 스타 증가
- in 24h
- 0
- in 7 days
- +2
- in 15 days
- +1
- in 1 month
- +1
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Originalnotistack: Display notifications with call of a function.
Easy to use, customizable, smooth transitions, stack and queue them up!
Table of Contents
Getting Started
Use your preferred package manager:
npm install notistack
yarn add notistack
Version guide
| Version | Notes |
|---|---|
v3.x.x |
Latest stable release. Standalone (i.e. not dependent on material-ui) |
<= v2.0.8 |
Requires Material-UI v5 as peer dependency. npm install [email protected] |
<= 1.0.10 |
Requires Material-UI <= v4 as peer dependency. npm install notistack@latest-mui-v4 |
How to use
Instantiate a SnackbarProvider component and start showing snackbars: (see docs for a full list of available props)
import { SnackbarProvider, enqueueSnackbar } from 'notistack';
const App = () => {
return (
<div>
<SnackbarProvider />
<button onClick={() => enqueueSnackbar('That was easy!')}>Show snackbar</button>
</div>
);
};
Alternatively, You can use useSnackbar hook to display Snackbars. Just remember to wrap your app inside of a SnackbarProvider to have access to the hook context:
import { SnackbarProvider, useSnackbar } from 'notistack';
// wrap your app
<SnackbarProvider>
<App />
<MyButton />
</SnackbarProvider>
const MyButton = () => {
const { enqueueSnackbar, closeSnackbar } = useSnackbar();
return <Button onClick={() => enqueueSnackbar('I love hooks')}>Show snackbar</Button>;
};
Online demo
Visit the documentation website to see all the examples.
Or play with a minimal working example: codesandbox
Contribution
Open an issue and your problem will be solved.
Author - Contact
Hossein Dehnokhalaji
관련 프로젝트 살펴보기
불러오는 중…
