Paragraph
The HTML <p> tag, implemented in Ruby. This is a workaround because the single p is a Kernel method in Ruby (directly writes obj.inspect followed by a newline to the program’s standard output, e.g. p foo equals puts foo.inspect).
Alias: pg
Parameters
This component can take various optional configuration params and either yield content or display what gets passed to the text configuration param.
Text (optional)
Expects a string which will be displayed as the content inside the <p> tag.
HMTL attributes (optional)
This component accepts all the canonical HTML global attributes like id or class.
Examples
Example 1: Yield a given block
paragraph do
plain "Hello World"
endreturns
Example 2: Render options[:text] param
returns
Example 3: Rendering another component inside
returns
Last updated
Was this helpful?