Glob Input

Runs a config glob live against your real file list, so a pattern that silently misses files, or matches everything, shows up while you type.

StopsConfig glob silently misses files

Installation

pnpm dlx shadcn@latest add https://bollard-ui.vercel.app/r/glob-input.json

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

Usage

glob-input-usage.tsx
import { GlobInput } from "@/components/ui/glob-input"

return <GlobInput label="Lint these files" files={files} defaultValue="src/*.{ts,tsx} !**/*.test.*" />

What it catches

  • Pattern that matches no files
  • Pattern that matches every file
  • * used where ** was needed, skipping subfolders
  • ** glued to a name (src/**.ts)
  • Leading ./ and Windows backslashes

Props

GlobInput props
PropTypeDefault
files* (required)

The relative, "/"-separated paths the pattern runs against.

string[]—
label

Visible label.

string"Files to include"
value

Controlled pattern text. Several patterns are separated by spaces.

string—
defaultValue

Initial pattern when uncontrolled.

string""
onValueChange

Called with the text and the files it matches.

(value: string, matches: string[]) => void—
caseSensitive

Match letter case exactly, as Linux and git do.

booleantrue
messages

Override any of the default messages.

Partial<typeof GLOB_MESSAGES>—

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

Accessibility

  • Visible label tied to the input; input is described by the status
  • Status is a polite live region
  • Match list is a labelled list with icon labels ("matches"/"no match"), not colour alone
  • List animation is skipped under reduced motion

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

Limitations

  • Its own matcher; tools such as webpack, tsconfig, git or picomatch differ on edge cases (negation, dotfiles, extglobs)
  • Only as accurate as the file list you pass in
  • Case-insensitive by default; set caseSensitive for Linux/git behaviour

What it stops

Config glob silently misses files

Also known as

glob · file pattern · gitignore · include exclude · tsconfig · eslint · ci paths · wildcard

Field type

Dependencies

Pairs well with