Input

This is the Input component, used to capture user text or data entry. It supports various types and can be configured for different use cases.

Usage

To use the Input component, import it and include it in your markup:

<label for="input-example">Example Input:</label>
<input id="input-example" type="text" class="oui-input" placeholder="Enter text here" />

Props

The Input component accepts the following props:

PropTypeDescription
typestringThe input type: text, email, password, number, etc.
valuestringThe current value of the input.
placeholderstringPlaceholder text to display when the input is empty.
disabledbooleanDisables the input if set to true.
readonlybooleanMakes the input read-only if set to true.
requiredbooleanMarks the input as required.
autofocusbooleanAutomatically focuses the input on mount.
namestringName of the input, submitted with form data.
formstringAssociates the input with a form element by ID.
minlengthnumberMinimum number of characters allowed.
maxlengthnumberMaximum number of characters allowed.
patternstringRegex pattern the input’s value must match.
tabindexnumberSpecifies the tab order of the input.
aria-*stringARIA attributes for accessibility.
classstringCSS class names to apply to the input.
idstringThe unique identifier for the input element.