Toast Edit

A succinct message that is displayed temporarily.

Examples

Installation


  rails generate shadcn-ui toast

Usage

  <%= render_toast header: ,
                   description: %>

The Toast component introduces:

  • app/helpers/components/toast_helper.rb
  • app/javascript/controllers/ui/toast_controller.js
  • app/views/components/ui/_toast.html.erb

render_toast accepts two keyword arguments, one for the header and the second for the description or body of the toast. An optional 3rd argument can be provided for an action element like a button.