• Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
drewmcdonald

drewmcdonald

promptCompare

Public
Like
promptCompare
Home
Code
7
.claude
3
backend
2
docs
1
frontend
4
shared
.mcp.json
deno.json
Environment variables
2
Branches
1
Pull requests
Remixes
History
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Sign up now
Code
/
.claude
/
skills
/
ai-elements
/
references
/
commit.md
Code
/
.claude
/
skills
/
ai-elements
/
references
/
commit.md
Search
…
Viewing readonly version of main branch: v128
View latest version
commit.md

Commit

Display commit information with hash, message, author, and file changes.

The Commit component displays commit details including hash, message, author, timestamp, and changed files.

See scripts/commit.tsx for this example.

Installation

npx ai-elements@latest add commit

Features

  • Commit hash display with copy button
  • Author avatar with initials
  • Relative timestamp formatting
  • Collapsible file changes list
  • Color-coded file status (added/modified/deleted/renamed)
  • Line additions/deletions count

File Status

StatusLabelColor
addedAGreen
modifiedMYellow
deletedDRed
renamedRBlue

Props

<Commit />

PropTypeDefaultDescription
...propsReact.ComponentProps<typeof Collapsible>-Spread to the Collapsible component.

<CommitHeader />

PropTypeDefaultDescription
...propsReact.ComponentProps<typeof CollapsibleTrigger>-Spread to the CollapsibleTrigger component.

<CommitAuthor />

PropTypeDefaultDescription
...propsReact.HTMLAttributes<HTMLDivElement>-Spread to the container div.

<CommitAuthorAvatar />

PropTypeDefaultDescription
initialsstringRequiredAuthor initials to display.
...propsReact.ComponentProps<typeof Avatar>-Spread to the Avatar component.

<CommitInfo />

PropTypeDefaultDescription
...propsReact.HTMLAttributes<HTMLDivElement>-Spread to the container div.

<CommitMessage />

PropTypeDefaultDescription
...propsReact.HTMLAttributes<HTMLSpanElement>-Spread to the span element.

<CommitMetadata />

PropTypeDefaultDescription
...propsReact.HTMLAttributes<HTMLDivElement>-Spread to the container div.

<CommitHash />

PropTypeDefaultDescription
...propsReact.HTMLAttributes<HTMLSpanElement>-Spread to the span element.

<CommitSeparator />

PropTypeDefaultDescription
childrenReact.ReactNode-Custom separator content.
...propsReact.HTMLAttributes<HTMLSpanElement>-Spread to the span element.

<CommitTimestamp />

PropTypeDefaultDescription
dateDateRequiredCommit date.
childrenReact.ReactNode-Custom timestamp content. Defaults to relative time.
...propsReact.HTMLAttributes<HTMLTimeElement>-Spread to the time element.

<CommitActions />

PropTypeDefaultDescription
...propsReact.HTMLAttributes<HTMLDivElement>-Spread to the container div.

<CommitCopyButton />

PropTypeDefaultDescription
hashstringRequiredCommit hash to copy.
onCopy() => void-Callback after successful copy.
onError(error: Error) => void-Callback if copying fails.
timeoutnumber2000Duration to show copied state (ms).
...propsReact.ComponentProps<typeof Button>-Spread to the Button component.

<CommitContent />

PropTypeDefaultDescription
...propsReact.ComponentProps<typeof CollapsibleContent>-Spread to the CollapsibleContent component.

<CommitFiles />

PropTypeDefaultDescription
...propsReact.HTMLAttributes<HTMLDivElement>-Spread to the container div.

<CommitFile />

PropTypeDefaultDescription
...propsReact.HTMLAttributes<HTMLDivElement>-Spread to the row div.

<CommitFileInfo />

PropTypeDefaultDescription
...propsReact.HTMLAttributes<HTMLDivElement>-Spread to the container div.

<CommitFileStatus />

PropTypeDefaultDescription
statusunknownRequiredFile change status.
childrenReact.ReactNode-Custom status label.
...propsReact.HTMLAttributes<HTMLSpanElement>-Spread to the span element.

<CommitFileIcon />

PropTypeDefaultDescription
...propsReact.ComponentProps<typeof FileIcon>-Spread to the FileIcon component.

<CommitFilePath />

PropTypeDefaultDescription
...propsReact.HTMLAttributes<HTMLSpanElement>-Spread to the span element.

<CommitFileChanges />

PropTypeDefaultDescription
...propsReact.HTMLAttributes<HTMLDivElement>-Spread to the container div.

<CommitFileAdditions />

PropTypeDefaultDescription
countnumberRequiredNumber of lines added.
...propsReact.HTMLAttributes<HTMLSpanElement>-Spread to the span element.

<CommitFileDeletions />

PropTypeDefaultDescription
countnumberRequiredNumber of lines deleted.
...propsReact.HTMLAttributes<HTMLSpanElement>-Spread to the span element.
FeaturesVersion controlCode intelligenceCLIMCP
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Open Source Pledge
Terms of usePrivacy policyAbuse contact
© 2026 Val Town, Inc.