Section tabs
Tabs under the title on wider screens that become the phone's dock, beside a create button.
Interact with the example above, or open it in a full window.
Make it yours
After setting up the library, copy the example files into your app and adapt the content. These are composition references, with no block API to install or import.
lc_nav_list with dock: :sm renders where you put it: a row of tabs from sm up, and the fixed dock below sm, with the same glass, safe-area spacing and keyboard hiding as lc_dock.
An lc_dock holding only a menu sits at the dock's end; the docked nav list leaves room for its button.
Example files
The preview renders this ERB and loads these styles and interactions.
app/views/shared/_section_tabs.html.erb
<div class="min-h-screen" data-controller="blocks-mobile-navigation">
<header class="mx-auto flex max-w-2xl items-center justify-between gap-4 px-5 pt-7 pb-6 sm:px-8">
<a href="#projects" class="flex min-h-11 items-center gap-2 font-semibold" data-action="blocks-mobile-navigation#home"><%= lc_icon "square-3-stack-3d", class: "size-5", aria: { hidden: true } %> Studio</a>
<%= lc_avatar "Alex Lee" %>
</header>
<main class="isolate mx-auto flex max-w-2xl flex-col gap-7 px-5 pt-3 sm:px-8">
<div class="flex flex-col gap-2"><%= lc_text "Brand refresh", size: :caption, tone: :muted %><h1 class="text-4xl font-semibold tracking-tight">Finding a fresh perspective.</h1></div>
<%# Tabs under the title from sm up; below sm the same nav list is the dock, beside the create button. %>
<%= lc_nav_list label: "Project", layout: :row, dock: :sm do |nav| %>
<% [ [ "Overview", "projects", "rectangle-stack" ], [ "Notes", "notes", "document-text" ], [ "People", "people", "users" ] ].each do |label, id, icon| %>
<%= nav.link label, "##{id}", icon:, current: id == "projects", data: { action: "blocks-mobile-navigation#select" } %>
<% end %>
<% end %>
<p class="text-sm text-muted-foreground" role="status" aria-live="polite" data-blocks-mobile-navigation-target="status"></p>
<section id="projects" class="flex flex-col gap-4" data-blocks-mobile-navigation-target="panel">
<div class="flex flex-col gap-4" data-blocks-mobile-navigation-target="projects">
<% [ [ "Moodboard", "Colours and type that feel right." ], [ "Logo sketches", "Three directions, one favourite." ], [ "Launch plan", "Who hears first, and when." ] ].each do |title, description| %>
<%= lc_card class: "flex flex-col gap-1" do %><h2 class="text-lg font-semibold"><%= title %></h2><p class="text-sm text-muted-foreground"><%= description %></p><% end %>
<% end %>
</div>
</section>
<section id="notes" class="flex flex-col gap-4" data-blocks-mobile-navigation-target="panel" hidden>
<div class="flex flex-col gap-4" data-blocks-mobile-navigation-target="notes">
<%= lc_card class: "flex flex-col gap-1" do %><h2 class="text-lg font-semibold">Leave a little room.</h2><p class="text-sm text-muted-foreground">The best ideas arrive between the things you planned.</p><% end %>
</div>
<%= lc_field label: "Capture a thought", id: "tabs-thought" do |field| %><%= lc_textarea name: "thought", rows: 4, **field %><% end %>
</section>
<section id="people" class="flex flex-col gap-4" data-blocks-mobile-navigation-target="panel" hidden>
<%= lc_card class: "flex flex-col gap-1" do %><h2 class="text-lg font-semibold">Alex Lee</h2><p class="text-sm text-muted-foreground">Designer</p><% end %>
</section>
</main>
<%= lc_dock do |dock| %>
<%= dock.menu label: "Create something", id: "tabs-create-menu" do |menu| %>
<%= menu.action "New card", icon: "rectangle-stack", data: { action: "blocks-mobile-navigation#add", blocks_mobile_navigation_destination_param: "projects" } %>
<%= menu.action "Add a note", icon: "pencil-square", data: { action: "blocks-mobile-navigation#add", blocks_mobile_navigation_destination_param: "notes" } %>
<% end %>
<% end %>
<template data-blocks-mobile-navigation-target="draft">
<%= lc_card class: "flex flex-col gap-1" do %><h2 class="text-lg font-semibold" data-draft-title></h2><p class="text-sm text-muted-foreground">A fresh start. Make it your own.</p><% end %>
</template>
</div>