@pagedotapp/page-toast
v0.0.0-alpha.14
Published
PageToast - A reusable React component
Readme
@pagedotapp/page-toast
A toast notification component with multiple variants
Installation
npm install @pagedotapp/page-toastUsage
import { PageToast } from '@pagedotapp/page-toast';
function App() {
return (
// First, get a ref to show the toast
const toastRef = useRef<PageToastHandle>(null);
// Show the toast
toastRef.current?.show();
// Render the toast
<PageToast
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
- @pagedotapp/page-avatar: ^0.1.0-alpha.0
- @pagedotapp/page-icon: ^0.1.0-alpha.0
License
MIT © PageStudio
