Components
Input

Input

The Input component provides you with form input fields with validation and error handling.

Import

import { Input } from '@nostromo/ui-core'
// or
import { Input } from '@nostromo/ui-core/input'

Usage

import { Input } from '@nostromo/ui-core'
 
export default function Example() {
  return (
    <Input 
      type="email" 
      placeholder="Enter your email"
      label="Email"
    />
  )
}

Live Examples

Live Example
☀️
Copy
Storybook →
View Code
import { Input } from '@nostromo/ui-core' export default function InputDefault() { return <Input placeholder="Type something..." /> }...
Live Example
☀️
Copy
Storybook →
View Code
import { Input } from '@nostromo/ui-core' export default function InputExamples() { return ( <div className="space-y-4"> <Input placeholder="Type something..." /> <Input type="email" placeholder="Email" /> <Input type="password" placeholder="Password" /> <Input disabled placeholder="Disabled" /> </div>...
Live Example
☀️
Copy
Storybook →
View Code
import { Input } from '@nostromo/ui-core' export default function InputWithError() { return ( <div className="space-y-4"> <Input placeholder="Email" error helperText="Please enter a valid email address" /> <Input placeholder="Password" type="password" error /> </div> ) }...

With Label

import { Input, Label } from '@nostromo/ui-core'
 
export default function InputWithLabel() {
  return (
    <div className="space-y-2">
      <Label htmlFor="email">Email</Label>
      <Input id="email" type="email" placeholder="your@email.com" />
    </div>
  )
}

Props

PropTypeDefaultRequiredDescription
type"text" | "email" | "password" | "number" | "tel" | "url" | "search""text"NoHTML input type
variant"default" | "error" | "success""default"NoVisual variant (auto-set based on error/success)
inputSize"sm" | "default" | "lg""default"NoSize of the input
labelstringundefinedNoLabel text displayed above input
helperTextstringundefinedNoHelper text displayed below input
errorbooleanfalseNoWhether the input has an error state
successbooleanfalseNoWhether the input has a success state
placeholderstringundefinedNoPlaceholder text
disabledbooleanfalseNoWhether the input is disabled
valuestringundefinedNoControlled input value
onChange(event: React.ChangeEvent<HTMLInputElement>) => voidundefinedNoChange event handler
idstringundefinedNoInput ID (auto-generated if not provided)
namestringundefinedNoInput name for form submission
requiredbooleanfalseNoWhether the input is required
classNamestringundefinedNoAdditional CSS classes

Standard HTML Input Props

The Input component extends all standard HTML input attributes, including:

  • autoComplete, autoFocus, maxLength, minLength, pattern, readOnly
  • aria-* attributes for accessibility
  • data-* attributes for custom data
  • All other standard HTML input attributes