Manta Developers
GitHub
Menu

Layout and data

Surfaces, dividers, tabs, tables, trees, maps, and navigation that structure a page and its data.

Card

Card groups related content on one surface. Compose it from CardHeader, CardTitle, CardDescription, CardAction, CardContent, and CardFooter. Set padding to sm, md, or lg for a padded card, and surface to muted or dashed for a quieter one.

Today
3 of 5 todos done
Next up: review the launch checklist.
Updated 5 minutes ago
import { Plus } from "lucide-react";
import { Button } from "@manta-eu/react/button";
import {
  Card,
  CardAction,
  CardContent,
  CardDescription,
  CardFooter,
  CardHeader,
  CardTitle,
} from "@manta-eu/react/card";

<Card className="max-w-sm">
  <CardHeader>
    <CardTitle>Today</CardTitle>
    <CardDescription>3 of 5 todos done</CardDescription>
    <CardAction>
      <Button variant="ghost" icon={Plus} iconOnly aria-label="Add a todo" />
    </CardAction>
  </CardHeader>
  <CardContent className="typography-small">Next up: review the launch checklist.</CardContent>
  <CardFooter className="typography-small text-muted-foreground">Updated 5 minutes ago</CardFooter>
</Card>;

Props · Storybook

Separator

Separator draws a thin line between pieces of content. It is horizontal by default. Set orientation="vertical" to divide items in a row, and give the row a height.

Write the release notes

Due Friday
High priority
Ana
import { Separator } from "@manta-eu/react/separator";

<div className="flex max-w-sm flex-col gap-4">
  <p className="typography-small">Write the release notes</p>
  <Separator />
  <div className="flex h-5 items-center gap-4 typography-small text-muted-foreground">
    <span>Due Friday</span>
    <Separator orientation="vertical" />
    <span>High priority</span>
    <Separator orientation="vertical" />
    <span>Ana</span>
  </div>
</div>;

Props · Storybook

Tabs

Tabs switches between panels that share one place on the page. Give each TabsTrigger and its TabsContent the same value, and pick the starting tab with defaultValue. Set size="small" for a compact list, and add a TabCount to show a count in a trigger.

Todos that still need work.
import { TabCount, Tabs, TabsContent, TabsList, TabsTrigger } from "@manta-eu/react/tabs";

<Tabs defaultValue="active">
  <TabsList>
    <TabsTrigger value="all">
      All <TabCount count={5} />
    </TabsTrigger>
    <TabsTrigger value="active">
      Active <TabCount count={2} />
    </TabsTrigger>
    <TabsTrigger value="completed">
      Completed <TabCount count={3} />
    </TabsTrigger>
  </TabsList>
  <TabsContent value="all">Every todo in the project.</TabsContent>
  <TabsContent value="active">Todos that still need work.</TabsContent>
  <TabsContent value="completed">Todos you have checked off.</TabsContent>
</Tabs>;

Props · Storybook

Table

SortableTable renders rows from plain columns and rows, and sorts a column when the user clicks its header. Mark a column numeric to right-align it, and pass cell to render a custom value. For full control, build a TanStack table and render it with DataTable, or compose Table, TableHeader, TableRow, TableHead, and TableCell by hand.

Todo
Assignee
Status
Hours
Write the release notesAnaActive
2
Review the launch checklistMarkoActive
1
Update the pricing pageIvanaCompleted
3
import { SortableTable } from "@manta-eu/react/table";

type Todo = { title: string; assignee: string; status: string; estimate: number };

const todos: Todo[] = [
  { title: "Write the release notes", assignee: "Ana", status: "Active", estimate: 2 },
  { title: "Review the launch checklist", assignee: "Marko", status: "Active", estimate: 1 },
  { title: "Update the pricing page", assignee: "Ivana", status: "Completed", estimate: 3 },
];

<SortableTable
  rows={todos}
  columns={[
    { key: "title", header: "Todo" },
    { key: "assignee", header: "Assignee" },
    { key: "status", header: "Status" },
    { key: "estimate", header: "Hours", numeric: true },
  ]}
/>;

Props · Storybook

Pagination

PaginationBlock shows the current page and buttons to move between pages. It is controlled: pass a zero-based currentPageIndex, totalPages, and onPageChange. Add showPageSize with pageSize and totalCount to show the range of rows on the page. Compose Pagination, PaginationContent, and the button parts for a custom layout.

1-25 of 87
Page 1 of 4
import { useState } from "react";
import { PaginationBlock } from "@manta-eu/react/pagination";

const [page, setPage] = useState(0);

<PaginationBlock
  currentPageIndex={page}
  totalPages={4}
  onPageChange={setPage}
  showPageSize
  pageSize={25}
  totalCount={87}
/>;

Props · Storybook

Tree

Tree shows nested items that the user expands, collapses, and selects with the mouse or the arrow keys. Pass nodes with an id, a label, and optional icon, children, defaultExpanded, and disabled. Use defaultSelectedId on its own, or selectedId with onSelect to control the selection.

  • Website
    • Update the pricing page
    • Publish the launch post
import { FileText, Folder } from "lucide-react";
import { Tree, type TreeNodeData } from "@manta-eu/react/tree";

const projects: TreeNodeData[] = [
  {
    id: "website",
    label: "Website",
    icon: <Folder />,
    defaultExpanded: true,
    children: [
      { id: "pricing", label: "Update the pricing page", icon: <FileText /> },
      { id: "blog", label: "Publish the launch post", icon: <FileText /> },
    ],
  },
  {
    id: "mobile",
    label: "Mobile app",
    icon: <Folder />,
    children: [{ id: "onboarding", label: "Redesign onboarding", icon: <FileText /> }],
  },
];

<Tree nodes={projects} defaultSelectedId="pricing" aria-label="Projects" className="max-w-xs" />;

Props · Storybook

Collapsible

Collapsible shows and hides a section when the user clicks its trigger. Put the toggle in CollapsibleTrigger and the hidden part in CollapsibleContent. Control it with open and onOpenChange, or start it open with defaultOpen.

import { useState } from "react";
import { ChevronRight } from "lucide-react";
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@manta-eu/react/collapsible";

const [open, setOpen] = useState(false);

<Collapsible open={open} onOpenChange={setOpen} className="max-w-sm rounded-lg border border-default-border p-4">
  <CollapsibleTrigger className="group flex w-full items-center gap-2">
    <span className="typography-small-header">Completed todos</span>
    <ChevronRight className="size-4 transition-transform group-data-[state=open]:rotate-90" />
  </CollapsibleTrigger>
  <CollapsibleContent>
    <ul className="mt-3 list-disc space-y-1 pl-5 typography-small">
      <li>Update the pricing page</li>
      <li>Book the venue</li>
      <li>Send the invites</li>
    </ul>
  </CollapsibleContent>
</Collapsible>;

Props · Storybook

Breadcrumbs shows where the current page sits in the hierarchy. Pass items with a label and an href or onClick. The last item marks the current page. Items with an href render a plain <a>, so no router is needed. Pass renderLink to use your router’s link instead.

import { Home, ListTodo } from "lucide-react";
import { Breadcrumbs } from "@manta-eu/react/breadcrumbs";

<Breadcrumbs
  items={[
    { label: "Home", href: "#", icon: <Home /> },
    { label: "Website", href: "#", icon: <ListTodo /> },
    { label: "Update the pricing page" },
  ]}
/>;

Props · Storybook

DataFlowDiagram

DataFlowDiagram shows records traveling from sources into one core, Manta by default (coreLabel, coreIcon), and out to destinations. Each node shows its mark (icon, or two initials), its name, and a second line: its meta, such as “24 campaigns”, or its value in unit (and formatValue). A source’s to names the destinations its records reach; left out, it feeds every one. Records travel along the lines, hollow on their way into the core and solid on their way out. A source at zero sends none and its line is dotted, and every record holds still under reduced motion or with running={false}. Hovering, tapping or focusing a node lights its route through the core and shows its detail. The core counts every source’s value. Below 40rem the sources shrink to their marks. A screen reader hears every flow listed as text, such as “Shopify to Manta: 2,418 records”. Pass labels to reword that list, such as labels.flow for “Shopify to Manta”.

Knowledge graph144,442 records
  • Google Ads to Knowledge graph: 24 records
  • Shopify to Knowledge graph: 2,418 records
  • Google Analytics to Knowledge graph: 142,000 records
  • Klaviyo to Knowledge graph: 0 records
  • Knowledge graph to Marketing: 144,442 records
  • Knowledge graph to Commerce: 2,418 records
import { DataFlowDiagram } from "@manta-eu/react/data-flow";

