fix(ui): make Checkbox children optional with a11y warning

Made children optional and only render the label wrapper div when
children are provided. When used without children, a dev warning is
shown if no aria-label or aria-labelledby is set.

Signed-off-by: Johan Persson <johanopersson@gmail.com>
This commit is contained in:
Johan Persson
2026-03-17 12:02:49 +01:00
parent e9eb585978
commit a6b84e13ec
4 changed files with 21 additions and 4 deletions
@@ -0,0 +1,7 @@
---
'@backstage/ui': patch
---
Made Checkbox `children` optional and added a dev warning when neither a visible label, `aria-label`, nor `aria-labelledby` is provided. The label wrapper div is no longer rendered when there are no children, removing the unnecessary gap.
**Affected components:** Checkbox