Glass
A translucent surface for controls floating over content.
Usage
After the one-time setup, call the helper directly from ERB. No component import is needed.
<div class="relative isolate grid h-64 w-full place-items-center overflow-hidden rounded-3xl bg-linear-to-br from-success/40 via-warning/40 to-primary/30 p-6">
<%= lc_glass as: :label, class: "flex w-full max-w-sm items-center gap-related min-h-control-lg px-content" do %>
<%= lc_icon "magnifying-glass", options: { class: "size-5 text-muted-foreground", "aria-hidden": true } %>
<input type="search" class="min-w-0 flex-1 bg-transparent outline-none" placeholder="Search expenses" aria-label="Search expenses">
<% end %>
</div>
Examples
Search bar
<div class="relative isolate grid h-64 w-full place-items-center overflow-hidden rounded-3xl bg-linear-to-br from-success/40 via-warning/40 to-primary/30 p-6">
<%= lc_glass as: :label, class: "flex w-full max-w-sm items-center gap-related min-h-control-lg px-content" do %>
<%= lc_icon "magnifying-glass", options: { class: "size-5 text-muted-foreground", "aria-hidden": true } %>
<input type="search" class="min-w-0 flex-1 bg-transparent outline-none" placeholder="Search expenses" aria-label="Search expenses">
<% end %>
</div>
API reference
Helpers render semantic HTML and include their interaction wiring. Pass native attributes through class:, data:, aria: and the usual Rails options. Blocks use captured ERB content.
lc_glass
lc_glass(shape: :bar, thick: false, as: :div, **attributes, &block)
| Input | Default | Values |
|---|---|---|
| shape | :bar | — |
| thick | false | true · false |
| as | :div | — |
| attributes | {} | Native HTML attributes; class:, data: and aria: merge with defaults |
| block | Captured block | Captured Rails ERB content |
The examples also use lc_icon. Each is documented on its own page.
Styling and extension
Use class: to merge utilities, native attributes for application behavior, and the theming guide for the shared palette. For custom markup, the advanced class helpers expose the same styles, including glass surfaces and class merging.