Skip to content
Eskais UI

Git

Git Chip

Inline chips for git names in text: GitFileChip (a file icon and the path in mono) and GitBranchChip (a branch icon and the name).

Example

Merge invoice-pdf into main, then add the route in src/routes.ts.

Installation

npx shadcn@latest add @eskais/git-chip
npm packageslucide-react

Usage

Import
import { GitBranchChip, GitFileChip } from "@/components/ui/git-chip"

Use the chips for file paths and branch names inside a sentence, like a commit message.

API reference

GitFileChip

PropTypeDefault
textRefRenders the name empty and attaches this ref, for a list that fills the text itself (a virtualizer's `findableText`).Ref<HTMLSpanElement>–
pathrequiredstring–

Also takes <span> attributes and render except children.

GitBranchChip

PropTypeDefault
textRefRenders the name empty and attaches this ref, for a list that fills the text itself (a virtualizer's `findableText`).Ref<HTMLSpanElement>–
namerequiredstring–

Also takes <span> attributes and render except children.

Other exports

type GitBranchChipPropstype GitFileChipProps

Accessibility

  • The icons are decorative; the chip reads as its text.

Agent actions

Runs agent.snapshot() from @ui-sdk/react/agent on the live preview above.