Toolbar
Beta

Button group

Group related actions into toggleable buttons with support for icons, shapes, and multi-select workflows.

Import

import {FktButtonGroupComponent} from "frakton-ng/button-group";

Basic usage

Single-select group with labeled icons and a predefined selection.

Multiple

Multi-select mode allowing several options to be active simultaneously; value is an array of selected ids.

Shapes

Compare rounded, rectangular, and flat shapes while keeping the same options.

@for (variant of variants; track variant.label) {
	{{ variant.label }}
	
}

Sizes

Demonstrates how the control scales across the available size tokens.

@for (variant of variants; track variant.label) {
	{{ variant.label }}
	
}

Orientations

Compares horizontal and vertical layouts. Arrow key navigation adapts automatically: left/right for horizontal, up/down for vertical.

@for (variant of variants; track variant.label) {
	{{ variant.label }}
	
}

Only labels

Text-only buttons without icons for compact layouts.

@for (variant of variants; track variant.label) {
	{{ variant.label }}
	
}

Only icons

Icon-only presentation with labels hidden for minimal UI.

@for (variant of variants; track variant.label) {
	{{ variant.label }}
	
}

Reactive forms

Integration with Angular Reactive Forms via formControl. Demonstrates Validators.required, error display tied to control status, and toggling the disabled state programmatically.

Signal forms

Integration with the signal-based @angular/forms/signals API via the [formField] binding. Shows required validation, signal-driven disabled state, and reactive error messages.

Input driven

Manual signal-driven binding using [(value)] and [(touched)] two-way models without a form abstraction. Validation and error display are handled directly in the template.

Button group

Key Features

  • Single- or multi-select toggle group with optional deselection support
  • Icon, label, and icon-only presentations per option via hideLabel
  • Shape variants (rounded, rect, flat) and size scale (xs–xl) to match any layout
  • Form-friendly: implements ControlValueAccessor and signal-based FormValueControl
  • Native button semantics with automatic aria-label from option labels
  • Disabled state that locks the entire group for consistent UX
  • Signal-driven rendering for responsive, performant updates
  • Works with design tokens for spacing, sizing, and icon alignment

Configuration Options

Types

export type FktButtonGroupShape = 'rounded' | 'rect' | 'flat';
export type FktButtonGroupSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';

export interface FktButtonGroupOption {
    id: string;
    label: string;
    hideLabel?: boolean;
    icon?: FktIconName;
}

Accessibility

  • Uses native <button> elements for built-in keyboard and focus handling
  • aria-label mirrors the option label, keeping icon-only states screen-reader friendly
  • disabled prevents focus and interaction, matching native button behavior
  • Pair touched with form validation to announce errors after interaction
  • Preserve meaningful labels even when visually hidden with hideLabel

Usage

  • Single-select is ideal for mutually exclusive modes (e.g., list vs. grid); enable multiple for tag-like filters
  • Bind value to a string or string[] depending on selection mode; set deselectable to let users clear choices
  • Choose shapes and sizes that align with nearby controls to avoid visual jumps
  • Keep icons consistent across options; hide labels only when space is tight and the icon meaning is clear