Release Badge
Live GitHub release badge showing latest tag, publish date, and pre-release indicator.
class-variance-authority
Loading...
Installation
$ shadcn add @jalco/release-badgeUsage
import { ReleaseBadge } from "@/components/release-badge"<ReleaseBadge owner="vercel" repo="next.js" />Async server component — fetches the latest GitHub release at build time, cached 1 hour via ISR.
Layouts
Inline
Compact pill showing the tag icon and version. The default layout.
Row
Segmented horizontal strip showing tag, release name, and publish date.
Card
Feature card showing release tag, name, publish date, and asset count.
Card layout
API Reference
ReleaseBadge
PropType
Notes
- ISR caching. Release data is cached for 1 hour via
next.revalidate. SetGITHUB_TOKENto raise the rate limit from 60 → 5,000 req/hr. - Pre-fetched data. Pass the
dataprop to skip the API call — useful for static builds or when fetching data separately. - Pre-release indicator. When the latest release is marked as a pre-release on GitHub, an amber "pre" badge appears automatically.