Empty state
A starting point when there is no content yet.
Usage
After the one-time setup, call the helper directly from ERB. No component import is needed.
<%= lc_empty_state class: "w-full" do %>
<%= lc_icon_badge shape: :circle, tone: :primary, icon: "folder-plus", size: :lg%>
<%= lc_stack gap: :tight, class: "max-w-xs" do %>
<%= lc_heading "No projects yet", level: 3, size: :subheading %>
<%= lc_text "Create a project to get started.", size: :small, tone: :muted %>
<% end %>
<%= lc_button "Create project" %>
<% end %>
Examples
Empty state
No projects yet
Create a project to get started.
<%= lc_empty_state class: "w-full" do %>
<%= lc_icon_badge shape: :circle, tone: :primary, icon: "folder-plus", size: :lg%>
<%= lc_stack gap: :tight, class: "max-w-xs" do %>
<%= lc_heading "No projects yet", level: 3, size: :subheading %>
<%= lc_text "Create a project to get started.", size: :small, tone: :muted %>
<% end %>
<%= lc_button "Create project" %>
<% end %>
Title, text and icon on a card
No drafts yet
Drafts you start appear here until you post them.
<%= lc_empty_state title: "No drafts yet", text: "Drafts you start appear here until you post them.", icon: "pencil-square", card: true, class: "w-full" do %>
<%= lc_button "New draft", icon: "plus" %>
<% end %>
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_empty_state
lc_empty_state(title: nil, text: nil, icon: nil, level: 2, card: false, **attributes, &block)
| Input | Default | Values |
|---|---|---|
| title | nil | — |
| text | nil | — |
| icon | nil | Heroicon name; spacing is handled automatically |
| level | 2 | — |
| card | false | true · false |
| attributes | {} | Native HTML attributes; class:, data: and aria: merge with defaults |
| block | Captured block | Captured Rails ERB content |
The examples also use lc_icon_badge, lc_stack, lc_heading, lc_text, and lc_button. 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.