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.
git-chip-demo.tsxCopy code
Installation
Copy code
npm packages
lucide-reactUsage
ImportCopy code
Use the chips for file paths and branch names inside a sentence, like a commit message.
API reference
GitFileChip
| Prop | Type | Default |
|---|---|---|
textRefRenders the name empty and attaches this ref, for a list that fills the text itself (a virtualizer's `findableText`). | Ref<HTMLSpanElement> | – |
pathrequired | string | – |
Also takes <span> attributes and render except children.
GitBranchChip
| Prop | Type | Default |
|---|---|---|
textRefRenders the name empty and attaches this ref, for a list that fills the text itself (a virtualizer's `findableText`). | Ref<HTMLSpanElement> | – |
namerequired | string | – |
Also takes <span> attributes and render except children.
Other exports
type GitBranchChipPropstype GitFileChipPropsAccessibility
- 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.