npm.io
11.7.3 • Published 1 month ago

@instructure/ui-text-input

Licence
MIT
Version
11.7.3
Deps
9
Size
355 kB
Vulns
0
Weekly
0
Stars
478

ui-text-input

npm MIT License Code of Conduct

A styled HTML text input component.

Components

The ui-text-input package contains the following:

Installation
npm install @instructure/ui-text-input
Usage
class ControlledTextInputExample extends React.Component {
  constructor(props) {
    super(props)

    this.state = {
      value: 'Mint chocolate chip'
    }
  }

  handleChange = (e, value) => this.setState({ value })

  render() {
    return (
      <View as="div">
        <TextInput
          renderLabel="What is your favorite ice cream flavor?"
          value={this.state.value}
          onChange={this.handleChange}
        />
        <View as="div" margin="medium none none">
          <code>this.state.value = {this.state.value}</code>
        </View>
      </View>
    )
  }
}

render(<ControlledTextInputExample />)