Property | Type | Description |
---|---|---|
defaultValue | string | Sets the default value of the input. |
hidden | bool | Sets the visibility of a component. |
label | string | Adds a label to the input. |
margin | string | Sets the outer margin of a component. E.G. "30px 20px" |
onChange | function | Callback function when the input changes. |
placeholder | function | Adds a placeholder to the input. |
value | string | Sets the value of the input. |
width | number | Sets the width of a component. |
import React, { Component } from 'react';
import { TextInput } from 'react-desktop/macOs';
export default class extends Component {
handleChange = e => console.log(e.target.value);
render() {
return (
<TextInput
label="My Input"
placeholder="My Input"
defaultValue=""
onChange={this.handleChange}
/>
);
}
}