spg-notice
v0.1.14
Published
custom popup with notice
Downloads
9
Readme
Библиотека уведомлений spg-notice
Демо
https://spg-notice-demo.vercel.app/
Установка
npm i spg-notice
JSX
impot {Notice} from 'spg-notice' const [open, setOpen] = useState(false) return
(
<div><Notice open="{open}" onClose=(()=>setOpen(false)) /></div>
)
Список пропсов которые принимает компонент
- open: boolean ------------------------- показать/скрыть уведомление
- onClose: () => void ------------------- колбек для закртия уведомления
- children?: ReactNode ------------------ чилдрен на случай если нужно добавить свой блок
- title?: string ------------------------ заголовок
- text?: string ------------------------- текст
- buttonTitle?: string ------------------ текст в кнопке
- customButton?: ReactNode -------------- для своей готовой кастомной кнопки
- wrapperClassName?: string ------------- передать класс для общего враппера
- closeIconClassName?: string ----------- передать класс для иконки закрытия
- innerClassName?: string --------------- передать класс дляс окна уведомления
- titleClassName?: string --------------- передать класс дляс заголовка
- textClassName?: string ---------------- передать класс дляс текста
- buttonClassName?: string -------------- передать класс для кнопки
- hideTitle?: boolean ------------------- скрыть заголовок
- hideText?: boolean -------------------- скрыть текст
- hideButton?: boolean ------------------ скрыть кнопку
- transition?: number ------------------- время открытия уведомления (по умолчанию 300)
- buttonStyle?: 'danger' | 'primary' | 'success' | 'warning' - стили для кнопки
стандартны классы для css
- notice-wrap
- notice-inner
- notice-close
- notice-title
- notice-text
- notice-button