Label

What're you asking?
Includes a Ruby component and corresponding Rails helper
Ruby

Example

<%= nk_label :greeting, :msg, "Hello" %>

API tries to match ActionView::FormHelper#label.

Install

Set up Nitro Kit then

bin/rails generate nitro_kit:add label

Form use

To use in forms, it's easiest to use the Form Builder.

<%= nk_form_with model: @user do |f| %>
  <%= f.field :name %>
  <%= f.field :email, as: :email, label: "E-mail address" %>
<% end %>

Usage

NB: Using through FormBuilder#field is recommended. See Field docs.

nk_label(
  compat_object_name = nil,
  compat_method = nil,
  compat_content_or_options = nil,
  **attrs
)
PropertyDefaultDescription
compat_object_namenil API compatibility Relevant object
compat_methodnil API compatibility Object attribute
compat_options{} API compatibility Options for checkbox
**attrsHTML attributes for <label> element