# Reject Drop Input

A text input that lets go of characters it can't accept: a rejected letter appears where it was typed, blushes red, tips over its corner and drops out of the field under real gravity, fading as it falls, while a short hint says what the field takes.

- Page and source: https://uibrik.com/components/reject-drop-input
- Install: `npx shadcn@latest add https://uibrik.com/r/reject-drop-input.json`
- Packages (installed by the CLI): motion
- Import: `import { RejectDropInput } from "@/components/uibrik/reject-drop-input/reject-drop-input"`

Where to use the Reject Drop Input React component:

- **Phone and card numbers**: Letters typed into a number field visibly fall out, so the user sees why nothing appeared. Pairs with [Phone Input](https://uibrik.com/components/phone-input) and [Card Input](https://uibrik.com/components/card-input).
- **Amounts**: The amount preset keeps one decimal point and two decimals, and drops the rest. Pairs with [Amount Pad](https://uibrik.com/components/amount-pad).
- **Codes and handles**: Usernames, promo codes and IDs reject spaces and symbols without a silent swallow.

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| accept | `"digits" \| "letters" \| "alphanumeric" \| "amount"` | `"digits"` | Which characters the field keeps. |
| maxLength | `number` | `0` | Characters past this count are rejected too. 0 for no limit. |
| color | `string` | `"#ef4444"` | Colour of rejected characters and the hint. |
| gravity | `number` | `1` | How hard rejected characters fall. |
| shake | `boolean` | `false` | Nudge the field sideways on a rejection. |
| size | `"sm" \| "md" \| "lg"` | `"md"` | Height, padding and text size. |
| radius | `number` | `12` | Corner radius. |
| allow | `(char: string, soFar: string) => boolean` |  | Custom rule; return true to keep the character. Overrides accept. |
| value | `string` |  | Controlled value. |
| defaultValue | `string` | `""` | Starting value when uncontrolled. |
| onChange | `(value: string) => void` |  | Called with the cleaned value. |
| onReject | `(rejected: string) => void` |  | Called with the characters that were thrown out. |
| placeholder | `string` |  | Placeholder text. |
| label | `string` | `"Number"` | Accessible name for the field. |
| hint | `string` |  | Shown under the field after a rejection. Defaults to the preset's hint. |
| className | `string` |  | Classes for the wrapper. |
