Files

17 lines
725 B
TypeScript

"use client";
import React from "react";
import { Checkbox as CheckboxComponent, type CheckboxRootProps } from "./Checkbox";
/**
* Add wrapper components and business logic here.
* If you modify this file, disable Subframe sync for it to prevent overwrites.
* Learn more: https://docs.subframe.com/concepts/syncing-components#wrapping-components
*/
export const Checkbox = React.forwardRef<HTMLButtonElement, CheckboxRootProps>(function Checkbox(props, ref) {
const accessibleLabel =
props["aria-label"] ?? (props["aria-labelledby"] ? undefined : props.hideLabel && typeof props.label === "string" ? props.label : undefined);
return <CheckboxComponent {...props} aria-label={accessibleLabel} ref={ref} />;
});