From f1386c78929595a99ba28a39449a4350a908a186 Mon Sep 17 00:00:00 2001 From: Jess <53754871+jessover9000@users.noreply.github.com> Date: Thu, 14 May 2020 10:51:14 +0200 Subject: [PATCH] @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 --- .../Forms/RadioButtonGroup/RadioButtonGroup.mdx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/grafana-ui/src/components/Forms/RadioButtonGroup/RadioButtonGroup.mdx b/packages/grafana-ui/src/components/Forms/RadioButtonGroup/RadioButtonGroup.mdx index 9b25a980590..021ca405a7d 100644 --- a/packages/grafana-ui/src/components/Forms/RadioButtonGroup/RadioButtonGroup.mdx +++ b/packages/grafana-ui/src/components/Forms/RadioButtonGroup/RadioButtonGroup.mdx @@ -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