Skip to main content
K
Last modified: 24/Jun/2024

Toaster

Toasters provide brief feedback about an operation through a message at the bottom of the screen.

#Usage

import { useState } from 'react' import { Toaster } from '@kinsta/stratus' const MyComponent = () => { const [isVisible, setIsVisible] = useState(false) return ( <> <button onClick={() => setIsVisible(true)}> Open Toaster </button> <Toaster type="success" title="You managed to open this. You are a marvel." isOpen={isVisible} onCancel={() => setIsVisible(false)} /> </> ) }

#Props

#onCancel
() => void
#title
Required
ReactNode
Title for the toaster
#text
ReactNode
Text for the toaster
#type
Required
NotificationType
Type of toaster
#isMultiple
boolean
If we want to show more than one toaster
false
#isOpen
boolean
To know if the toaster is open
false
#closeButtonAriaLabel
string
close

#Types

  • ToasterProps: props of the Toaster component processed by stratus
  • NotificationType: strings that identify the type of notification ("success" ǀ "info" ǀ "warning" ǀ "error")

Read more about types here


#See also