package.dist.components.toggle.use-toggle.d.ts Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of react Show documentation
Show all versions of react Show documentation
A collection of unstyled, accessible UI components for React, utilizing state machines for seamless interaction.
The newest version!
export interface UseToggleProps {
/**
* Whether the toggle is disabled.
*/
disabled?: boolean;
/**
* The default pressed state of the toggle.
*/
defaultPressed?: boolean;
/**
* The pressed state of the toggle.
*/
pressed?: boolean;
/**
* Event handler called when the pressed state of the toggle changes.
*/
onPressedChange?: (pressed: boolean) => void;
}
export interface UseToggleReturn {
/**
* Whether the toggle is pressed.
*/
pressed: boolean;
/**
* Whether the toggle is disabled.
*/
disabled: boolean;
/**
* Sets the pressed state of the toggle.
*/
setPressed(pressed: boolean): void;
getRootProps(): React.ComponentProps<'button'>;
getIndicatorProps(): React.ComponentProps<'div'>;
}
export declare function useToggle(props: UseToggleProps): UseToggleReturn;
© 2015 - 2025 Weber Informatics LLC | Privacy Policy