Feature Tabs

A few features as tabs across the top, each opening its own picture under them; with interval the open tab's line fills and the next one opens when it is full, wrapping round, held while the pointer is on it and still under reduced motion.

A short line about what this feature does goes here.

Item 1
import { FeatureTabs, type FeatureTab } from "@produkto/ui/FeatureTabs";

const panel = (label: string) => (
  <div className="flex h-56 items-center justify-center rounded-2xl bg-muted body-sm text-muted-foreground">
    {label}
  </div>
);

const items: FeatureTab[] = ["Item 1", "Item 2", "Item 3"].map((name) => ({
  title: name,
  body: "A short line about what this feature does goes here.",
  media: panel(name),
}));

const Example = () => <FeatureTabs interval={5000} items={items} />;

export default Example;

Usage

import { FeatureTabs, type FeatureTab } from "@produkto/ui/FeatureTabs";
const items: FeatureTab[] = [
  { title: "Item 1", body: "A short line goes here.", media: <Picture1 /> },
  { title: "Item 2", body: "A short line goes here.", media: <Picture2 /> },
  { title: "Item 3", body: "A short line goes here.", media: <Picture3 /> },
];

<FeatureTabs interval={5000} items={items} />

Examples

Vertical

orientation="vertical" lists the tabs down the side, each with its icon and its line shown only while open, and the open one's picture beside them.

Item 1
import {
  Layers01Icon,
  Rocket01Icon,
  Shield01Icon,
} from "@hugeicons/core-free-icons";
import { FeatureTabs, type FeatureTab } from "@produkto/ui/FeatureTabs";
import { Icon } from "@produkto/ui/Icon";

const panel = (label: string) => (
  <div className="flex h-72 items-center justify-center rounded-2xl bg-muted body-sm text-muted-foreground">
    {label}
  </div>
);

const items: FeatureTab[] = [
  { title: "Item 1", icon: <Icon icon={Rocket01Icon} /> },
  { title: "Item 2", icon: <Icon icon={Layers01Icon} /> },
  { title: "Item 3", icon: <Icon icon={Shield01Icon} /> },
].map((item) => ({
  ...item,
  body: "A short line about what this feature does goes here.",
  media: panel(item.title),
}));

const Example = () => <FeatureTabs items={items} orientation="vertical" />;

export default Example;

API Reference

FeatureTabs

FeatureTabsProps · blocks/FeatureTabs/FeatureTabs.types.ts
PropTypeDefault
itemsrequiredFeatureTab[]-
orientationFeatureTabsOrientation"horizontal" | "vertical""horizontal"
valuenumber-
defaultValuenumber0
onValueChange(value: number) => void-
intervalnumber-
loopbooleantrue
trailbooleanfalse
linebooleantrue
barPlacementFeatureTabsBarPlacement"above" | "below""above"
childrenReactNode-
classNamestring-

FeatureTab

used by items
PropTypeDefault
titlerequiredstring-
bodyReactNode-
iconReactNode-
mediaReactNode-
durationnumber-