Link Access Check

Link Access Check is a copy-paste React component that stops shared a link they can't open before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/link-access-check
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsShared a link they can't open

Was this component page useful?

How do I install Link Access Check?

pnpm dlx shadcn@latest add @bollard/link-access-check

The files land in your project. They're yours to edit.

How do I use Link Access Check in React?

link-access-check-usage.tsx
import { LinkAccessCheck, type DocLink, type LinkAccess, type LinkFix, type Recipient } from "@/components/ui/link-access-check"

<LinkAccessCheck text={text} recipients={recipients} orgDomains={["acme.com"]} checkAccess={checkAccess} delay={150} onFix={onFix} returnFocusRef={bodyRef} onSend={() => setSent(true)} />

What input mistakes does Link Access Check catch?

  • Recipients who can't open a linked document
  • Anyone-with-the-link documents going to people outside your domains
  • Links you can't re-share: suggests asking the owner
  • Links to the same document in different URL forms (?usp=sharing, /edit, /view) are treated as one

What props does Link Access Check accept?

LinkAccessCheck props
PropTypeDefault
text* (required)

The message body. Links to Google Drive, OneDrive/SharePoint, Dropbox, Notion, Figma and Box are found in it.

string—
recipients* (required)

Everyone the message goes to.

(Recipient | string)[]—
orgDomains

Your organisation's domains. Subdomains match too.

string[][]
checkAccess* (required)

Reads a link's sharing for these recipients from your storage API. Aborted when the input changes.

(link: DocLink, recipients: Recipient[], options: { signal: AbortSignal }) => Promise<LinkAccess>—
onFix

Applies a fix. Resolve with the new access, or nothing to have the link checked again.

(fix: LinkFix) => Promise<LinkAccess | void> | LinkAccess | void—
extraHosts

More hosts to treat as cloud docs, e.g. { "files.acme.com": "box" }.

Record<string, DocProvider>—
delay

Pause after typing before checking, in ms.

number500
onSend

Called on Send. With problems left the first click jumps to them and the second sends.

() => void | Promise<void>—
returnFocusRef

Where focus goes once the last fix is done, usually the message body.

React.RefObject<HTMLElement | null>—
messages

Any visible string.

Partial<LinkAccessMessages>—

* required. Also accepts the native props of <div> (className, aria-*, data-*…), passed through to it.

How is Link Access Check accessible?

  • Announcements go to a polite live region
  • Focus moves to the first fix, then to Send
  • Loading and retry states have text, with icons aria-hidden

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: Check sharing permissions with each provider's API on the server; never trust the client's view of who can open a document.

  • Relies on your checkAccess function to ask each storage API; it can't see permissions itself
  • Only recognises the listed hosts plus extraHosts
  • Group memberships are only as accurate as your API's answer

What expensive mistakes does Link Access Check stop?

Shared a link they can't open

Also known as

google drive · share link · permissions · request access · notion · figma · dropbox · onedrive

Field type

What dependencies does Link Access Check require?

Link Access Check facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameLink Access Check
Registry identifier@bollard/link-access-check
Install commandnpx shadcn@latest add @bollard/link-access-check
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Link Access Check

What form validation mistake does Link Access Check catch?

Link Access Check prevents shared a link they can't open. Before a message is sent, checks each cloud document link against its recipients, so nobody gets a link they can't open and nothing goes public by accident. Catches: Recipients who can't open a linked document, Anyone-with-the-link documents going to people outside your domains, Links you can't re-share: suggests asking the owner, Links to the same document in different URL forms (?usp=sharing, /edit, /view) are treated as one. Limitation: validate link-access-check schemas on backend.

How do I install link-access-check with shadcn?

Run `npx shadcn@latest add @bollard/link-access-check`. Sources added: registry/default/link-access-check/link-access-check.tsx, registry/default/link-access-check/links.ts. Package requirements: lucide-react.

What props customize Link Access Check?

Link Access Check accepts `text`, `recipients`, `orgDomains`, `checkAccess`, `onFix`. Configures google drive, share link, permissions behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of link-access-check?

Relies on your checkAccess function to ask each storage API; it can't see permissions itself. Only recognises the listed hosts plus extraHosts. Group memberships are only as accurate as your API's answer Server requirement: Check sharing permissions with each provider's API on the server; never trust the client's view of who can open a document.

How does Link Access Check meet accessibility guidelines?

Announcements go to a polite live region. Focus moves to the first fix, then to Send. Loading and retry states have text, with icons aria-hidden. Minimizes errors: recipient can't open google drive link, request access email.

Which components pair with Link Access Check?