<DataFlowDiagram
  label="Records from your systems through the knowledge graph to your desks"
  coreLabel="Knowledge graph"
  sources={[
    { id: "ads", label: "Google Ads", value: 24, meta: "24 campaigns", to: ["marketing"] },
    { id: "shop", label: "Shopify", value: 2418, meta: "2,418 products" },
    { id: "mail", label: "Klaviyo", value: 0, meta: "Waiting for access", to: ["marketing"] },
  ]}
  destinations={[
    { id: "marketing", label: "Marketing", value: 2442, meta: "3 systems" },
    { id: "commerce", label: "Commerce", value: 2418, meta: "1 system" },
  ]}
/>;

Props · Storybook

SetupSteps

SetupSteps walks a person through a short setup, such as connecting a system, one screen at a time. The header shows the logo, the name with the step count (“Step 2 of 3”), an optional status, and a Stepper over the steps. current is the index of the step in progress, and steps.length once every step is done. Each screen shows its title, an optional description and any children, and slides in when the step changes; under reduced motion it only fades. The footer holds onBack (named by backLabel) and your action, with a note above them that a screen reader hears when it changes, such as “Checking access…”. Pass labels to reword the step count and the stepper’s name.

Connect Shopify · Step 1 of 3Setting up
  1. Sign in with Shopify
  2. Pick a store
  3. Connect
Step 1 of 3: Sign in with Shopify

Sign in with Shopify

import { useState } from "react";
import { Button } from "@manta-eu/react/button";
import { SetupSteps } from "@manta-eu/react/setup-steps";

const steps = [
  { id: "sign-in", label: "Sign in with Shopify" },
  { id: "pick", label: "Pick a store" },
  { id: "connect", label: "Connect" },
];
const [current, setCurrent] = useState(0);

<SetupSteps
  name="Connect Shopify"
  steps={steps}
  current={current}
  status={{ label: "Setting up", variant: "info" }}
  title={steps[current]?.label ?? "Shopify connected"}
  onBack={() => setCurrent(current - 1)}
  action={<Button onClick={() => setCurrent(current + 1)}>Continue</Button>}
/>;

Props · Storybook

RegionMap

RegionMap shows where: regions shaded by one measure, places as points, or both. Use it only when place changes the decision. It draws your geography and bundles none: pass geography as { geojson } (a feature collection, one feature or a list of them) or { topojson, object }, in degrees, with ids on the features (or name the property that holds them in idProperty). regions names the features the map is about, each with its value; every other feature is the land around them, drawn in a quiet flat tone, and the land a place sits in keeps the land’s own color. The map holds that land whole, centered with an even margin, and sets its height from the land’s shape unless you give height.

The measure takes one periwinkle ramp of at most five steps (steps), on round bounds named in the legend; a region is never colored by a status, and one with no value is hatched, never drawn as a zero. Only the regions and places marked named get a name on the map, and a name that would overlap another, a point or the edge is left off. The map is one tab stop: the arrow keys move between the regions, largest first, then the places, and Home and End to the first and last; each shows its figure on focus as on hover, and onSelect makes them buttons. Credit the outlines and the figures in credit, which the map shows in an (i), never as a line under it.

A map is never the only way in: pair it with RegionRankList, the same figures ranked largest first, and share activeId and onActiveChange so hovering one marks the other. A Table works too.

Bookings a week
  1. 0–1,000
  2. 1,000–2,000
  3. 2,000–3,000
  4. 3,000–4,000
  5. 4,000–5,000
  1. England4,820
  2. Ireland1,560
  3. Scotland1,240
  4. Wales610
  5. Northern Ireland380
import { useState } from "react";
import { RegionMap, RegionRankList } from "@manta-eu/react/region-map";

const nations = [
  { id: "GB-ENG", name: "England", value: 4820, named: true },
  { id: "GB-SCT", name: "Scotland", value: 1240, named: true },
  { id: "IE", name: "Ireland", value: 1560, named: true },
];
const measure = { label: "Bookings a week" };
const [activeId, setActiveId] = useState<string | null>(null);

<RegionMap
  geography={{ geojson: outlines }}
  regions={nations}
  places={[{ id: "london", name: "London", coordinates: [-0.13, 51.51], named: true }]}
  measure={measure}
  label="Bookings a week by nation"
  credit="Outlines: Natural Earth"
  activeId={activeId}
  onActiveChange={setActiveId}
/>
<RegionRankList
  items={nations}
  measure={measure}
  label="Bookings a week by nation"
  activeId={activeId}
  onActiveChange={setActiveId}
/>;

Import it from @manta-eu/react/region-map; it stays out of the root barrel so d3-geo, its projection library (ISC), loads only where a map is drawn.

Props · Storybook

WithWithoutChart

