A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode,DeepSeek Harness and more. Only official website: ccswitch.io
Rust ai-toolsclaude-codecodexdeepseek-harnessdesktop-appgrokgrokbuildhermeskimi-codemcpopen-sourceopencodepiprovider-managementrustskillsskills-managementtauriwsl-support
import * as React from "react";
import { cn } from "@/lib/utils";
type CheckedState = boolean | "indeterminate";
interface CheckboxProps
extends Omit<
React.InputHTMLAttributes<HTMLInputElement>,
"checked" | "type"
> {
checked?: CheckedState;
onCheckedChange?: (checked: boolean) => void;
}
const Checkbox = React.forwardRef<HTMLInputElement, CheckboxProps>(
(
{
className,
checked,
onChange,
onCheckedChange,
"aria-checked": ariaChecked,
...props
},
ref,
) => {
const inputRef = React.useRef<HTMLInputElement>(null);
const isIndeterminate = checked === "indeterminate";
React.useImperativeHandle(ref, () => inputRef.current as HTMLInputElement);
React.useLayoutEffect(() => {
if (inputRef.current) {
inputRef.current.indeterminate = isIndeterminate;
}
});
return (
<input
{...props}
ref={inputRef}
type="checkbox"
checked={isIndeterminate ? false : checked}
aria-checked={isIndeterminate ? "mixed" : ariaChecked}
onChange={(event) => {
onChange?.(event);
onCheckedChange?.(event.target.checked);
}}
className={cn("ui-checkbox", className)}
/>
);
},
);
Checkbox.displayName = "Checkbox";
export { Checkbox };
export type { CheckboxProps, CheckedState };