ToggleButton.Row

Toggle button row renders a group of toggle buttons in a row.

Usage

import * as React from 'react';
import { View } from 'react-native';
import { ToggleButton } from 'react-native-paper';

export default class MyComponent extends React.Component {
  state = {
    value: 'left',
  };

  render() {
    return(
      <ToggleButton.Row
        onValueChange={value => this.setState({ value })}
        value={this.state.value}
      >
          <ToggleButton icon="format-align-left" value="left" />
          <ToggleButton icon="format-align-right" value="right" />
      </ToggleButton.Row>
    )
  }
}

Props

onValueChange (required)
Type: (value: string) => void

Function to execute on selection change.

value (required)
Type: string

Value of the currently selected toggle button.

children (required)
Type: React.ReactNode

React elements containing toggle buttons.

style
Type: StyleProp<ViewStyle>