@simpledotstudio/simple-toast
v2.0.0-alpha.2
Published
SimpleToast - A reusable React component
Readme
@simpledotstudio/simple-toast
A toast notification component with multiple variants
Installation
npm install @simpledotstudio/simple-toastUsage
import { SimpleToast } from '@simpledotstudio/simple-toast';
function App() {
return (
// First, get a ref to show the toast
const toastRef = useRef<SimpleToastHandle>(null);
// Show the toast
toastRef.current?.show();
// Render the toast
<SimpleToast
ref={toastRef}
title="Success!"
description="Your action was completed"
variant="success"
/>
);
}Props
See the TypeScript definitions for detailed prop types.
Styling
This component uses CSS modules for styling. The styles are injected automatically when you use the component.
Dependencies
Peer Dependencies
- React >=16.8.0
- React DOM >=16.8.0
Required Dependencies
- @radix-ui/react-toast: ^1.2.14
- @simpledotstudio/simple-avatar: ^0.1.0-alpha.0
- @simpledotstudio/simple-icon: ^0.1.0-alpha.0
License
MIT © SimpleStudio
