Skip to content
Klarhimmel UI

Docs, install panel

Docs, install panel previewDocs, install panel preview

Install

npx shadcn add @klarhimmel/docs-install
DetailsAbout, usage, props and more

An install panel: tabs of copyable code (CLI, Manual, Download), an optional "Uses" chip row, short labelled facts and actions. A tab with no code is left out.

Import

Import

import Block from '@/components/klarhimmel/blocks/docs-install';
Also called
  • docs/install
Category
Documentation sections: headers, install panels, props tables, previews. New project? Set it up once: /get-started/installation.

Notes

When to use it

A tabbed install panel with copyable commands, a row of things the component uses, and a few labelled facts. Use docs-header for a single command and docs-prompt when the thing to copy is text for an AI.

Writing for it

- Tab labels hold 20 characters and each tab holds 400 characters of code, so one command per tab, such as CLI, pnpm or Manual. - Facts take a label of 30 characters and text of 240. Use them for what the install adds to the project and when to reach for the component. - The uses row holds up to 8 chips of 40 characters; name the dependencies a reader would otherwise have to find in the source.

Watch out for

A tab with no code is left out of the published block, and with no script running every remaining tab is shown stacked with its label. The Uses label is only drawn if there are chips, so an empty chip list hides it.

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 DocsInstall from '@/components/klarhimmel/blocks/docs-install';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <DocsInstall props={{
          "title": "Name the step",
          "tabs": [
            {
              "label": "First tab",
              "code": "npm create your-app@latest"
            },
            {
              "label": "Second tab",
              "code": "pnpm create your-app@latest"
            },
            {
              "label": "Third tab",
              "code": "curl -O https://your-site.example/file.json"
            }
          ],
          "usesLabel": "Uses",
          "uses": [
            "Part one",
            "Part two",
            "Part three"
          ],
          "facts": [
            {
              "label": "First fact",
              "text": "Say what the reader gets or needs, in one or two sentences."
            },
            {
              "label": "Second fact",
              "text": "Say what the reader gets or needs, in one or two sentences."
            }
          ],
          "actions": [
            {
              "label": "Main action",
              "href": "#copy"
            }
          ]
        }} />
      </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
titlestring'Name the step'Text, up to 60 characters.
tabs{ label, code }[]3 itemsList of 1 to 4. Each item: label, code.
usesLabelstring'Uses'Text, up to 20 characters.
usesstring[]3 itemsList of up to 8.
facts{ label, text }[]2 itemsList of up to 3. Each item: label, text.
actionsLink[]1 itemList of up to 3.
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.