index.d.mts 962 B

123456789101112131415161718192021222324
  1. import * as React from "react";
  2. import * as Radix from "@radix-ui/react-primitive";
  3. import { Primitive } from "@radix-ui/react-primitive";
  4. type PrimitiveButtonProps = Radix.ComponentPropsWithoutRef<typeof Primitive.button>;
  5. export interface ToggleProps extends PrimitiveButtonProps {
  6. /**
  7. * The controlled state of the toggle.
  8. */
  9. pressed?: boolean;
  10. /**
  11. * The state of the toggle when initially rendered. Use `defaultPressed`
  12. * if you do not need to control the state of the toggle.
  13. * @defaultValue false
  14. */
  15. defaultPressed?: boolean;
  16. /**
  17. * The callback that fires when the state of the toggle changes.
  18. */
  19. onPressedChange?(pressed: boolean): void;
  20. }
  21. export const Toggle: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLButtonElement>>;
  22. export const Root: React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLButtonElement>>;
  23. //# sourceMappingURL=index.d.ts.map