Pull Request Card

A pull request at a glance — state, branches, checks, reviewers. State is shown as an icon and a word, never colour alone.

src/components/ui/pull-request-card.tsx

About

From the component's own source, where it was written.

A pull request at a glance.

The state is an icon *and* a word, never colour alone — merged and closed are purple and red in every forge, which is exactly the pair that disappears for the most common form of colour blindness.

Install

npx astralyx-ui add pull-request-card

Usage

import { PullRequestCard } from '@/components/ui/pull-request-card'

<PullRequestCard number={412} title="Add squircle corners" state="open" />

Composer

Change the props and the source below follows.

Derive field padding from control height

#412 · Open · by Ada Lovelace · updated

Open
fix/input-paddingmain
bugenhancement
+128−416Reviewers
Grace HopperAlan Turing
Props
tsx
<PullRequestCard
  number={412}
  title="Derive field padding from control height"
  state="open"
  branch="fix/input-padding"
  additions={128}
  deletions={41}
  reviewers={['Grace Hopper', 'Alan Turing']}
/>

Examples

States

API

Generated from the source, so it cannot fall behind the code. One table per exported component, then hooks, functions and types.

PullRequestCard

A pull request at a glance.

Extends Omit<ComponentProps<'article'>, 'title'>.

PropTypeDefaultDescription
numbernumberrequiredopen, draft, merged or closed.
titleReactNoderequiredopen, draft, merged or closed.
statePullRequestState'open'open, draft, merged or closed.
authorstring——
branchstringbaseBranch: 'main'Rendered as a source → target pair.
baseBranchstring'main'Rendered as a source → target pair.
updatedDate—Shown as a relative time through Fmt.
commentsnumber——
additionsnumber—Passed through to DiffStat.
deletionsnumber—Passed through to DiffStat.
reviewersstring[]—Names, rendered as a stacked AvatarGroup.
labelsReactNode——
checksReactNode—Slot for a StatusChecks summary or any other node.
reviewersLabelReactNode'Reviewers'—

Types

TypeDefinitionDescription
PullRequestState
'open' | 'draft' | 'merged' | 'closed'
—