WithWithoutChart shows a measure with the plans against the same measure without them. Give each point its measured figure up to today and its expected figure after it: the line with the plans is solid up to Today and dotted after. Give without only where a real baseline gives one; the line without the plans is gray and dashed, and it is left out where no point carries it. The gap between the two is shaded as what the plans add, and its value at the last point that has both lines is said in words at the line’s end: “+$14k a month” with period="a month", or your own words through formatGain.

Green and red appear only in a verdict, a word with its dot at the top right, once a result has been judged against what was agreed. Set lowerIsBetter for a cost, where the plans gain by running lower. The chart is built on ForecastChart, so its axes, Today and hover card match.

Profit a month

Met what was agreed
  • Measured
  • Expected
  • Without the plans
  • Added by the plans
Added by the plans: +$14k a month
import { WithWithoutChart } from "@manta-eu/react/with-without";

<WithWithoutChart
  label="Profit a month, with the plans and without them"
  title="Profit a month"
  data={[
    { x: "May", measured: 194000, without: 190500 },
    { x: "Jun", measured: 199000, without: 192000 },
    { x: "Jul", measured: 203000, without: 193500 },
    { x: "Aug", expected: 207000, without: 195500 },
    { x: "Sep", expected: 210000, without: 197500 },
  ]}
  today="Jul"
  period="a month"
  verdict={{ label: "Met what was agreed", met: true }}
  formatValue={(value) => `$${Math.round(value / 1000)}k`}
/>;

Props · Storybook

ReplayChart

ReplayChart plays a series back over time, so a person watches a plan’s effect happen. The line draws up to the playhead, beside its baseline in gray dashes with the gap shaded, and the readout above the plot gives the date, the figure and the gap at the playhead.

Play and pause from the button beside the playhead, or drag the playhead. It is a slider: the arrow keys move it one point at a time, and Home and End to the start and the end. Each of the moments is named with its date and label in the lane under the plot, and is filled once the playhead reaches it; choosing one moves the playhead there. With autoPlay, the chart plays once from the start the first time it is in view. Under reduced motion it shows the full line and every moment, and never plays by itself. Set today to draw Today’s rule, with the line dotted after it, named expectedLabel in the legend. When data changes, a chart resting at the end stays at the new end. A screen reader hears each moment as a play reaches it. Pass labels to reword the chart’s own words, such as its buttons’ names.

  • With the plans
  • Without the plans
  • Added by the plans

6 Jul$30,000

import { ReplayChart } from "@manta-eu/react/replay-chart";

<ReplayChart
  label="Profit a week since the first plan, with the plans and without them"
  data={[
    { x: Date.UTC(2026, 6, 6), value: 30000 },
    { x: Date.UTC(2026, 6, 13), value: 31200, baseline: 30200 },
    { x: Date.UTC(2026, 6, 20), value: 33400, baseline: 30500 },
  ]}
  moments={[{ x: Date.UTC(2026, 6, 13), label: "Paused 3 weak ad sets" }]}
  formatX={(x) => new Date(x).toLocaleDateString("en-GB", { day: "numeric", month: "short" })}
  autoPlay
/>;

Props · Storybook

GoalBar

GoalBar shows one goal on a track from its baseline to its target: solid up to the dot at now, a ring at each of its milestones and at the target, and a dotted stretch for a projection, such as what a set of plans would add, named under it. The target may sit below the baseline, for a goal that aims lower. Above the track sit the goal’s name (label), its status and its figures; set header={false} under a heading that already says them.

The track measures the goal’s own unit, so every mark on it compares. With a startDate and a targetDate, Today is placed by time: at the share of the time to the target date that has passed, which is the figure a steady pace reaches today. A dot short of the Today rule is behind that pace; a dot past it is ahead.

Each mark gives its figure and date on hover and on keyboard focus. The bar is one tab stop: the arrow keys, Home and End move between its marks, and Escape closes the card. Its accessible name states the goal, now, the target by its date and the status. Pass formatValue for the figures, formatDate for the dates, and words for its own words in another language.

import { GoalBar } from "@manta-eu/react/goal-bar";

<GoalBar
  label="Increase gross margin"
  baseline={12.5}
  now={14.7}
  target={16}
  startDate={new Date(2026, 8, 1)}
  targetDate={new Date(2026, 10, 30)}
  milestones={[{ value: 15.4, date: new Date(2026, 10, 15) }]}
  projection={{ change: 0.9, label: "+0.9 pts with 3 plans" }}
  status={{ label: "Behind", variant: "error" }}
  formatValue={(value) => `${value.toFixed(1)}%`}
/>;

Props · Storybook