react-reusable-ui
v1.0.27
Published
Library X is a light library of reusable React components to help you ship faster. It is still in beta and is subject to refactoring and addition of more components.
Downloads
6
Readme
LIBRARY X
Library X is a light library of reusable React components to help you ship faster. It is still in beta and is subject to refactoring and addition of more components.
Documentation
1. Toast
Import
import { useToast, Toast } from "library-x
Usage
Call useToast as a hook and place Toast as a component in your code.
export default () => {
const { toast, items } = useToast();
const handleNewToast = () =>
toast({
bg: "blue.700",
color: "white",
info: "Login successful, Redirecting now",
size: "30rem",
});
return (
<div>
<h1>Just some random text</h1>
<Toast items={items} />
<button onClick={handleNewToast}>New toast</button>
</div>
);
};
Installation
To use Libray X, install the package and its peer dependencies by running:
yarn add libray-x framer-motion react-icons
# or
npm i libray-x framer-motion react-icons