1import { Input } from "funuicss";The basic text input component accepts user text input. It supports various types including email, password, number, and more.
Key Features:
- • Multiple input types (text, email, password, number, tel, url, etc.)
- • Default border-bottom styling
- • Full width support
- • Placeholder text support
Labels provide context for input fields with a smooth floating animation. When focused or filled, the label moves to the top of the input.
Key Features:
- • Floating label animation on focus
- • Label stays active when input has value
- • No placeholder conflict - label replaces placeholder
- • Works with all input variants
Control the border style of your inputs with different props.
Available Options:
- • Default: Bottom border only
- • bordered: Full border around input
- • borderless: No visible border
Create dropdown select menus using the select prop with an array of options.
Key Features:
- • Array-based options with value/text pairs
- • Floating label support
- • Custom styling options
- • onChange event handling
Create multiline text inputs for longer form content like messages, descriptions, or comments.
Key Features:
- • Customizable row height
- • Floating label support
- • Auto-expanding text area
- • All styling options available
- • Default: Drag-and-drop style with icon
- • Button: Button-style file selector (use btn prop)
The default file input provides a clean drag-and-drop interface with custom icon support.
Use the btn prop to render the file input as a button for a more compact design.
Enhance your inputs with icons on the left or right side for better visual context.
Key Features:
- • startIcon: Icon on the left side
- • endIcon: Icon on the right side
- • iconicBg: Custom background for icon container
- • Works with any React icon library
Provide visual feedback with status indicators and helper text for form validation.
Available Status Types:
- • success: Valid input (green)
- • warning: Warning state (yellow/orange)
- • danger: Error state (red)
- • info: Informational (blue)
Each status automatically displays an icon and changes the input border color.
Customize the appearance of your inputs with various styling props.
Available Options:
- • rounded: Fully rounded corners
- • leftRounded: Round left corners only
- • rightRounded: Round right corners only
- • flat: No border radius (sharp corners)
- • bg: Custom background color
- • funcss: Additional CSS classes
| Prop | Description | Value(s) |
|---|---|---|
| `type` | HTML input type | `text | email | password | number | tel | url | date | time | etc.` |
| `label` | Floating label text that appears above input when focused or filled | `string` |
| `placeholder` | Placeholder text (hidden when label is present) | `string` |
| `helperText` | Helper text displayed below input with status icon | `string` |
| `status` | Visual status indicator for validation | `success | warning | danger | info` |
| `value` | Controlled input value | `string | number` |
| `defaultValue` | Initial value for uncontrolled input | `string | number` |
| `onChange` | Change event handler | `(event) => void` |
| `onFocus` | Focus event handler | `(event) => void` |
| `onBlur` | Blur event handler | `(event) => void` |
| `bordered` | Add full border around input | `boolean` |
| `borderless` | Remove all borders | `boolean` |
| `rounded` | Add full border radius | `boolean` |
| `leftRounded` | Round left corners only | `boolean` |
| `rightRounded` | Round right corners only | `boolean` |
| `flat` | Remove border radius (sharp corners) | `boolean` |
| `fullWidth` | Make input 100% width of container | `boolean (default: true)` |
| `startIcon` | Icon component to display on the left | `React.ReactNode` |
| `endIcon` | Icon component to display on the right | `React.ReactNode` |
| `iconicBg` | Background color for icon containers | `FunUi color string` |
| `bg` | Input background color | `FunUi color string` |
| `funcss` | Additional CSS classes | `string` |
| `select` | Render as select dropdown | `boolean` |
| `options` | Options array for select dropdown | `[{value: string, text: string}]` |
| `multiline` | Render as textarea | `boolean` |
| `rows` | Number of rows for textarea | `number (default: 2)` |
| `file` | Render as file upload input | `boolean` |
| `btn` | Use button style for file upload | `boolean` |
| `icon` | Icon for file upload component | `React.ReactNode` |
| `extra` | Additional text for file upload | `string` |
| `id` | HTML id attribute | `string` |
| `name` | HTML name attribute for forms | `string` |
| `disabled` | Disable the input | `boolean` |
| `required` | Mark input as required | `boolean` |
| `variant` | Theme variant configuration | `string` |