# API of `@koobiq/components/split-button`

Documented on [Split button](https://koobiq.io/en/components/split-button.md). NgModule: `KbqSplitButtonModule`.

## Components

### KbqSplitButton (component)

```ts
@Component({ selector: 'kbq-split-button, [kbq-split-button]' })
class KbqSplitButton extends KbqColorDirective<KbqButtonColor> {
    readonly panelAutoWidth = input<boolean>(false);
    kbqStyle = input<KbqButtonStyleInput | null | undefined>();
    disabled = input<boolean | undefined>();
    readonly color = input<T | null | undefined>();
    get firstDisabled(): boolean;
    get secondDisabled(): boolean;
    get colorClassName(): string;
    setDefaultColor(color: T): void;
}
```

- `[panelAutoWidth]`: `boolean` — Sets the width of the dropdown to the width of the trigger. Default is false
- `[kbqStyle]`: `KbqButtonStyleInput | null | undefined` — Visual style of the split button, propagated to every nested button. A button that sets its own
  `kbqStyle` keeps it.

  Reads back as the resulting host class rather than the value that was set, because the host
  `[class]` binding is what consumes it.
- `[disabled]`: `boolean | undefined` — Whether the split button is disabled. Disabling it disables every nested button; re-enabling it
  leaves buttons that are disabled through their own input untouched.
- `[color]`: `T | null | undefined` — Color of the component. A value set in code holds until the input changes, and the default color is used
  while both are unset or falsy.
- `firstDisabled`: `boolean` — Whether the leading button is disabled.
- `secondDisabled`: `boolean` — Whether the trailing button is disabled. Stays `false` while the split button holds one button.
- `colorClassName`: `string` — current class name of color
- `setDefaultColor()`: `void` — this color will be used as a default value. For example [color]="'' | false | undefined | null".
