Image Tag Input

Reads a container image reference back the way Docker resolves it, so :latest, moving tags or a typo'd registry don't deploy the wrong image.

StopsHelps prevent a deploy pulling the wrong image

Installation

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

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

Usage

image-tag-input-usage.tsx
import { ImageTagInput } from "@/components/ui/image-tag-input"

<ImageTagInput label="API image" production platform="linux/amd64" privateRegistry="ghcr.io/acme" defaultValue="acme/api:latest" tags={["1.4.2", "1.4.1"]} resolveDigest={resolveDigest} />

What it catches

  • :latest or a missing tag for production
  • Moving tags such as stable or main
  • Typo'd or frozen registry hosts
  • Private image names that would resolve to Docker Hub
  • Malformed digests and arch-specific tags that won't run on the target platform

Props

ImageTagInput props
PropTypeDefault
value

Controlled reference.

string—
defaultValue

Initial reference when uncontrolled.

string""
onValueChange

Called with the new reference on every edit or fix.

(value: string) => void—
tags

Known tags for this image, newest first. The first full version is offered instead of :latest or a moving tag.

string[][]
resolveDigest

Looks up the digest a reference points to now (e.g. via your registry API). Enables one-tap "Pin digest".

(reference: string) => Promise<string>—
label

Visible label; shorthand for `messages.label`.

string—
messages

Every visible string. `{fix}`, `{detail}`, `{platform}` are filled in.

Partial<ImageTagInputMessages>—

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

Accessibility

  • Visible label; input has aria-invalid on errors and is described by the readback and issues
  • Implied parts carry a title explaining they are implied
  • Issues use role=status; focus returns to a nearby control after a fix

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

Limitations

This is a UX guard rail. Enforce on the server: Pin digests and enforce allowed registries with admission policy in the cluster or CI.

  • Parses the reference; it does not query a registry unless you pass resolveDigest
  • Registry typo and moving-tag lists are heuristics
  • Doesn't scan the image for vulnerabilities or verify signatures

What it stops

Helps prevent a deploy pulling the wrong image

Also known as

docker image · image tag · container · digest · sha256 · registry · ghcr · ecr

Field type

Dependencies

Pairs well with