Sorry, but you either have no stories or none are selected somehow.
If the problem persists, check the browser console, or the terminal you've run Storybook from.
The component failed to render properly, likely due to a configuration issue in Storybook. Here are some common causes and how you can address them:
RadioButtonGroup
is used to select a single value from multiple mutually exclusive options.
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.
import { RadioButtonGroup } from '@grafana/ui'; <RadioButtonGroup options={...} value={...} onChange={...} />
To disable some options pass those options to the RadioButtonGroup
via disabledOptions
property:
const options = [ { label: 'Prometheus', value: 'prometheus' }, { label: 'Graphite', value: 'graphite' }, { label: 'Elastic', value: 'elastic' }, { label: 'InfluxDB', value: 'influx' }, ]; const disabledOptions = ['prometheus', 'elastic']; <RadioButtonGroup options={options} disabledOptions={disabledOptions} value={...} onChange={...} />
Name | Description | Default |
---|---|---|
value | T | - |
id | string | - |
disabled | boolean | - |
disabledOptions | T[] | - |
options* | SelectableValue<T>[] | - |
onChange | ((value: T) => void) | - |
onClick | ((value: T) => void) | - |
size | "sm""md" | "md" |
fullWidth | boolean | false |
className | string | - |
autoFocus | boolean | false |
aria-label | string | - |
invalid | boolean | false |