Skip to content

feat(scraps): Publish Link in the shadcn registry - #133339

Draft
sentry-junior[bot] wants to merge 1 commit into
masterfrom
nm/scraps-shadcn-link
Draft

sentry-junior[bot] wants to merge 1 commit into
masterfrom
nm/scraps-shadcn-link

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Dec 3, 2026

Copy link
Copy Markdown
Contributor

Adds a scraps/link registry:ui item. pnpm dlx shadcn@latest add getsentry/sentry/scraps/link writes components/ui/scraps/link.tsx, which re-exports Link, LinkProps, LinkBehaviorContextProvider, and useResolveLinkHref from @sentry/scraps/link. It depends on @sentry/scraps@>=0.8.0 and @emotion/react, like the Button item.

stock shadcn/ui has no link component, only buttonVariants({variant: 'link'}). Scraps Link adds the themed link colors, focus ring, a disabled state that drops the href, and to destinations given as objects ({pathname, query, hash}) that it serializes for you.

Link doesn't depend on any router. With no provider it renders <a href>. To navigate client-side, an app wraps its tree in LinkBehaviorContextProvider with a small adapter around its router's link, and replace, preventScrollReset, and state reach that adapter unchanged. This works with React Router or Next (Sentry Evals already uses this pattern with next/link). The README gets a new ## shadcn/ui components section with the install command and a React Router adapter example. Modifier-clicks are left to the browser, because Scraps never calls preventDefault on an enabled link.

One setup snag is documented in the README. @sentry/scraps pins @types/react@19.3.0 as a regular dependency. When an app resolves a different @types/react, spreading LinkProps onto the router's link fails to typecheck on ref. Overriding @types/react to the app's version fixes it. The real fix is moving @types/react to a peer dependency in a later Scraps release.

Closes DE-1995

via @natemoo-re.

--

View Session [Sentry]

Add a scraps/link registry:ui item that re-exports Link from
@sentry/scraps/link, with LinkBehaviorContextProvider and
useResolveLinkHref so apps can route it through their own router.

Closes DE-1995
@linear-code

linear-code Bot commented Dec 3, 2026

Copy link
Copy Markdown

DE-1995

@vercel

vercel Bot commented Dec 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
scraps Ready Ready Preview Dec 3, 2026 12:38am UTC

Request Review

@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Dec 3, 2026

This branch was successfully deployed

1 active deployment
Preview – sentry — d521a703 Deployed Dec 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant