Skip to main content
K
Last modified: 4/Oct/2024

useToaster

Programmatically adds a new toast to the screen.

#Usage

import { useToaster } from '@kinsta/stratus' const MyComponent = () => { const { addToaster } = useToaster() const handleClick = () => { addToaster({ title: 'My toaster', type: 'success' }) } return <button onClick={handleClick}>Add toaster</button> }

#Types

  • UseShowToasterType: typing for the useToaster hook

Read more about types here