Input
Addon Input
NewA text field with fixed text before or after the value, such as https:// or a currency, as plain text or boxed edges.
npx motionsnack add addon-inputCustomize
Error Colour
<AddonInput />Props
21 properties
| Property | Type | Default | Description |
|---|---|---|---|
| value | string | - | Controlled value. Leave undefined to let the component manage it. |
| defaultValue | string | '' | Value on first render when uncontrolled. |
| onChange | (value: string) => void | - | Called with the new text on every change. |
| name | string | - | Name submitted with a form. |
| invalid | boolean | false | Invalid without its own message. |
| id | string | generated | Id of the input. |
| className | string | '' | Extra classes on the wrapper. |
| label | string | 'Website' | Label above the field. Empty hides it. |
| prefix | string | 'https://' | Fixed text before the value. Empty hides it. |
| suffix | string | '' | Fixed text after the value. Empty hides it. |
| addonStyle | 'boxed' | 'inline' | 'boxed' | Prefix and suffix as plain text inside the field, or as boxes on its edges. |
| placeholder | string | 'yourstudio.com' | Hint inside the empty field. |
| helperText | string | 'Where people can see your work.' | Small text under the field. Empty hides it. |
| error | string | '' | Error message. Any text switches the field to its error state. |
| type | 'text' | 'url' | 'email' | 'number' | 'tel' | 'text' | Native input type. |
| required | boolean | false | Marks the field as required. |
| disabled | boolean | false | Disables the field. |
| readOnly | boolean | false | Focusable and selectable, but not editable. |
| errorColor | string | '' | Error colour for both themes. Empty uses the per-theme pair. |
| height | number | 48 | Height of the field. |
| radius | number | 12 | Corner radius of the field. |
About Addon Input
Addon Input is for values that always share the same start or end: a web address, a price, a weight or a username. The fixed text sits inside the field as quiet plain text, or in boxes on its edges, and darkens once the field is focused or filled. Focus shows the library's clear outline around the whole field, white on dark pages and black on light ones. A label, helper text, required mark and an error state that recolours the outline are built in. It works controlled or uncontrolled.
What's included
- Prefix and suffix text
- Inline or boxed addons
- Clear focus outline, white on dark and black on light
- Label, helper text and required mark
- Error state with alert message
- Light and dark look
- Type
- Animated React input component
- Library
- Components · Input
- Stack
- Next.js, React, Tailwind CSS
- Added
- 2026-11-23
- Install
npx motionsnack add addon-input