Skip to content

Commit

Permalink
@grafana/ui: Update RadioButtonGroup documentation (#23143)
Browse files Browse the repository at this point in the history
* Add "When to use" info to RadioButtonGroup.mdx

* Clarify more clearly when to use 'Select' instead

* Update RadioButtonGroup.mdx

Add line explaining why we want select for more than four options instead of a radio button group

* Update RadioButtonGroup.mdx

remove part about when elements are triggering changes.

Co-authored-by: Tobias Skarhed <tobias.skarhed@gmail.com>
  • Loading branch information
jessover9000 and tskarhed committed May 14, 2020
1 parent c066c60 commit f1386c7
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -5,9 +5,13 @@ import { RadioButtonGroup } from "./RadioButtonGroup";

# RadioButtonGroup

`RadioButtonGroup` is used for selecting single value from multiple options.
`RadioButtonGroup` is used to select a single value from multiple mutually exclusive options.

Use `RadioButtonGroup` if there are up to four options available. Otherwise use Select component.
### When to use

Use `RadioButtonGroup` for mutually exclusive selections if there are up to four options available. This is because the `RadioButtonGroup` cannot have more than one row and should still accommodate small resolutions. For a mutually exclusive selection of more than four options, use `Select` component.

Radio buttons can only exist in this type of group. If you want one single option, it's better to use `Switch` instead. To offer multiple choices within the same group or context which are not mutually exclusive, use `Checkbox` instead.

### Usage

Expand Down

0 comments on commit f1386c7

Please sign in to comment.