Skip to content
HomeCobalt

Back link

Takes you one level up to the list you came from, the same way on every page.

Examples

A record's page with the way back to its list above the title, drawn by your router's link so going back does not reload the app.
All events

Autumn reading night

Thu, Oct 23, 7:00 PM

In a cardAbove a record's card in a side panel; a way back too long for the column ends in an ellipsis and shows whole on hover.
All events at the Northgate library
Autumn reading night
Thu, Oct 23, 7:00 PM

18 going, 4 on the waitlist.

Usage

Use it when

  • A page sits one level under a list, such as an event under "All events", and you need the way back above the title.
  • The way back must look the same on every page of the app.

Use something else when

  • The path is deeper than one level and every ancestor must show. Use Nav for the sections and a plain row of text links for the ancestors, the Breadcrumb row of coverage-gaps, instead.
  • The link moves between sections of the app. Use Nav instead.
  • The link sits in running text. Use TextLink instead.
  • The control runs an action and goes nowhere, such as closing a sheet. Use Button instead.

Rules

General

Content

Avoid

Limits

Install

npx shadcn@latest add https://kaanarici.com/r/cobalt/back-link.json
import { BackLink } from "@/components/cobalt/ui/back-link"