@navikt/ds-react
Version:
React components from the Norwegian Labour and Welfare Administration.
25 lines (24 loc) • 768 B
TypeScript
import { CheckboxProps } from "./types";
/**
* Handles props for Checkboxes in context with Fieldset and CheckboxGroup
*/
declare const useCheckbox: (props: CheckboxProps) => {
readOnly: boolean | undefined;
nested: boolean;
inputProps: {
checked: boolean | undefined;
defaultChecked: boolean | undefined;
onChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
onClick: (event: React.MouseEvent<HTMLInputElement>) => void;
id: string;
"aria-invalid"?: boolean;
"aria-describedby"?: string;
disabled?: boolean;
};
showErrorMsg: boolean;
hasError: boolean;
errorId: string;
inputDescriptionId: string;
size: "small" | "medium";
};
export default useCheckbox;