rax-switch
TypeScript icon, indicating that this package has built-in type declarations

0.6.5 • Public • Published

rax-switch npm

Renders a boolean input.

Install

$ npm install rax-switch --save

Import

import Switch from 'rax-switch';

Example

import {createElement, Component, render} from 'rax';
import View from 'rax-view';
import Text from 'rax-text';
import Switch from '../../../packages/rax-switch';
 
class App extends Component {
  state = {
    toggle: true,
  }
  render() {
    return (
      <View>
        <Switch 
          value={this.state.open}
          onValueChange={(value) => {
            this.setState({toggle: value});
          }}
        />
        <Text>{String(this.state.toggle)}</Text>
      </View>
    );
  }
}
 
render(<App />);

/rax-switch/

    Package Sidebar

    Install

    npm i rax-switch

    Weekly Downloads

    6

    Version

    0.6.5

    License

    BSD-3-Clause

    Unpacked Size

    110 kB

    Total Files

    16

    Last publish

    Collaborators

    • zeroling
    • wintercn
    • yuanyan
    • yacheng
    • recover758126