module Motion::HTML::WithDefaults

Overview

Set up defaults arguments for HTML tags.

This is automatically included in Pages and Components.

Direct including types

Defined in:

motion/html/tags/with_defaults.cr

Instance Method Summary

Instance Method Detail

def with_defaults(**named_args, &) #

This is typically used in components and helper methods to set up defaults for reusable components.

Example in a page or component:

with_defaults field: form.email, class: "input" do |html| html.email_input placeholder: "Email" end

Is the same as:

email_input field: form.email, class: "input", placeholder: "Email"

[View source]