index.d.ts 1.4 KB

1234567891011121314151617181920212223242526
  1. import * as React from "react";
  2. import * as Radix from "@radix-ui/react-primitive";
  3. import { Primitive } from "@radix-ui/react-primitive";
  4. export const createCheckboxScope: import("@radix-ui/react-context").CreateScope;
  5. type CheckedState = boolean | 'indeterminate';
  6. type PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;
  7. export interface CheckboxProps extends Omit<PrimitiveButtonProps, 'checked' | 'defaultChecked'> {
  8. checked?: CheckedState;
  9. defaultChecked?: CheckedState;
  10. required?: boolean;
  11. onCheckedChange?(checked: CheckedState): void;
  12. }
  13. export const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLButtonElement>>;
  14. type PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;
  15. export interface CheckboxIndicatorProps extends PrimitiveSpanProps {
  16. /**
  17. * Used to force mounting when more control is needed. Useful when
  18. * controlling animation with React animation libraries.
  19. */
  20. forceMount?: true;
  21. }
  22. export const CheckboxIndicator: React.ForwardRefExoticComponent<CheckboxIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
  23. export const Root: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLButtonElement>>;
  24. export const Indicator: React.ForwardRefExoticComponent<CheckboxIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
  25. //# sourceMappingURL=index.d.ts.map