Features, tabs


Install
npx shadcn add @klarhimmel/features-tabsDetailsAbout, 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
- 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.
Pairs well with
Usage
The block in a page, with its default content (long lists shortened). Every prop is in the table below.
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.
| Prop | Type | Default | Description |
|---|---|---|---|
eyebrow | string | 'Name the section' | Text, up to 60 characters. |
title | string | 'Say what the tabs take the reader t…' | Text, up to 120 characters. |
description | string | 'Say in one sentence what the tabs a…' | Text, up to 300 characters. |
cssTabs | boolean | - | Optional; empty is not rendered. |
mediaFirst | boolean | - | 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 items | List 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. |