import { Canvas, Meta, ArgTypes } from '@storybook/blocks';
import { ThemeProvider } from 'styled-components';

import Flex from '../Flex';
import RadioGroup from './';
import { lightTheme } from '../../../theme/';
import { GlobalStyles } from '../../../theme/GlobalStyles';
import * as RadioGroupStories from './RadioGroup.stories.tsx';

<Meta of={RadioGroupStories} />

# RadioGroup

The Radio component allows the user to choose only one of a predefined set of mutually exclusive options.

## Importing

```javascript
import { RadioGroup } from 'amazon-chime-sdk-component-library-react';
```

## Example

<ThemeProvider theme={lightTheme}>
  <GlobalStyles />
  <Canvas>
    <Flex layout="fill-space-centered">
      <RadioGroup
        options={[
          { value: 'bananas', label: 'Bananas' },
          { value: 'monkeynuts', label: 'Monkeynuts' },
          { value: 'grapes', label: 'Grapes' },
        ]}
        value="monkeynuts"
        onChange={() => {}}
      />
    </Flex>
  </Canvas>
</ThemeProvider>

```jsx
<Flex layout="fill-space-centered">
  <RadioGroup
    options={[
      { value: 'bananas', label: 'Bananas' },
      { value: 'monkeynuts', label: 'Monkeynuts' },
      { value: 'grapes', label: 'Grapes' },
    ]}
    value="monkeynuts"
    onChange={() => {}}
  />
</Flex>
```

## Props

<ArgTypes of={RadioGroup} />
