UNPKG

@madeja-studio/telar

Version:

UI component library by Madeja Studio

27 lines 922 B
/** * Custom hook to manage keyboard state in a React Native application. * * Monitors the keyboard's visibility and height, updating the state accordingly. * * The code is directly extracted from the 10tap-editor repository: * @link https://github.com/10play/10tap-editor/blob/main/src/utils/useKeyboard.tsx * * @return Object containing the keyboard visibility state and height. * @property isKeyboardUp - Whether the keyboard is currently visible. * @property keyboardHeight - The height of the keyboard when it is visible. * * @example * const { isKeyboardUp, keyboardHeight } = useKeyboard(); * * return ( * <View style={{ flex: 1, marginBottom: isKeyboardUp ? keyboardHeight : 0 }}> * <TextInput placeholder="Type here..." /> * </View> * ); * */ export declare const useKeyboard: () => { isKeyboardUp: boolean; keyboardHeight: number; }; //# sourceMappingURL=useKeyboard.d.ts.map