Package Info

Display dependency information and version changes.

The PackageInfo component displays package dependency information including version changes and change type badges.

See scripts/package-info.tsx for this example.

Installation

npx ai-elements@latest add package-info

Features

  • Version change display (current → new)
  • Color-coded change type badges
  • Dependencies list
  • Description support

Change Types

TypeColorUse Case
majorRedBreaking changes
minorYellowNew features
patchGreenBug fixes
addedBlueNew dependency
removedGrayRemoved dependency

Props

<PackageInfo />

PropTypeDefaultDescription
namestringRequiredPackage name.
currentVersionstring-Current installed version.
newVersionstring-New version being installed.
changeTypeunknown-Type of version change.
...propsReact.HTMLAttributes<HTMLDivElement>-Spread to the container div.

<PackageInfoHeader />

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

<PackageInfoName />

PropTypeDefaultDescription
childrenReact.ReactNode-Custom name content. Defaults to the name from context.
...propsReact.HTMLAttributes<HTMLDivElement>-Spread to the container div.

<PackageInfoChangeType />

PropTypeDefaultDescription
childrenReact.ReactNode-Custom change type label. Defaults to the changeType from context.
...propsReact.HTMLAttributes<HTMLDivElement>-Spread to the Badge component.

<PackageInfoVersion />

PropTypeDefaultDescription
childrenReact.ReactNode-Custom version content. Defaults to version transition display.
...propsReact.HTMLAttributes<HTMLDivElement>-Spread to the container div.

<PackageInfoDescription />

PropTypeDefaultDescription
...propsReact.HTMLAttributes<HTMLParagraphElement>-Spread to the p element.

<PackageInfoContent />

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

<PackageInfoDependencies />

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

<PackageInfoDependency />

PropTypeDefaultDescription
namestringRequiredDependency name.
versionstring-Dependency version.
...propsReact.HTMLAttributes<HTMLDivElement>-Spread to the row div.