index.d.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132
  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 PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;
  5. export interface FocusScopeProps extends PrimitiveDivProps {
  6. /**
  7. * When `true`, tabbing from last item will focus first tabbable
  8. * and shift+tab from first item will focus last tababble.
  9. * @defaultValue false
  10. */
  11. loop?: boolean;
  12. /**
  13. * When `true`, focus cannot escape the focus scope via keyboard,
  14. * pointer, or a programmatic focus.
  15. * @defaultValue false
  16. */
  17. trapped?: boolean;
  18. /**
  19. * Event handler called when auto-focusing on mount.
  20. * Can be prevented.
  21. */
  22. onMountAutoFocus?: (event: Event) => void;
  23. /**
  24. * Event handler called when auto-focusing on unmount.
  25. * Can be prevented.
  26. */
  27. onUnmountAutoFocus?: (event: Event) => void;
  28. }
  29. export const FocusScope: React.ForwardRefExoticComponent<FocusScopeProps & React.RefAttributes<HTMLDivElement>>;
  30. export const Root: React.ForwardRefExoticComponent<FocusScopeProps & React.RefAttributes<HTMLDivElement>>;
  31. //# sourceMappingURL=index.d.ts.map