77 CheckboxIndeterminateIndicator ,
88 CheckboxIndicator ,
99 CheckboxLabel ,
10+ type CheckboxLabelSizing ,
1011} from "../../elements/checkbox" ;
1112
1213export type CheckboxProps = Omit < BaseCheckbox . Root . Props , "className" | "style" | "render" > & {
@@ -16,6 +17,8 @@ export type CheckboxProps = Omit<BaseCheckbox.Root.Props, "className" | "style"
1617 * or `aria-labelledby`.
1718 */
1819 label ?: React . ReactNode ;
20+ /** Width of the clickable label row when `label` is present. */
21+ sizing ?: CheckboxLabelSizing ;
1922 /**
2023 * Element shown between the box and the label (inline-start), e.g. `<Icon icon={User}
2124 * tint="secondary" magnitude="sm" />`. Only rendered when `label` is present.
@@ -28,7 +31,7 @@ export type CheckboxProps = Omit<BaseCheckbox.Root.Props, "className" | "style"
2831 * check and indeterminate indicators, and optionally wraps the row in a clickable `CheckboxLabel`
2932 * with an icon slot.
3033 */
31- export function Checkbox ( { label, icon, id, ...props } : CheckboxProps ) {
34+ export function Checkbox ( { label, sizing , icon, id, ...props } : CheckboxProps ) {
3235 // Generate a stable id so an explicit `label` can be associated with the box.
3336 const generatedId = React . useId ( ) ;
3437 const checkboxId = id ?? generatedId ;
@@ -49,7 +52,7 @@ export function Checkbox({ label, icon, id, ...props }: CheckboxProps) {
4952 if ( label == null ) return box ;
5053
5154 return (
52- < CheckboxLabel htmlFor = { checkboxId } >
55+ < CheckboxLabel htmlFor = { checkboxId } sizing = { sizing } >
5356 { box }
5457 { icon }
5558 { label }
0 commit comments