Skip to content

feat(registry): add Product Hunt button component#6

Merged
jal-co merged 6 commits intomainfrom
feat/producthunt-button
Mar 13, 2026
Merged

feat(registry): add Product Hunt button component#6
jal-co merged 6 commits intomainfrom
feat/producthunt-button

Conversation

@jal-co
Copy link
Owner

@jal-co jal-co commented Mar 13, 2026

New Component: producthunt-button

Link button showing a Product Hunt post's upvote count with the official PH icon. Two layouts (inline button and expanded card), seven visual variants including branded Product Hunt orange, and three icon styles. Async server component that fetches the PH GraphQL API with ISR caching, or accepts pre-fetched data.

Checklist

Implementation

  • Component source exists in registry/producthunt-button/
  • registry.json entry added with accurate title, description, categories, dependencies, and files
  • "use client" only where required
  • Accessible markup and keyboard interactions
  • No unnecessary dependencies added

Sidebar & Navigation

  • Entry added to lib/docs.ts with correct group, title, and href
  • badge: "New" and badgeAdded: "2026-03-12" set with today's date

Docs Page

  • Docs page created at app/docs/components/producthunt-button/page.tsx
  • Uses ComponentDocsPage with title, description, registryName, sourceFiles, preview, usage
  • Description matches across docs page, registry.json, and lib/docs.ts
  • Realistic preview content
  • Examples section with labeled variants
  • API Reference table

Card Preview

  • Preview file created at components/docs/previews/producthunt-button.tsx
  • Shows key variants / sizes / layout exports
  • pnpm previews:generate run to update import map

Screenshots

  • Screenshots generated via /dev/screenshots page
  • public/previews/producthunt-button-dark.png exists
  • public/previews/producthunt-button-light.png exists
  • Screenshots saved at 1280×640 @ 2x
  • Component properly centered and scaled in screenshot frame

Registry Build

  • pnpm registry:build passes
  • pnpm build passes with no errors
  • Verified install works: npx shadcn@latest add http://localhost:3000/r/producthunt-button.json

Screenshots

Dark Light
dark light

Notes

  • Uses the official Product Hunt icon SVG from vectorlogo.zone (public domain)
  • Brand color #DA552F matches official PH branding
  • currentColor icon uses evenodd fill rule so the P is a true transparent cutout — works on any background
  • Requires PRODUCTHUNT_TOKEN for live API fetching; works without it when upvotes/name props are pre-fetched
  • No new dependencies — uses existing class-variance-authority

jal-co added 2 commits March 12, 2026 22:04
Now an official shadcn registry. Install commands change from:
  npx shadcn@latest add https://ui.justinlevine.me/r/code-line.json
to:
  npx shadcn@latest add jalco/code-line

Updated: install-command component, component-docs-page, prompts,
installation page, ai-copy-button docs, and README.
- Async server component showing upvote count with official PH icon
- Two layouts: inline button and expanded card
- Seven visual variants including branded Product Hunt orange
- Three icon styles: currentColor (evenodd cutout), brand, muted
- Fetches PH GraphQL API with ISR caching, or accepts pre-fetched data
- Docs page with playground, variant grid, API reference
- Card preview, screenshots, sidebar nav entry
…uide, move to Open Source nav

- Replace geometric triangle with official PH rounded upvote SVG
- Return null when no post data and no pre-fetched props
- Add 'Getting a Product Hunt Token' section with step-by-step instructions
- Move nav entry from Marketing to Open Source group
@jal-co jal-co merged commit f952f43 into main Mar 13, 2026
2 checks passed
@jal-co jal-co deleted the feat/producthunt-button branch March 13, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant