Skip to content
Components

Skip link

Lets keyboard users jump past repeated navigation.

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

<%= lc_stack gap: :related, class: "items-center" do %>
  <%= lc_text "Press Tab on this page: the skip link is the first thing to receive focus.", size: :small, tone: :muted %>
  <%= lc_skip_link "#examples", class: "not-sr-only static" %>
<% end %>
<%= lc_stack gap: :related, class: "items-center" do %>
  <%= lc_text "Press Tab on this page: the skip link is the first thing to receive focus.", size: :small, tone: :muted %>
  <%= lc_skip_link "#examples", class: "not-sr-only static" %>
<% end %>

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.

InputDefaultValues
target"#main"—
labellc_t("lostcoords.ui.skip_link.label")Accessible name, visible where applicable
attributes{}Native HTML attributes; class:, data: and aria: merge with defaults

The examples also use lc_stack and lc_text. 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.

API JSON · LLM reference