1.0.0 • Published 11 months ago

react-beomseok-toastify v1.0.0

Weekly downloads
-
License
-
Repository
-
Last release
11 months ago

react-beomseok-toastify

Introduction

이 라이브러리는 리엑트 프로젝트를 위한 토스티파이 컴포넌트입니다.

Get Started

npm

npm install react-beomseok-toastify

yarn

yarn add react-beomseok-toastify

Quick Start

import { useToastify, BSToastify } from 'react-beomseok-toastify';

function App() {
  const { toastList, addToast, removeToast } = useToastify();

  return (
    <div>
      <button
        onClick={() => {
          addToast(content);
        }}
      ></button>
      <BSToastify
        toastList={toastList}
        removeToast={removeToast}
        position={'Right-Bottom'}
        background={'#333333'}
        seconds={7}
      />
    </div>
  );
}

Document

propsvaluetypedescription
toastListtoastList[]현재 생성된 알람의 리스트(useToastify 훅에서 나온 변수를 그대로 사용)
removeToastremoveToast()=>void생성된 알람을 지우는 함수(useToastify훅에서 나온 변수를 그대로 사용)
position'Left-Top','Left-Bottom','Right-Top', 'Right-Bottom'string알람 위치
background'#000000'string알람 배경 색('#'+'16진수 6자리'로 이루어진 문자열)
seconds3number알람 존재 기간