Toaster
Toast region (bottom-right). Pair with the `toast()` function.
Code
import * as React from 'react';
import { Button, Toaster, toast } from '@fruit-labs/design';
export default function Demo() {
return (
<div>
<Button
variant="gray"
onClick={() =>
toast({
title: 'Saved to library',
description: 'Morning Focus',
})
}
>
Show toast
</Button>
<Toaster />
</div>
);
}Install
From npm:
npm install @fruit-labs/design
import { Toaster } from '@fruit-labs/design';Or copy the TypeScript source into your project:
npx shadcn@latest add https://design.fruitlabs.online/r/toaster.jsonGuidelines
- Mount once near the root.
staticrenders inline (docs).
Props
| Prop | Type | Required |
|---|---|---|
max | number | No |
static | boolean | No |
items | ToastProps[] | No |
className | string | No |