File size: 1,189 Bytes
1e92f2d | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | # Form Text Input
`<FormTextInput />` is a React component suited for rendering an `<input />` field enhanced with Calypso-specific styling and validity indicators.
## Usage
Render as you would an `<input />` element. Any props passed not included in the props documentation below will be applied to the rendered `<input />` element.
```jsx
export default function MyForm() {
return <FormTextInput isValid initialValue="Hello World!" />;
}
```
## Props
### `isError`
<table>
<tr><td>Type</td><td>Boolean</td></tr>
<tr><td>Required</td><td>No</td></tr>
</table>
Whether the input should be rendered with error styling.
### `isValid`
<table>
<tr><td>Type</td><td>Boolean</td></tr>
<tr><td>Required</td><td>No</td></tr>
</table>
Whether the input should be rendered with valid (success) styling.
### `selectOnFocus`
<table>
<tr><td>Type</td><td>Boolean</td></tr>
<tr><td>Required</td><td>No</td></tr>
</table>
Whether the value should be selected when the input is focused.
### `hasCoreStyles`
<table>
<tr><td>Type</td><td>Boolean</td></tr>
<tr><td>Required</td><td>No</td></tr>
</table>
Whether the input should be styled like a `@wordpress-components` text input.
|