yarcl
    Preparing search index...

    Type Alias ToggleGroupProps

    ToggleGroupProps: ToggleGroupBaseProps & (
        | {
            defaultValue?: string
            | null;
            onValueChange?: (value: string | null) => void;
            required?: boolean;
            type: "single";
            value?: string | null;
        }
        | {
            defaultValue?: string[];
            onValueChange?: (value: string[]) => void;
            required?: never;
            type: "multiple";
            value?: string[];
        }
    )

    Props for ToggleGroup. type decides whether one or many items can be on.

    Type Declaration

    • {
          defaultValue?: string | null;
          onValueChange?: (value: string | null) => void;
          required?: boolean;
          type: "single";
          value?: string | null;
      }
      • OptionaldefaultValue?: string | null

        Initially selected value when uncontrolled.

      • OptionalonValueChange?: (value: string | null) => void

        Called with the selected value, or null when the selected item is turned off.

      • Optionalrequired?: boolean

        Prevents turning the selected item off, so one is always on.

      • type: "single"

        One item on at a time, like a segmented control.

      • Optionalvalue?: string | null

        Controlled selected value.

    • {
          defaultValue?: string[];
          onValueChange?: (value: string[]) => void;
          required?: never;
          type: "multiple";
          value?: string[];
      }
      • OptionaldefaultValue?: string[]

        Initially selected values when uncontrolled.

      • OptionalonValueChange?: (value: string[]) => void

        Called with all selected values.

      • Optionalrequired?: never
      • type: "multiple"

        Any number of items on, like formatting buttons.

      • Optionalvalue?: string[]

        Controlled selected values.