Input

Text input field with ASCII border styling for forms and user input.

Docs•API Reference
[][][]

Installation

npm install react-ascii-ui

Usage

import { AsciiInput } from 'react-ascii-ui';

export default function Example() {
  const [value, setValue] = useState('');
  
  return (
    <AsciiInput
      placeholder="Enter text..."
      value={value}
      onChange={(e) => setValue(e.target.value)}
    />
  );
}

Examples

Default

[]
<AsciiInput placeholder="Enter text..." />

Password

[]
<AsciiInput type="password" placeholder="Enter password..." />

Controlled

[]
const [value, setValue] = useState('');

<AsciiInput 
  value={value}
  onChange={(e) => setValue(e.target.value)}
/>

API Reference

Props

PropTypeDefaultDescription
valuestring-The controlled value of the input
defaultValuestring-The default value for uncontrolled usage
placeholderstring-Placeholder text when input is empty
typestringtextHTML input type (text, password, email, etc.)
disabledbooleanfalseWhether the input is disabled
onChangefunction-Function called when input value changes
classNamestring-Additional CSS classes

AsciiInput extends all HTML input attributes and React.InputHTMLAttributes.