Skip to content
Klarhimmel UI

Features, tabs

Features, tabs previewFeatures, tabs preview

Install

npx shadcn add @klarhimmel/features-tabs
DetailsAbout, usage, props and more

Two to five tabs, each with a title, description, a short list of points and an image. All panels show while editing.

Import

Import

import Block from '@/components/klarhimmel/blocks/features-tabs';
Also called
  • features/tabs
Category
What it does, as a grid, a list, tabs or alternating rows. New project? Set it up once: /get-started/installation.

Notes

When to use it

Features switched by tabs, one panel visible at a time with a title, description, points and image. It saves height compared with features-split, at the cost of hiding the other panels.

Writing for it

- Each tab label holds 30 characters and sits in the tab bar, so write one or two words. The panel title (80) says more. - Two to five tabs, each with up to five points of 80 characters. Keep the point count similar from tab to tab so the panel height does not jump. - All panels use a 4 to 3 image, so prepare each screenshot at that ratio.

Watch out for

Without JavaScript the tabs cannot switch, so the block shows every panel one after another with the label above and no buttons. Check that copy reads fine in that stacked form.

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 FeaturesTabs from '@/components/klarhimmel/blocks/features-tabs';

export default function Section() {
  return (
    <Theme theme="brand">
      <BlockSurface>
        <FeaturesTabs props={{
          "eyebrow": "Name the section",
          "title": "Say what the tabs take the reader through",
          "description": "Say in one sentence what the tabs are and what the reader should pick.",
          "tabs": [
            {
              "label": "First tab",
              "title": "Say what the first stage gives the reader",
              "description": "Say what the reader does in the first stage and what they have by the end of it, in two sentences.",
              "points": [
                "Name a first thing it includes",
                "Name a second thing it includes"
              ],
              "media": {
                "src": "/pictures/scr-pricing.avif",
                "alt": "A pricing page with three plans",
                "srcDark": "/pictures/scr-pricing-dark.avif"
              }
            },
            {
              "label": "Second tab",
              "title": "Say what the second stage gives the reader",
              "description": "Say what the reader does in the second stage and what they have by the end of it, in one sentence.",
              "points": [
                "Name a first thing it includes",
                "Name a second thing it includes"
              ],
              "media": {
                "src": "/pictures/scr-card.avif",
                "alt": "A card with a title and a button",
                "srcDark": "/pictures/scr-card-dark.avif"
              }
            }
          ]
        }} />
      </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
eyebrowstring'Name the section'Text, up to 60 characters.
titlestring'Say what the tabs take the reader t…'Text, up to 120 characters.
descriptionstring'Say in one sentence what the tabs a…'Text, up to 300 characters.
cssTabsboolean-Optional; empty is not rendered.
mediaFirstboolean-Optional; empty is not rendered.
align'center' | 'start'-One of 'center', 'start'. Optional; empty is not rendered.
titleSize'heading'-One of 'heading'. Optional; empty is not rendered.
tabs{ label, title, description, points, media, link, link2 }[]3 itemsList of 2 to 5. Each item: label, title, description, points, media, link (optional), link2 (optional).
headingLevel'1' | '2'-One of '1', '2'. Optional; empty is not rendered.