# mui-segmented-control

> A plugin for https://github.com/mui-org/material-ui that creates a segmented control component

Latest version **1.1.6** (published 2019-07-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install mui-segmented-control
pnpm add mui-segmented-control
yarn add mui-segmented-control
bun add mui-segmented-control
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.6 |
| Published | 2019-07-12 |
| First published | 2019-05-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 15.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Getapper |
| Maintainers | antoniogiordano |
| Keywords | mui, material, ui, segmented, control, component, react, hooks |

## Links

- npm: https://www.npmjs.com/package/mui-segmented-control
- Repository: https://github.com/getapper/mui-segmented-control
- Homepage: https://github.com/getapper/mui-segmented-control#readme
- Issues: https://github.com/getapper/mui-segmented-control/issues
- npm.io page: https://npm.io/package/mui-segmented-control

## Dependencies (2)

- [classnames](https://npm.io/package/classnames.md) ^2.2.6
- [prop-types](https://npm.io/package/prop-types.md) ^15.7.2

## Alternatives

- [@progress/kendo-ooxml](https://npm.io/package/@progress/kendo-ooxml.md) — 152.1K weekly downloads
- [@progress/kendo-react-ripple](https://npm.io/package/@progress/kendo-react-ripple.md) — 8.0K weekly downloads
- [@progress/kendo-react-orgchart](https://npm.io/package/@progress/kendo-react-orgchart.md) — 4.3K weekly downloads
- [@praxisui/dynamic-fields](https://npm.io/package/@praxisui/dynamic-fields.md) — 2.4K weekly downloads
- [@mesalvo/react-ui](https://npm.io/package/@mesalvo/react-ui.md) — 1.7K weekly downloads

## Recent versions

- 1.1.6 (latest) — 2019-07-12
- 1.1.5 — 2019-07-12
- 1.1.4 — 2019-07-12
- 1.1.3 — 2019-07-12
- 1.1.2 — 2019-07-12
- 1.1.1 — 2019-07-12
- 1.1.0 — 2019-07-12
- 1.0.2 — 2019-05-21
- 1.0.1 — 2019-05-21
- 1.0.0 — 2019-05-21

## README

# Material UI - Segmented Control

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

## Demo

[![Edit magical-poitras-685c4](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/magical-poitras-685c4?fontsize=14)

## Install 

```sh
npm install mui-segmented-control
```

## Usage

```jsx
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

| Prop  | Description | Default value |
| --- | ------ | --- |
| buttonProps | props injected to the button component | {} |
| classes | classes object for custom styling | {} |
| color | Selector color ['primary', 'secondary'] | 'primary'
| onChange | callback to handle option click | () => null
| options | options array of objects in the form: {label, value} | []
| value | selected value that will be shown in the component | null

---
_Source: https://npm.io/package/mui-segmented-control · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
