Alert

Hey you look over here!
Includes a Ruby component and corresponding Rails helper
Ruby

Example

<%= nk_alert do |a| %>
  <%= nk_icon :"ice-cream-cone" %>
  <%= a.title "Free ice cream!" %>
  <%= a.description "Better be quick everyone." %>
<% end %>

Install

Set up Nitro Kit then

bin/rails generate nitro_kit:add alert

Variants

nk_warning_alert

nk_success_alert

nk_error_alert

Read more about variants

Usage

nk_alert(variant: :default, **attrs) { |alert| ... }
PropertyDefaultDescription
variant:defaultOne of :default / :warning / :error / :success
**attrsHTML attributes for <div> element
alert.title(text = nil, **attrs) { ... }
PropertyDefaultDescription
textnilPlain text content
**attrsHTML attributes for <h5> element
alert.trigger(text = nil, **attrs) { ... }
PropertyDefaultDescription
textnilPlain text content
**attrsHTML attributes for <button> element
alert.content(text = nil, **attrs) { ... }
PropertyDefaultDescription
textnilPlain text content
**attrsHTML attributes for <button> element