Skip to content
Components

Dock

A floating bar of primary destinations and quick actions at the bottom of a phone screen.

After the one-time setup, call the helper directly from ERB. No component import is needed.

<%# The transformed frame holds the dock's fixed parts for this preview; in an app they sit on the screen. %>
<div class="relative h-80 w-full max-w-sm overflow-hidden rounded-3xl bg-background transform-gpu">
  <%= lc_dock do |dock| %>
    <%= dock.nav label: "Sections" do |nav| %>
      <%= nav.link "Home", "#", icon: "home", current: true %>
      <%= nav.link "Notes", "#", icon: "document-text" %>
      <%= nav.link "People", "#", icon: "users" %>
    <% end %>
    <%= dock.menu label: "Create", id: "dock-specimen-menu" do |menu| %>
      <%= menu.action "New note", icon: "pencil-square" %>
      <%= menu.action "New project", icon: "rectangle-stack" %>
    <% end %>
  <% end %>
</div>
<%# The transformed frame holds the dock's fixed parts for this preview; in an app they sit on the screen. %>
<div class="relative h-80 w-full max-w-sm overflow-hidden rounded-3xl bg-background transform-gpu">
  <%= lc_dock do |dock| %>
    <%= dock.nav label: "Sections" do |nav| %>
      <%= nav.link "Home", "#", icon: "home", current: true %>
      <%= nav.link "Notes", "#", icon: "document-text" %>
      <%= nav.link "People", "#", icon: "users" %>
    <% end %>
    <%= dock.menu label: "Create", id: "dock-specimen-menu" do |menu| %>
      <%= menu.action "New note", icon: "pencil-square" %>
      <%= menu.action "New project", icon: "rectangle-stack" %>
    <% end %>
  <% end %>
</div>

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_dock

lc_dock(**attributes, &block)
InputDefaultValues
attributes{}Native HTML attributes; class:, data: and aria: merge with defaults
blockCaptured blockCaptured Rails ERB content

lc_dock yields a builder, dock, with these parts. Each part carries data-slot and merges class: and native attributes.

dock.nav

dock.nav(label:, **attributes, &block)
InputDefaultValues
labelRequiredAccessible name, visible where applicable
attributes{}Native HTML attributes; class:, data: and aria: merge with defaults
blockCaptured blockCaptured Rails ERB content

dock.menu

dock.menu(label:, icon: "plus", id: nil, **attributes, &block)
InputDefaultValues
labelRequiredAccessible name, visible where applicable
icon"plus"Heroicon name; spacing is handled automatically
idnil—
attributes{}Native HTML attributes; class:, data: and aria: merge with defaults
blockCaptured blockCaptured Rails ERB content
InputDefaultValues
labelRequiredAccessible name, visible where applicable
iconRequiredHeroicon name; spacing is handled automatically
attributes{}Native HTML attributes; class:, data: and aria: merge with defaults

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.

API JSON · LLM reference