@s-ui/react-molecule-input-field
Version:
`MoleculeInputField` is a component that wraps a composition of Label + Textarea + Validation Messages.
95 lines (71 loc) • 2.68 kB
Markdown
# MoleculeInputField
`MoleculeInputField` is a component that wraps a composition of Label + Textarea + Validation Messages.
[](https://sui-components.vercel.app/workbench/molecule/inputField/)
[](https://github.com/SUI-Components/sui-components/issues/new?&projects=4&template=bug-report.yml&assignees=&template=report-a-bug.yml&title=🪲+&labels=bug,component,molecule,inputField)
[](https://www.npmjs.com/package/@s-ui/react-molecule-input-field)
[](https://github.com/SUI-Components/sui-components/issues?q=is%3Aopen+label%3Acomponent+label%3AinputField)
[](https://github.com/SUI-Components/sui-components/blob/main/components/molecule/inputField/LICENSE.md)
## Installation
```sh
$ npm install @s-ui/react-molecule-input-field --save
```
## Usage
After importing the component `MoleculeInputField` like this
```javascript
import MoleculeInputField from '@s-ui/react-molecule-input-field'
```
### Basic usage
```javascript
<MoleculeInputField
id="second"
placeholder="Medium Input"
leftAddon="http://"
rightAddon="@schibsted.com"
label="Description"
value="In some place of La Mancha which name..."
/>
```
### With `successText`
```javascript
<MoleculeInputField
id="description2"
label="Description"
value="In some place of La Mancha which name..."
successText="Everything ok!"
/>
```
### With `errorText`
```javascript
<MoleculeInputField
id="notes"
label="Notes"
errorText="All wrong!"
/>
```
### With `alertText`
```javascript
<MoleculeInputField
id="notes"
label="Notes"
alertText="All wrong!"
/>
```
### With `helpText`
```javascript
<MoleculeInputField
id="description-inline2"
label="Description"
helpText="Tu descripción en Latin"
value="Lorem ipsum dolor sit amet"
/>
```
### Inline
```javascript
<MoleculeInputField
id="description"
label="Description"
value="In some place of La Mancha which name..."
inline
/>
```
> **Find full description and more examples in the [demo page](https://sui-components.now.sh/workbench/molecule/inputField/demo).**