useInputStatusIcon — Coupon Code Status
- from @astryx
- by Astryx
A custom bordered coupon-code input whose status affordance comes from useInputStatusIcon. A wrong code shows the error status and SAVE20 shows success. Switching the variant moves between a plain glyph with a message below (attached), no icon on the field (detached), and a focusable button whose tooltip keyboard and screen-reader users can reach, with its aria-describedby id returned by the hook (tooltip).
Install
New to shadcn? Set up your project
If your project already has a shadcn components.json, skip initialization. Otherwise, run this once from your project root.
pnpm dlx shadcn@latest initpnpm dlx shadcn@latest add @astryx/example-use-input-status-icon-coupon-code-statusRegistry dependencies0
The CLI adds no other registry items with this one.
