
component-patterns-plugin
Version badge and tooltip patterns that show build info and changelog across React, Vue, and Svelte.
- version
- 1.5.4
- GitHub stars
- 60
What it does
- Adds
/components:version-badgeand aversion-badge-patternskill for header or footer version display with a tooltip - Shows version, abbreviated commit SHA, and a tooltip with full commit, build time, branch, and recent changelog entries
- Parses CHANGELOG.md at build time so the tooltip adds no runtime overhead, with keyboard and screen reader access
- Supports Next.js, Nuxt, SvelteKit, Vite with React or Vue, and CRA, with options such as
--check-onlyand--location footer
Reusable UI component patterns - version badge, tooltips, and common UI elements for React, Vue, Svelte
Add marketplace
/plugin marketplace add laurigates/claude-pluginsRun it inside Claude Code once, then install the plugin below.
Install
/plugin install component-patterns-plugin@laurigates-claude-pluginsRun it inside Claude Code after adding the marketplace.
Files
Discovered from source/components:version-badge
Implement a version badge component that displays version number, git commit, and recent changelog in a tooltip.
When to Use This Skill
| Use this skill when... | Use version-badge-pattern instead when... |
|---|---|
| Adding a version badge end-to-end to an existing app via slash command | Studying the pattern, data flow, and accessibility checklist before adapting it manually |
| You want auto-detection of framework, styling, and UI library with file edits applied | You need full reference implementations for React, Vue 3, Svelte, or plain CSS variants |
Implementing the default header placement with --check-only / --location flags | Composing the changelog-parser script and build-pipeline wiring into a custom workflow |
Context
- Framework config: !
find . -maxdepth 1 \( -name "next.config.*" -o -name "nuxt.config.*" -o -name "svelte.config.*" -o -name "vite.config.*" \) - Package manager: !
find . -maxdepth 1 \( -name "package.json" -o -name "bun.lockb" -o -name "pnpm-lock.yaml" \) - Styling: !
find . -maxdepth 1 \( -name "tailwind.config.*" -o -name "postcss.config.*" \) - UI library: !
find . -maxdepth 1 -name "components.json" - Changelog: !
find . -maxdepth 1 -name 'CHANGELOG.md' - Version: !
find . -path '*/package.json' -maxdepth 2 -exec jq -r '.version // "unknown"' {} +
Parameters
--check-only: Analyze project and show what would be implemented without making changes--location <header|footer|custom>: Specify component placement (default: header)
Overview
This command adds a version display to your application with:
- Trigger element:
v1.43.0 | 004ddd9(version + abbreviated commit) - Tooltip: Full build info (version, commit, timestamp, branch) + recent changelog entries
- Build-time processing: Zero runtime overhead
Tech Stack Detection
Detect the project's tech stack from the values in Context:
-
Framework:
- Next.js:
next.config.jsornext.config.mjsornext.config.ts - Nuxt:
nuxt.config.tsornuxt.config.js - SvelteKit:
svelte.config.js - Vite + React:
vite.config.*+ React in dependencies - Vite + Vue:
vite.config.*+ Vue in dependencies - Create React App:
react-scriptsin dependencies - Plain React: React in dependencies without specific framework
- Next.js:
-
Styling:
- Tailwind CSS:
tailwind.config.*or@tailwindin CSS - CSS Modules:
.module.cssfiles - styled-components: In dependencies
- Emotion:
@emotion/*in dependencies - Plain CSS: Fallback
- Tailwind CSS:
-
UI Library:
- shadcn/ui:
components.jsonwith shadcn config - Radix UI:
@radix-ui/*in dependencies - Headless UI:
@headlessui/*in dependencies - None: Use native implementation
- shadcn/ui:
Execution
Execute this version badge implementation workflow:
Step 1: Analyze project
Read package.json to identify dependencies. Check for framework config files, styling configuration, and existing component patterns.
Step 2: Create changelog parser script
Create a build-time script that parses CHANGELOG.md:
Location: scripts/parse-changelog.mjs (or appropriate location)
// Script should:
// 1. Read CHANGELOG.md
// 2. Extract last 2 versions with their changes
// 3. Categorize changes (feat, fix, perf, breaking)
// 4. Output as JSON for NEXT_PUBLIC_CHANGELOG (or equivalent)
Change type icons:
| Type | Icon | Description |
|---|---|---|
| feat | sparkles | New feature |
| fix | bug | Bug fix |
| perf | zap | Performance improvement |
| breaking | warning | Breaking change |
Limits:
- Max 3 features per version
- Max 2 other changes per version
- Last 2 versions only
Step 3: Configure build pipeline
Based on framework, add build-time environment variables:
Next.js (next.config.mjs):
const buildInfo = {
version: process.env.npm_package_version || 'dev',
commit: process.env.VERCEL_GIT_COMMIT_SHA || process.env.GITHUB_SHA || 'local',
branch: process.env.VERCEL_GIT_COMMIT_REF || process.env.GITHUB_REF_NAME || 'local',
buildTime: new Date().toISOString(),
};
export default {
env: {
NEXT_PUBLIC_BUILD_INFO: JSON.stringify(buildInfo),
// NEXT_PUBLIC_CHANGELOG set by parse-changelog.mjs
},
};
Vite (vite.config.ts):
export default defineConfig({
define: {
'import.meta.env.VITE_BUILD_INFO': JSON.stringify(buildInfo),
},
});
Step 4: Create component
Create the version badge component appropriate for the detected framework:
Component structure:
src/components/
version-badge/
version-badge.tsx # Main component
version-badge.css # Styles (if not using Tailwind)
index.ts # Export
Features to implement:
-
Trigger display:
- Version number from build info
- Abbreviated commit SHA (7 chars)
- Subtle styling:
text-[10px] text-muted-foreground/60 - Hover brightening for affordance
- Hidden when no build info (local dev)
-
Tooltip content:
- Build Information section with table layout
- Recent Changes section with categorized items
- Proper keyboard accessibility
-
Accessibility:
- Focusable button trigger
aria-labelwith version info- Focus ring styling
- Both hover and focus trigger tooltip
- Screen reader friendly content
Step 5: Integrate component
Add the component to the appropriate location:
Common locations:
- Header/navbar (most common)
- Footer
- Settings page
- About modal
Default: Place below the main title in header, for both desktop and mobile nav.
Component Variants
React + Tailwind + shadcn/ui
Uses Tooltip from shadcn/ui, cn utility for class merging.
React + Tailwind (no UI library)
Native implementation with Radix Tooltip or custom tooltip.
Vue 3 + Tailwind
Vue component with Teleport for tooltip positioning.
Svelte + Tailwind
Svelte component with actions for tooltip behavior.
Plain CSS
Generates CSS with custom properties for theming.
Build Script Template
#!/usr/bin/env node
/**
* parse-changelog.mjs
* Parses CHANGELOG.md and outputs JSON for the version badge tooltip
*/
import { readFileSync, existsSync } from 'fs';
const CHANGELOG_PATH = './CHANGELOG.md';
const MAX_VERSIONS = 2;
const MAX_FEATURES_PER_VERSION = 3;
const MAX_OTHER_PER_VERSION = 2;
function parseChangelog() {
if (!existsSync(CHANGELOG_PATH)) {
return JSON.stringify([]);
}
const content = readFileSync(CHANGELOG_PATH, 'utf-8');
const versions = [];
// Parse version headers and their changes
const versionRegex = /^## \[?(\d+\.\d+\.\d+)\]?/gm;
const changeRegex = /^\* \*\*(\w+):\*\* (.+)$/gm;
// ... parsing logic ...
return JSON.stringify(versions.slice(0, MAX_VERSIONS));
}
// Output for environment variable
console.log(parseChangelog());
Flags
| Flag | Description |
|---|---|
--check-only | Analyze project and show what would be implemented |
--location <loc> | Specify component placement (header, footer, custom) |
Examples
# Implement version badge with auto-detection
/components:version-badge
# Check what would be implemented without changes
/components:version-badge --check-only
# Place in footer instead of header
/components:version-badge --location footer
Post-Implementation
After implementing:
- Verify build: Run build command to ensure env vars are set
- Test tooltip: Check hover and keyboard accessibility
- Update CI: Ensure changelog is available during build
- Document: Add note to README about version display feature
Error Handling
- No package.json: Warn and ask for framework specification
- Unknown framework: Offer generic implementation or ask user
- No CHANGELOG.md: Component works without changelog, shows only build info
- Existing component: Ask before overwriting, offer merge strategy
See Also
version-badge-patternskill - Detailed pattern documentation
Readme
Component Patterns Plugin
Reusable UI component patterns for implementing common features across different frameworks and tech stacks.
Overview
This plugin provides framework-agnostic patterns and commands for implementing common UI components that are useful across multiple projects. Components are designed with:
- Framework agnostic: Support for React, Vue, Svelte, and vanilla JS
- Zero runtime overhead: Build-time processing where possible
- Accessibility first: WCAG compliant, keyboard navigable
- Progressive disclosure: Show essential info first, details on demand
Skills
| Skill | Description |
|---|---|
/components:version-badge | Implement a version badge with tooltip showing build info and changelog |
version-badge-pattern | Detailed implementation patterns for the version badge component |
Version Badge Component
The flagship component of this plugin. Displays application version, git commit, and recent changelog entries in an accessible tooltip.
Features
- Trigger display:
v1.43.0 | 004ddd9- version + abbreviated commit SHA - Tooltip content:
- Build information (version, full commit, build time, branch)
- Recent changelog entries with categorized icons
- Build-time processing: Changelog parsed at build time, no runtime overhead
- Accessibility: Keyboard accessible, screen reader friendly
Quick Usage
# Implement version badge with auto-detection
/components:version-badge
# Check what would be implemented without making changes
/components:version-badge --check-only
# Place in footer instead of header
/components:version-badge --location footer
Supported Frameworks
| Framework | Styling | UI Library |
|---|---|---|
| Next.js | Tailwind CSS | shadcn/ui, Radix UI |
| Nuxt | Tailwind CSS | Native |
| SvelteKit | Tailwind CSS | Native |
| Vite + React | Tailwind CSS, CSS Modules | Any |
| Vite + Vue | Tailwind CSS, CSS Modules | Any |
| CRA | CSS Modules | Any |
Data Flow
CHANGELOG.md --> parse-changelog.mjs --> ENV_VAR --> Component
package.json version ----------------------------------------^
git commit SHA ---------------------------------------------^
Visual Design
App Header v1.43.0 | 004ddd9
|
v (on hover/focus)
+-------------------------+
| Build Information |
| Version: 1.43.0 |
| Commit: 004ddd97e8... |
| Built: Dec 11, 10:00 |
| Branch: main |
|-------------------------|
| Recent Changes |
| v1.43.0 |
| New feature X |
| Fixed bug Y |
+-------------------------+
Installation
Add this plugin to your Claude Code configuration:
{
"plugins": [
"laurigates/claude-plugins/component-patterns-plugin"
]
}
License
MIT
Details
- Marketplace
- laurigates/claude-plugins
- Source
- component-patterns-plugin
- Author
- Lauri Gates
- Category
- Ux
- License
- MIT
- Keywords
- components, ui-patterns, version-badge, react, vue, svelte, framework-agnostic
- Listed since
- Apr 7, 2026
More from laurigates/claude-plugins
All 52- configure-pluginv1.43.12
- container-pluginv2.11.5
- css-pluginv1.2.4
- documentation-pluginv1.16.1
- evaluate-pluginv1.21.1
- feedback-pluginv1.16.3
- finops-pluginv1.4.7
- foundryvtt-pluginv1.6.4
- git-pluginv2.74.4
- github-actions-pluginv1.13.8
- health-pluginv1.24.9
- home-assistant-pluginv1.4.1
- hooks-pluginv2.22.3
- kernel-pluginv1.1.1
- kitty-pluginv2.0.0
- kubernetes-pluginv1.10.4
- langchain-pluginv1.5.10
- linux-pluginv1.1.1
- macos-pluginv2.0.1
- migration-patterns-pluginv1.7.1
- networking-pluginv1.4.3
- obsidian-pluginv1.3.8
- project-pluginv1.21.17
- prompt-engineering-pluginv1.1.4
Similar to component-patterns-plugin
More Frontend & UI Code
web-component-designSkillwshobson/agents13.8K installsReusable UI component patterns across React, Vue, and Svelte, covering styling and API design.
muiPluginsoftaworks/agent-toolkit2.7K starsMaterial-UI v7 component library patterns including sx prop styling, theme integration, responsive design, and MUI-specific hooks.
accessibility-pluginPluginlaurigates/claude-plugins60 starsAccessibility and UX implementation - WCAG, ARIA, design tokens
ui-designPluginwshobson/agents42.8K starsComprehensive UI/UX design plugin for mobile (iOS, Android, React Native) and web applications with design systems, accessibility, and modern patterns
artifacts-builderPluginComposioHQ/awesome-claude-skills51.5K starsSuite of tools for creating elaborate, multi-component claude.ai HTML artifacts using modern frontend web technologies (React, Tailwind CSS, shadcn/ui). Use for