Skip to content

Latest commit

 

History

History
49 lines (41 loc) · 1.64 KB

File metadata and controls

49 lines (41 loc) · 1.64 KB

TextInput

Properties

Property Type Description
background string, bool Sets the background color of a component, if bool, the color will be used as the background color.
color string Sets the main color of a component and it's children.
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.
theme string Sets the UI theme that is used by this component and its children elements.
Property value "light", "dark"
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/windows';

export default class extends Component {
  static defaultProps = {
    color: '#cc7f29',
    theme: 'dark'
  };

  change = () => console.log(this.refs.input.value);

  render() {
    return (
      <TextInput
        ref="input"
        theme={this.props.theme}
        color={this.props.color}
        background
        label="My Input"
        placeholder="My Input"
        defaultValue="Hello!"
        onChange={this.change}
      />
    );
  }
}