License Badge
Software license badge with SPDX identifier, category color-coding, and OSI-approved indicator.
class-variance-authority
Loading...
Installation
$ shadcn add @jalco/license-badgeUsage
import { LicenseBadge } from "@/components/license-badge"<LicenseBadge license="MIT" />Pass a license SPDX identifier directly, or use owner/repo to fetch the license from the GitHub API. When using the API, this is an async server component with 1-hour ISR caching.
Examples
Layouts
Three layouts: inline pill (default), segmented row, and expanded card.
Loading...
License categories
Licenses are automatically categorized and color-coded by type.
Loading...
API Reference
LicenseBadge
PropType
Notes
- Dual input. Pass a
licensestring for static rendering, orowner/repoto fetch from GitHub. - ISR caching. GitHub API data cached for 1 hour. Optional
GITHUB_TOKENraises the rate limit. - SPDX resolution. Handles case-insensitive matching,
-onlyand-or-latersuffixes. - Category colors. Green for permissive, amber for copyleft, sky for weak copyleft, violet for public domain, rose for proprietary.