API
/ Helpers
UI Elements
Helpers for rendering UI elements.
These are available for use in documentation page templates and custom preview inspector panel templates.
code
(language = :html, **opts, &block)
Display a syntax-highlighted block of code.
An alternative to using markdown code blocks for templates that have markdown parsing disabled, or for when more control is required.
Arguments:
language
|
Symbol
|
Which language the code is written in |
opts
|
Hash
|
Options hash |
block
|
Proc
|
Code block |
icon
(name, **opts)
Render an icon.
Lookbook uses icons from the Lucide Icons set and a full list of available icon names can be found on that site.
Arguments:
name
|
Symbol,String
|
Name of the icon |
opts
|
Hash
|
Options hash |
Example:
<%= icon :trash %>
<%= icon :camera, size: 6, style: "color: red;" %>