Skip to main content

Feedback

BuildChip

A compact, neutral chip for the title bar, like Xcode's scheme and activity area: it names the build the window runs ("Official 1.2.3", or "branch · sha" with "+ edits" for local changes not yet in any build), and opens a picker of the official build plus the builds serving now so a person can switch to the official build from the trigger. A skew line reads how far behind the current build is and offers its fix, in the same neutral tone as the rest of the chip, since running another build is routine, not an error.

Install

Hand it to your agent
Add BuildChip from Ouro UI to this app. Read https://ui.ouroboros.bot/docs/build-chip.md first and follow it.

Or by hand. Once per app, with Tailwind CSS v4 and an @/* path alias (Ouro HX is built on Base UI, so --base base; skip -t in an existing app):

npx shadcn@latest init --base base --preset nova --yes --no-monorepo
npx shadcn@latest add ourostack/ouro-ui/ouro-base#v1.3.823

Then the component (Installing):

npx shadcn@latest add ourostack/ouro-ui/build-chip#v1.3.823
import { BuildChip } from "@/components/ouro/build-chip/build-chip";

Paths use shadcn's default @/ alias; the CLI rewrites them to yours.

Example

<BuildChip
  builds={[{ id: "official", label: "Official 1.2.3" }, { id: "w1", label: "feature/x · a1b2c3d", dirty: true }]}
  current="w1"
  skew={{ message: "2 commits behind main", fixLabel: "Update", onFix: rebase }}
  onSelect={switchTo}
/>

Use instead when

  • Use Badge instead for a status label with no picker, and Menu directly for an actions list that isn't a choice of running builds.

Props

Type: BuildChipProps.

builds (required)
Type: readonly BuildChipBuild[]
The picker's builds, official first: the official one and the builds serving now.
className
Type: string
Layout only: margins, placement (ms-auto). Appearance classes warn in development.
current (required)
Type: string
The id, from builds, of the build this window is running.
labels
Type: BuildChipLabels
The words, for another language.
onSelect
Type: ((id: string) => void)
Called with a build's id when a person chooses it from the picker.
ref
Type: Ref<HTMLDivElement>
Reaches the root.
skew
Type: BuildChipSkew
How far behind the official build current is, with its fix. Omit it when current is the official build.

Don't use

These are not props. Passing one fails the type check with the fix in the error, and in development a console message names the fix.

  • options: Not a prop. Ouro UI says builds: <BuildChip builds={[...]} current="id">.

className is for layout only

Pass margins, width and grid placement (mt-4, w-full, col-span-2).

Appearance comes from props, not classes. In development, a class that sets appearance logs one warning per component instance, naming the prop to use instead. A class sets appearance when, after its variants (hover:, sm:) and any ! are removed, it starts with bg-, text-, border-, rounded-, shadow-, font-, ring-, from-, via-, to-, fill- or stroke-, or is border, rounded, shadow or ring, or has a dark: variant. Text wrapping, overflow and table layout classes (text-wrap, text-ellipsis, border-collapse) are layout and do not warn.

Alignment classes (text-center) warn too: set alignment on a parent element.

Types

BuildChipBuild

One build in a BuildChip's picker.

interface BuildChipBuild {
  /** Reported to `onSelect`, and matched against `current`. */
  id: string;
  /** What shows in the trigger and the picker: "Official 1.2.3", or "branch · sha". */
  label: string;
  /** Local edits since the build's own commit, not yet in any build. Adds "+ edits" after the label. @default false */
  dirty?: boolean | undefined;
}

BuildChipLabels

The words BuildChip says, for apps in other languages.

interface BuildChipLabels {
  /** Names the picker for screen readers; a sighted person reads it as the trigger's own text. @default "Build" */
  group?: string | undefined;
  /** Appended to a dirty build's label. @default "+ edits" */
  dirty?: string | undefined;
}

BuildChipSkew

How far the running build trails the official one, for BuildChip's skew prop.

interface BuildChipSkew {
  /** What's out of step: "2 commits behind main". Shown above the fix, in the chip's neutral tone. */
  message: string;
  /** The fix's label: "Update". */
  fixLabel: string;
  /** Runs the fix a person chooses. The chip does not close itself; `onFix` does, by changing `current`. */
  onFix: (event: MouseEvent<HTMLElement>) => void;
}