Skip to content
HomeCobalt

Page layout

One page shape: titled sections in a main column, and cards in a side column that sits beside it when the page's box has room for both, 840px, and under it at full width otherwise.

PageColumns sets the page's two columns inside the width the shell sets, so the content starts at the same place on every page. Each titled block in the main column is a Section, with one heading size and no surface. Each block in the side column is a RailCard, the small card with a heading.

Examples

A section of a fund's page: its heading, a See all link on the heading's baseline, and the quarter it shows chosen after it.

Largest positions

HoldingValueWeight
Fenwick Semiconductor$3.0B9.3%
Marlow Health$2.0B6.2%
Oakline Energy$1.8B5.6%
Kestrel Payments$1.5B4.6%
Elmstead Foods$1.2B3.7%
A whole pageTwo sections in the main column and two rail cards in the rail. Expand opens it at a desktop's width, with the rail beside the main column; in a narrower frame or on a phone the rail sits under it.
ProfileYour profile in the side column, with one secondary button to edit it.

Your profile

Maya Chen

Covers private credit funds at Juniper Ridge Advisers

People at your firm can see your name and your saved searches.

Edit profile

Usage

Use it when

  • A page has a main column and the user's own things beside it, such as their saved items, the funds they follow or this week's plan: PageColumns, with a Section for each titled block in the main column and a RailCard for each block in the rail.
  • Every page of the product, so the content starts at the same place on each.
  • A block in the main column has one place to go for the full list, or a control that changes what it shows: the Section's action and controls.
  • The same block appears in the rail of more than one page and must look the same on each: a RailCard.

Use something else when

  • The page is a single form or a reading page with nothing for a rail. Use the shell's main with a Section instead, and leave PageColumns off.
  • The page is a sign-in or an error page with one block in the middle. Use Empty inside the shell instead.
  • Two things sit side by side inside the main column. Use a grid inside a Section instead; the rail belongs to the page.
  • A block needs a surface in the main column, or a description, an action in its header, an image or a footer. Use Card instead, rendered as a section with an h2.
  • The title names the whole page rather than one block. Use the shell's h1 instead; each block under it is a Section, or a Card when it needs a surface.
  • The control switches the whole block between views of the same data. Use Tabs instead, with the panels as the content.
  • A rail block has nothing to show. Use Empty inside the rail card instead of leaving the card out, so the rail keeps its shape.

Rules

General

Content

Avoid

Limits

Install

npx shadcn@latest add https://kaanarici.com/r/cobalt/page-columns.json https://kaanarici.com/r/cobalt/section.json https://kaanarici.com/r/cobalt/rail-card.json
import { PageColumns } from "@/components/cobalt/ui/page-columns"
import { Section } from "@/components/cobalt/ui/section"
import { RailCard } from "@/components/cobalt/ui/rail-card"