@hmiproject/helio-sdk
    Preparing search index...

    Function ButtonGroup

    • Component that displays a group of toggleable buttons, using the currently active HELIO theme. Supports activating a single value or multiple values at once via the type prop.

      Type Parameters

      • ValueType extends string

      Parameters

      • props:
            | {
                ariaLabel?: string;
                disabled?: boolean;
                options: readonly ButtonGroupOptionType<ValueType>[];
                stretchItems?: boolean;
            } & {
                type: "single";
                value?: ValueType;
                onValueChange(value: ValueType): void;
            }
            | {
                ariaLabel?: string;
                disabled?: boolean;
                options: readonly ButtonGroupOptionType<ValueType>[];
                stretchItems?: boolean;
            } & {
                type: "multiple";
                value?: ValueType[];
                onValueChange(value: ValueType[]): void;
            }
        • {
              ariaLabel?: string;
              disabled?: boolean;
              options: readonly ButtonGroupOptionType<ValueType>[];
              stretchItems?: boolean;
          } & {
              type: "single";
              value?: ValueType;
              onValueChange(value: ValueType): void;
          }
          • OptionalariaLabel?: string

            Provide an accessible name for the group as a whole. Button groups rarely have a visible caption, so setting this is recommended — it tells screen reader users what the buttons collectively control.

            `Text alignment`
            
          • Optionaldisabled?: boolean

            When true, prevents the user from interacting with the button group and all its items.

            false
            
          • options: readonly ButtonGroupOptionType<ValueType>[]

            Buttons to render in the group. Each item must have a unique value.

          • OptionalstretchItems?: boolean

            Stretch the group to fill available space and make items within equal-width.

            false
            
          • type: "single"
          • Optionalvalue?: ValueType

            The controlled value of the active button. Should be used in conjunction with onValueChange.

          • onValueChange: function
        • {
              ariaLabel?: string;
              disabled?: boolean;
              options: readonly ButtonGroupOptionType<ValueType>[];
              stretchItems?: boolean;
          } & {
              type: "multiple";
              value?: ValueType[];
              onValueChange(value: ValueType[]): void;
          }
          • OptionalariaLabel?: string

            Provide an accessible name for the group as a whole. Button groups rarely have a visible caption, so setting this is recommended — it tells screen reader users what the buttons collectively control.

            `Text alignment`
            
          • Optionaldisabled?: boolean

            When true, prevents the user from interacting with the button group and all its items.

            false
            
          • options: readonly ButtonGroupOptionType<ValueType>[]

            Buttons to render in the group. Each item must have a unique value.

          • OptionalstretchItems?: boolean

            Stretch the group to fill available space and make items within equal-width.

            false
            
          • type: "multiple"
          • Optionalvalue?: ValueType[]

            The controlled values of the active buttons. Should be used in conjunction with onValueChange.

          • onValueChange: function

      Returns Element

      1.1.0