Hashtag Input

Hashtag Input is a copy-paste React component that stops helps catch a hashtag cut short by a space 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/hashtag-input
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

StopsHelps catch a hashtag cut short by a space

Was this component page useful?

How do I install Hashtag Input?

pnpm dlx shadcn@latest add @bollard/hashtag-input

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

How do I use Hashtag Input in React?

hashtag-input-usage.tsx
import { HashtagInput } from "@/components/ui/hashtag-input"

<HashtagInput
  label="Tags for your launch post"
  defaultValue={["opensource", "BuildInPublic", "women's day", "OpenSource", "followforfollow", "WebDev"]}
  banned={["followforfollow", "like4like", "f4f"]}
/>

What input mistakes does Hashtag Input catch?

  • Space, apostrophe or punctuation that cuts a tag short
  • All-digit tags that don't link
  • Duplicates that differ only by case
  • Tags on your banned list
  • More tags than a platform allows or recommends (Instagram: 5 per post or Reel)
  • All-lowercase multi-word tags, with a CamelCase suggestion

What props does Hashtag Input accept?

HashtagInput props
PropTypeDefault
label

Visible label.

string"Hashtags"
value

Controlled tags, without the #.

string[]—
defaultValue

Initial tags when uncontrolled.

string[][]
onValueChange

Called with the current list of tags.

(tags: string[]) => void—
platforms

Per-platform limits shown as counts.

HashtagPlatform[]DEFAULT_PLATFORMS
banned

Tags that are banned or read as spam on your platforms (case-insensitive).

string[]—
words

Extra words (brand names, jargon) used to suggest CamelCase.

string[]—
placeholder

Input placeholder.

string"Add a tag, then Enter"
messages

Messages; `{tag}`, `{at}`, `{posts}`, `{of}` and `{fix}` are filled in.

Partial<Record<HashtagIssue["kind"], string>>—
overLimitText

`{name}`, `{count}` ("1 tag") and `{tags}` are filled in.

string"{name} keeps {max}: {tags} would be dropped."
removeLabel

Accessible label for each tag's remove button; {tag} is filled in.

string"Remove #{tag}"

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

How is Hashtag Input accessible?

  • Visible label tied to the input; Enter or comma adds a tag, Backspace on an empty field removes the last
  • Each remove button has an aria-label naming the tag
  • Issues are in a polite live region; icons are aria-hidden
  • Animation is skipped under reduced motion

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

What are the limitations and server boundaries?

  • CamelCase split uses a small built-in word list; extend it with the words prop
  • Platform limits are baked in and change; pass your own platforms
  • Does not check whether a tag is shadow-banned or trending

What validation rules apply to Hashtag Input?

Rules last verified:

Informational; platform limits change. Only the Instagram limit was checked; LinkedIn and X counts are recommendations and were not re-verified. Copied components don't update themselves, so re-check after rule changes (see updating a component).

What expensive mistakes does Hashtag Input stop?

Helps catch a hashtag cut short by a space

Also known as

hashtag · tags · social post · instagram · x post · linkedin · camelcase · caption

Field type

What dependencies does Hashtag Input require?

Hashtag Input facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameHashtag Input
Registry identifier@bollard/hashtag-input
Install commandnpx shadcn@latest add @bollard/hashtag-input
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 Hashtag Input

What form validation mistake does Hashtag Input catch?

Hashtag Input prevents helps catch a hashtag cut short by a space. Catches hashtags that quietly break, such as #don't posting as #don, and posts over a platform's tag limit. Catches: Space, apostrophe or punctuation that cuts a tag short, All-digit tags that don't link, Duplicates that differ only by case, Tags on your banned list, More tags than a platform allows or recommends (Instagram: 5 per post or Reel), All-lowercase multi-word tags, with a CamelCase suggestion. Limitation: validate hashtag-input schemas on backend.

How do I install hashtag-input with shadcn?

Run `npx shadcn@latest add @bollard/hashtag-input`. Sources added: registry/default/hashtag-input/hashtag-input.tsx, registry/default/hashtag-input/hashtag-words.ts. Package requirements: lucide-react.

What props customize Hashtag Input?

Hashtag Input accepts `label`, `value`, `defaultValue`, `onValueChange`, `platforms`. Configures hashtag, tags, social post behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of hashtag-input?

CamelCase split uses a small built-in word list; extend it with the words prop. Platform limits are baked in and change; pass your own platforms. Does not check whether a tag is shadow-banned or trending Server requirement: backend verification for hashtag-input.

How does Hashtag Input meet accessibility guidelines?

Visible label tied to the input; Enter or comma adds a tag, Backspace on an empty field removes the last. Each remove button has an aria-label naming the tag. Issues are in a polite live region; icons are aria-hidden. Animation is skipped under reduced motion. Minimizes errors: hashtag apostrophe breaks, too many hashtags.

Which components pair with Hashtag Input?