@grafana/ui: Update RadioButtonGroup documentation (#23143)

* 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>
This commit is contained in:
Jess 2020-05-14 10:51:14 +02:00 committed by GitHub
parent c066c6047e
commit f1386c7892
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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