# Alert Component  A toast-like alert notification that slides into view at the top of the screen when rendered, and slides back out of view when the "X" button is clicked/pressed. ## Usage ```javascript import { Alert } from "tailwindcss-stimulus-components" application.register('alert', Alert) ``` To customize the appearance of alerts based on the kind of alert it is, you can do something like this in: `app/helpers/application_helper.rb` ```ruby module ApplicationHelper def tailwind_classes_for(flash_type) { notice: "bg-green-400 border-l-4 border-green-700 text-white", error: "bg-red-400 border-l-4 border-red-700 text-black", }.stringify_keys[flash_type.to_s] || flash_type.to_s end end ``` And then add something like this either directly in the layout file, or in a partial that's rendered directly by the layout: ```html
Stimulus is the JS of the future!