1 slot open this monthBy the makers of shadcnregistryWe built shadcnregistry. Now we build your product.Book a callCheck availability
1 slot open this monthAI features?We build AI features into your product.Book a callCheck availability
1 slot open this month🚨 Slop police🚨 Slop police: we clean up vibe-coded apps.Report itReport your app
shadcnregistry
shadcnregistry
RegistryHealthInspect
Terms of ServicePrivacy Policy
  1. Registries
  2. sunui
  3. Floating Field

Floating Field

block

A text field that tells you what is left and fixes the obvious: with mask (for example 999-9999) typed characters are followed by the remaining slots in muted text and separators are added for you; with suggest (suggestEmail is exported) it offers a fix for common email domain typos after you leave the field, such as gmial.com to gmail.com, and accepting swaps only the wrong letters in place; with maxLength a character count sits on the label line, or with counter="ring" a small ring fills as you type and shows the characters left in the last tenth. With strength it becomes a password field with a four-segment concave meter that fills by level (the spot colour only when every rule passes) and a live checklist of configurable rules; the show/hide button still goes in the trailing slot. The floated label stays readable at 12px, and validation, hints, server errors, textarea and the trailing slot work as before. Reduced motion switches instantly.

pnpm dlx shadcn@latest add "https://sunui.synvize.com/r/floating-field.json"
Premium blocks for shadcn/uiShadcnblocks.com · AffiliateExplore
  • framer-motion
  • utils
components/floating-field.tsx