Toolbar
Beta

Checkbox

The FktCheckbox component provides a clean and accessible checkbox input with custom styling. Built with Angular signals and reactive forms, it offers seamless integration with form validation and state management.

Import

import {FktCheckboxComponent} from "frakton-ng/checkbox";

Basic checkbox

A basic checkbox with label text. Click either the checkbox or the label to toggle the state.

Pre checked checkbox

A checkbox that is initially checked. The control is initialized with true as the default value.

Disabled state

A checkbox in disabled state. The checkbox cannot be toggled and appears with reduced opacity.

Validation

A checkbox with required validation. The checkbox must be checked for the form to be valid, and shows error state when invalid.

Checkbox Validation Example

@for (error of form.termsAccepted().errors(); track error.kind) { }

Form is {{ form().valid() ? 'valid' : 'invalid' }}

Terms accepted: {{ form.termsAccepted().value() ? 'Yes' : 'No' }}

Newsletter subscription: {{ form.newsletterSubscription().value() ? 'Yes' : 'No' }}

Checkbox

Key Features

  • Custom Styling: Beautiful, consistent checkbox design that works across all browsers
  • Form Integration: Seamless integration with SignalFormControl and reactive forms
  • Accessibility: Full ARIA support and keyboard navigation
  • Label Support: Built-in label association and click-to-toggle functionality
  • Validation States: Visual feedback for form validation errors
  • Responsive Design: Works perfectly on desktop and mobile devices
  • Signal-Based: Built with Angular signals for optimal performance

Configuration Options

Use Cases

Terms and Conditions

Perfect for legal agreements and policy acceptance:

  • Terms of service acceptance
  • Privacy policy agreement
  • Cookie consent
  • Age verification

User Preferences

Ideal for settings and preference screens:

  • Notification preferences
  • Feature toggles
  • Privacy settings
  • Display options

Multi-Selection

Great for allowing multiple choices:

  • Filter options
  • Category selection
  • Feature selection
  • Permission settings

Form Validation

Essential for required confirmations:

  • Required field acknowledgment
  • Data processing consent
  • Marketing opt-in/out
  • Confirmation checkboxes

Accessibility

  • Keyboard Navigation: Full keyboard support with Tab and Space key
  • Screen Reader Support: Proper ARIA labels and state announcements
  • Label Association: Clicking the label toggles the checkbox
  • Focus Indicators: Clear visual focus states for keyboard navigation
  • High Contrast: Supports system high contrast modes
  • State Communication: Checked/unchecked states clearly communicated