Var

Component Documentation

matestack core component: Var

Show specs

The HTML <var> tag implemented in Ruby.

Parameters

This component can take 2 optional configuration params and either yield content or display what gets passed to the text configuration param.

# id (optional)

Expects a string with all ids the <var> tag should have.

# class (optional)

Expects a string with all classes the <var> tag should have.

Example 1: Yield a given block

var id: "foo", class: "bar" do
  plain 'Simple text'
end

returns

<var id="foo" class="bar">
  Simple text
</var>

Example 2: Render options[:text] param

var id: "foo", class: "bar", text: 'Simple text'

returns

<var id="foo" class="bar">
  Simple text
</var>