Skip to Content

components/

The app/components/ folder holds UI components used on two or more pages, run in the browser.

app/ ├── components/ │ ├── StatusTag.tsx # status label │ └── MoneyCell.tsx # money cell for tables └── orders/ └── page.tsx # import { StatusTag } from "app/components/StatusTag"

What it does

UI that two or more pages share (a status tag, a customer card, a product picker) goes here. A component only one page uses stays inside that page.tsx.

Every file here is .tsx and runs in the browser, like a page. Name the file after the component, in PascalCase: the StatusTag component lives in StatusTag.tsx.

Exports

React components, named or default. Import them as app/components/<Name>.

Example

app/components/StatusTag.tsx
import { Tag } from "antd"; import { OrderStatus } from "app/shared/order"; export function StatusTag({ value }: { value: string }) { return <Tag color={OrderStatus.color(value)}>{OrderStatus.label(value)}</Tag>; }
app/orders/[id:int]/page.tsx
import { StatusTag } from "app/components/StatusTag"; // … <StatusTag value={order.status} />

Good to know

  • Components don’t import app/db, *.table.ts, repository.ts or manh/env. Data comes through useApiClient() or props.
  • Build on antd and pro-components. Don’t rebuild a table, form or modal out of divs.
  • Colors come from tokens (theme.useToken(), classes like bg-surface, text-fg-secondary), never hex codes. check warns code.hardcoded-color.
  • There is no app/ui or app/_ui module. The app frame and ready-made screens (AppShell, ResourceList, StatRow…) live in manh/shell.

Next steps

Last updated