PhoneNumberField

Used to provide a phone number. Uses a number keypad on mobile devices and restricts keyboard input to Space, Backspace, Shift, Left, Right, Up, Down, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, +, -

States

Alert
<SpacedGroup direction="vertical">
    <PhoneNumberField hintText="Default" stretch />
    <PhoneNumberField hintText="Dirty" dirty stretch />
    <PhoneNumberField hintText="Disabled" disabled stretch />
    <PhoneNumberField hintText="Focused" stretch focused />
    <PhoneNumberField hintText="Error" error="invalid value" stretch />
  
</Playground>

Prepending/Appending Items

item
item
Home
item
item
Home
<SpacedGroup direction="vertical">
    <PhoneNumberField prependIcon="item" />
    <FormControlLabel
      stretch
      label="with a label"
      control={<PhoneNumberField prependIcon="item" stretch />}
    />
    <PhoneNumberField fullWidth prependIcon="item" />
    <PhoneNumberField fullWidth prependIcon={<HomeIcon />} />
    <PhoneNumberField fullWidth prependIcon="item" multiline />
    <PhoneNumberField fullWidth appendIcon="item" />
    <PhoneNumberField fullWidth appendIcon={<HomeIcon />} />
  
</Playground>

Layout

<SpacedGroup direction="vertical">
    <FormControlLabel
      stretch
      label="with a label"
      control={<PhoneNumberField hintText="default" />}
    />
    <FormControlLabel
      stretch
      label="with a label"
      control={<PhoneNumberField hintText="fullWidth" fullWidth />}
    />
    <FormControlLabel
      stretch
      label="with a label"
      control={<PhoneNumberField hintText="stretch" stretch />}
    />
  
</Playground>

InlineEdit

Edit
Edit
Alert
Loading Spin
Check
<SpacedGroup direction="vertical">
    <PhoneNumberField hintText="Default" inlineEdit />
    <PhoneNumberField hintText="Disabled" inlineEdit disabled />
    <PhoneNumberField hintText="Dirty" inlineEdit dirty />
    <PhoneNumberField
      hintText="Error"
      inlineEdit
      error="You really screwed the pooch"
    />
    <PhoneNumberField hintText="Loading" inlineEdit loading />
    <PhoneNumberField hintText="Success" inlineEdit success />
  
</Playground>

Stateful

() => {
  class StateManager extends React.Component {
    constructor(props, context) {
      super(props, context)
      this.state = { value: '' }
      this.handleChange = this.handleChange.bind(this)
    }
    handleChange(event, value) {
      this.setState({ value })
    }
    render() {
      return (
        <PhoneNumberField
          focsued
          value={this.state.value}
          onChange={this.handleChange}
        />
      )
    }
  }
  return <StateManager />
}

API