~/components/feature-list
Feature List
A spec-sheet list of label and value rows between hairlines, sliding in one by one.
- Stack
- Next.js 16 · React 19
- Styling
- Tailwind 4
- Motion
- framer-motion
- Install
- copy the source
- License
- MIT
feature-list.tsx
"use client";
import { MotionConfig, motion, type Variants } from "framer-motion";
import type { ReactNode } from "react";
export type FeatureListItem = {
/** Left column, shown bright, e.g. "Runtime". */
label: ReactNode;
/** Right column, shown dimmed, e.g. "Node 22". */
value: ReactNode;
};
export type FeatureListProps = {
/** Rows to show, top to bottom. */
items: FeatureListItem[];
/** Slide the rows in one after another when the list scrolls into view. @default true */
animate?: boolean;
/** Seconds between rows. @default 0.08 */
stagger?: number;
/** Animate only the first time it scrolls into view. @default true */
once?: boolean;
/** Animate even when the user prefers reduced motion. Use only behind an explicit action. @default false */
ignoreReducedMotion?: boolean;
/** Extra classes for the list. */
className?: string;
};
const list: Variants = {
hidden: {},
show: (stagger: number) => ({ transition: { staggerChildren: stagger } }),
};
const row: Variants = {
hidden: { opacity: 0, x: -10 },
show: { opacity: 1, x: 0, transition: { duration: 0.4, ease: [0.22, 1, 0.36, 1] } },
};
const ROW = "flex justify-between gap-4 border-t border-mpk-line py-2.5 last:border-b";
/**
* A spec-sheet style list of label / value rows separated by hairlines, in mono.
* Rendered as a description list (<dl>), so each label is tied to its value.
* Rows slide in one by one; under reduced motion they only fade.
*/
export function FeatureList({
items,
animate = true,
stagger = 0.08,
once = true,
ignoreReducedMotion = false,
className,
}: FeatureListProps) {
const cls = ["font-mpk-mono text-[0.95rem] text-mpk-dim", className].filter(Boolean).join(" ");
const rows = (Row: typeof motion.div | "div") =>
items.map((f, i) => (
<Row key={i} className={ROW} {...(Row === "div" ? {} : { variants: row })}>
<dt className="text-mpk-ink">{f.label}</dt>
<dd className="m-0 text-right">{f.value}</dd>
</Row>
));
if (!animate) return <dl className={cls}>{rows("div")}</dl>;
return (
<MotionConfig reducedMotion={ignoreReducedMotion ? "never" : "user"}>
<motion.dl
className={cls}
initial="hidden"
whileInView="show"
viewport={{ once, amount: 0.3 }}
variants={list}
custom={stagger}
>
{rows(motion.div)}
</motion.dl>
</MotionConfig>
);
}Installation
terminal
npx mpkcn add feature-list01Install the dependencies
terminal
npm i framer-motion02Add mpkcn-theme.css if you haven't yet (see Installation)
03Copy the source into your components folder
components/feature-list.tsx
"use client";
import { MotionConfig, motion, type Variants } from "framer-motion";
import type { ReactNode } from "react";
export type FeatureListItem = {
/** Left column, shown bright, e.g. "Runtime". */
label: ReactNode;
/** Right column, shown dimmed, e.g. "Node 22". */
value: ReactNode;
};
export type FeatureListProps = {
/** Rows to show, top to bottom. */
items: FeatureListItem[];
/** Slide the rows in one after another when the list scrolls into view. @default true */
animate?: boolean;
/** Seconds between rows. @default 0.08 */
stagger?: number;
/** Animate only the first time it scrolls into view. @default true */
once?: boolean;
/** Animate even when the user prefers reduced motion. Use only behind an explicit action. @default false */
ignoreReducedMotion?: boolean;
/** Extra classes for the list. */
className?: string;
};
const list: Variants = {
hidden: {},
show: (stagger: number) => ({ transition: { staggerChildren: stagger } }),
};
const row: Variants = {
hidden: { opacity: 0, x: -10 },
show: { opacity: 1, x: 0, transition: { duration: 0.4, ease: [0.22, 1, 0.36, 1] } },
};
const ROW = "flex justify-between gap-4 border-t border-mpk-line py-2.5 last:border-b";
/**
* A spec-sheet style list of label / value rows separated by hairlines, in mono.
* Rendered as a description list (<dl>), so each label is tied to its value.
* Rows slide in one by one; under reduced motion they only fade.
*/
export function FeatureList({
items,
animate = true,
stagger = 0.08,
once = true,
ignoreReducedMotion = false,
className,
}: FeatureListProps) {
const cls = ["font-mpk-mono text-[0.95rem] text-mpk-dim", className].filter(Boolean).join(" ");
const rows = (Row: typeof motion.div | "div") =>
items.map((f, i) => (
<Row key={i} className={ROW} {...(Row === "div" ? {} : { variants: row })}>
<dt className="text-mpk-ink">{f.label}</dt>
<dd className="m-0 text-right">{f.value}</dd>
</Row>
));
if (!animate) return <dl className={cls}>{rows("div")}</dl>;
return (
<MotionConfig reducedMotion={ignoreReducedMotion ? "never" : "user"}>
<motion.dl
className={cls}
initial="hidden"
whileInView="show"
viewport={{ once, amount: 0.3 }}
variants={list}
custom={stagger}
>
{rows(motion.div)}
</motion.dl>
</MotionConfig>
);
}04Update the import paths to match your project
deps:framer-motion@13.4.4· tested with react@19.3.0
Usage
tsx
import { FeatureList } from "@/components/mpkcn/feature-list";
export function ProjectFacts() {
return (
<FeatureList
items={[
{ label: "Role", value: "Solo dev" },
{ label: "Stack", value: "Next.js · Postgres" },
{ label: "Year", value: "2026" },
]}
/>
);
}Each row is a label on the left (bright) and a value on the right (dimmed), between hairlines. When a third of the list is in view, the rows slide in from the left one by one, 80ms apart.
Examples
Without animation
- Format
- copy-paste source
- Deps
- framer-motion
- License
- MIT
tsx
<FeatureList
animate={false}
items={[
{ label: "Format", value: "copy-paste source" },
{ label: "Deps", value: "framer-motion" },
{ label: "License", value: "MIT" },
]}
/>Rich values
label and value take any React node, such as links or badges.
tsx
<FeatureList
items={[
{ label: "Repo", value: <a href="https://github.com/you/app">github.com/you/app</a> },
{ label: "Status", value: <span className="text-mpk-amber">beta</span> },
]}
/>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| items | { label: React.ReactNode; value: React.ReactNode }[] | — | Rows to show, top to bottom. |
| animate | boolean | true | Slide the rows in one after another when the list scrolls into view. |
| stagger | number | 0.08 | Seconds between rows. |
| once | boolean | true | Animate only the first time it scrolls into view. |
| ignoreReducedMotion | boolean | false | Animate even when the user prefers reduced motion. Only use it behind an explicit action, like a "play anyway" button. |
| className | string | — | Extra classes for the list. |
Accessibility
- Rendered as a description list: each row is a
divholding adt(label) and add(value), so screen readers announce the pairs together. - Under
prefers-reduced-motion: reducethe rows don't slide, they only fade in. - Server and client render the same markup, so there is no hydration mismatch.