Skip to content
Klarhimmel UI

Navbar, dot rail

Navbar, dot rail previewNavbar, dot rail preview

Install

npx shadcn add @klarhimmel/navbar-dot-rail
DetailsAbout, usage, props and more

No bar: a slim vertical column of dots on the right edge of its section, centred top to bottom, each a link whose label shows to the left on hover or focus.

Import

Import

import Block from '@/components/klarhimmel/blocks/navbar-dot-rail';
Also called
  • navigation/dot-rail
  • header/dot-rail
About
No bar: a slim vertical column of dots on the right edge of its section, centred top to bottom, each a link whose label shows to the left on hover or focus. The current dot is filled in the accent colour.
Category
The bar at the top of every page: brand, links, one action. New project? Set it up once: /get-started/installation.

Notes

When to use it

Pick it for a long single page where a quiet column of dots on the right edge beats a bar, one dot per section. Pick navbar-sidebar for a full side menu with text, or navbar-simple for an ordinary top bar.

Writing for it

- Two to eight items, each label up to 40 characters. - Set current to the number of the dot that is the page now. - The rail name is read by screen readers only.

Watch out for

The rail sits at the right edge of its own section, so give that section the height of the area it should guide. Labels show only on hover or keyboard focus, so a touch visitor sees dots alone; keep section names obvious.

Usage

The block in a page, with its default content (long lists shortened). Every prop is in the table below.

section.tsx
import { Theme } from '@/components/klarhimmel/theme/style';
import { BlockSurface } from '@/components/klarhimmel/blocks/surface';
import NavbarDotRail from '@/components/klarhimmel/blocks/navbar-dot-rail';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <NavbarDotRail props={{
          "label": "Name this navigation for screen readers",
          "items": [
            {
              "label": "First page",
              "href": "#first"
            },
            {
              "label": "Second page",
              "href": "#second"
            },
            {
              "label": "Third page",
              "href": "#third"
            },
            {
              "label": "Fourth page",
              "href": "#fourth"
            }
          ],
          "current": 1
        }} />
      </BlockSurface>
    </Theme>
  );
}

Props

The type, default and text limit of every prop. On a real page, over-limit text is kept and checkSections flags it (Installation, Check a page before you ship); this live preview shows the default until it fits. The panel above edits all props.

PropTypeDefaultDescription
labelstring'Name this navigation for screen rea…'Text, up to 40 characters.
itemsLink[]4 itemsList of 2 to 8.
currentinteger1Optional; empty is not rendered.