For more examples, visit the Storybook.

Before usage, ensure you have installed the sonner package:

npm install sonner

Add the <Toaster /> component to your application, typically in your main layout or App component:

import { Toaster } from '@studs/react/toaster'

function App() {
  return (
    <>
      <Toaster />
      {/* Other components */}
    </>
  )
}
Example
import { toast } from 'sonner'
...
<StudsButton
    variant='outline'
    onClick={() => {
      toast('Success', {
        description: 'Your message has been sent.',
        action: {
          label: 'Confirm',
        },
        closeButton: true,
      })
    }}
  >
    Send Message
  </StudsButton>

<Toaster /> Props

(Please refer to the sonner documentation for detailed props and options.)

toast() Props

(Please refer to the sonner documentation for detailed props and options.)