Skip to content

Latest commit

 

History

History
37 lines (30 loc) · 1.09 KB

text-input.md

File metadata and controls

37 lines (30 loc) · 1.09 KB

TextInput

Properties

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.

Examples

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}
      />
    );
  }
}