Card

Pick a card, any card. Memorized it? Remember it and put it back in the template.
Includes a Ruby component and corresponding Rails helper
Ruby

The basic Card component comes with a few built-in elements.

I suggest you make it your own. Don't be afraid to make multiple card types and don't tie them too tightly together.

Example

Seal the deal

You've worked for this moment. It's time to make it official.
<%= nk_card do |c| %>
  <%= nk_icon "landmark", class: "size-12" %>
  <%= c.title "Seal the deal" %>
  <%= c.body do %>
      You've worked for this moment. It's time to make it official.
  <% end %>
  <%= c.footer(class: "justify-end") do %>
    <%= nk_primary_button "Shake on it", icon: "handshake" %>
  <% end %>
<% end %>

Install

Set up Nitro Kit then

bin/rails generate nitro_kit:add card

Advanced example

Here's a slightly more advanced example.

Top-Mounted Jet Engines

Tired of being stuck in traffic? See what we have in stock. Best prices in the market.

New!

Usage

nk_card(**attrs) { |card| ... }
PropertyDefaultDescription
**attrsHTML attributes for <div> element
card.title(text = nil, **attrs) { ... }
PropertyDefaultDescription
textnilPlain text content
**attrsHTML attributes for <h2> element
card.body(text = nil, **attrs) { ... }
PropertyDefaultDescription
textnilPlain text content
**attrsHTML attributes for <div> element
card.footer(text = nil, **attrs) { ... }
PropertyDefaultDescription
textnilPlain text content
**attrsHTML attributes for <div> element
card.divider(**attrs) { ... }
PropertyDefaultDescription
**attrsHTML attributes for <hr> element
card.full_width(**attrs) { ... }
PropertyDefaultDescription
**attrsHTML attributes for <div> element