Skip to content

[Checkbox] Feature enhancements and styling fixes #604

@ravisuhag

Description

@ravisuhag

Summary

Improvements to the Checkbox component. Migrated to Base UI with Group support. Some accessibility and feature enhancements remain.

Completed

  • CheckboxGroup component — Implemented using @base-ui/react/checkbox-group with forwardRef
  • Add 'use client' directive — Present
  • Forward ref — Both CheckboxGroup and CheckboxItem use forwardRef
  • Indeterminate state — Supported with dedicated icon
  • Disabled state styling[data-disabled] styles present
  • API migration — Fully migrated to @base-ui/react/checkbox

Remaining Improvements

Accessibility

1. No focus-visible ring

The checkbox has no visible focus indicator for keyboard navigation — should add :focus-visible outline in checkbox.module.css.

2. No readOnly styling

Base UI supports readOnly and adds data-readonly, but the CSS has no corresponding rule.

3. No required / invalid styling

No CSS for data-required or data-invalid states for form validation.

4. Disabled + checked/indeterminate hover bug

The disabled hover rule resets background to primary, which visually "unchecks" a disabled-checked checkbox on hover.

5. Indeterminate hover has no feedback

The indeterminate hover state has identical styles to non-hover, making hover invisible.

Features

6. No size variants

Fixed size (--rs-space-5 / 16px). Consider adding size variants.

7. Custom icon props (checkedIcon / indeterminateIcon)

Icons are hardcoded with no way to override.

8. Forward parent prop

Base UI supports parent for parent-child checkbox group patterns. Not exposed.

9. Forward inputRef prop

Base UI exposes inputRef for form integration. Not exposed.

10. CheckboxGroup orientation prop

Support orientation="vertical" | "horizontal" for layout control.

Moved to Cross-Cutting Issues

The following items have been moved to cross-cutting issues that address them across all components:

Files

  • packages/raystack/components/checkbox/

Metadata

Metadata

Assignees

No one assigned

    Labels

    componentIndividual component-level issueenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions