1.1.6 • Published 5 years ago

mui-segmented-control v1.1.6

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Material UI - Segmented Control

A MUI component made with hooks compatible with MUI >= 4.0.0

Demo

Edit magical-poitras-685c4

Install

npm install mui-segmented-control

Usage

import React, { useState } from 'react';
import SegmentedControl from 'mui-segmented-control';

function App() {
  const [value, setValue] = useState();

  return (
    <div>
      <SegmentedControl
        color="primary"
        options={[
          {
            label: 'First',
            value: 1
          },
          {
            label: 'Second',
            value: 2
          },
          {
            label: 'Third',
            value: 3
          },
          {
            label: 'Fourth',
            value: 4
          }
        ]}
        value={value}
        onChange={setValue}
      />
    </div>
  );
}

Props

PropDescriptionDefault value
buttonPropsprops injected to the button component{}
classesclasses object for custom styling{}
colorSelector color 'primary', 'secondary''primary'
onChangecallback to handle option click() => null
optionsoptions array of objects in the form: {label, value}[]
valueselected value that will be shown in the componentnull
1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago