1.0.10 • Published 1 year ago

@mountain-ui/react-hooks v1.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@mountain-ui/react-hooks

Prerequisites

Before integrating the @mountain-ui/react-hooks library into your project, ensure that you have the following prerequisites:

  • Node.js: Make sure Node.js is installed on your machine. You can download it from nodejs.org.

Installation

To install and leverage the power of the @mountain-ui/react-hooks library, follow these steps:

  1. Open a terminal window in your project directory.

  2. Run the following command to install the hooks library:

    npm install @mountain-ui/react-hooks
  3. Once installed, you can import and use the hooks in your project.

Usage Example

Here's a simple example demonstrating how to use some of the custom hooks in your React application:

import React from 'react';
import { useBoolean, useDarkMode, useEventListener } from '@mountain-ui/react-hooks';

function App() {
  // Example usage of useBoolean
  const [value, { on, off, toggle }] = useBoolean(false);

  // Example usage of useDarkMode
  const isDarkMode = useDarkMode();

  // Example usage of useEventListener
  useEventListener('DOMContentLoaded', () => {
    console.log('Document Loaded!');
  });

  return (
    <div>
      <p>Boolean Value: {value.toString()}</p>
      <button onClick={toggle}>Toggle</button>
      <button onClick={on}>Set True</button>
      <button onClick={off}>Set False</button>

      <p>Dark Mode: {isDarkMode ? 'Enabled' : 'Disabled'}</p>
    </div>
  );
}

export default App;

Custom Hooks

For detailed information about each custom hook, refer to the sub-pages:

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.7.13

3 years ago

0.7.15

3 years ago

0.7.14

3 years ago

0.7.11

3 years ago

0.7.12

3 years ago

0.7.10

3 years ago

0.7.9

3 years ago

0.7.6

3 years ago

0.7.5

4 years ago

0.7.8

3 years ago

0.7.7

3 years ago

0.7.4

4 years ago

0.7.3

4 years ago

0.5.10

4 years ago

0.5.11

4 years ago

0.5.8

4 years ago

0.5.7

4 years ago

0.5.9

4 years ago

0.5.14

4 years ago

0.5.15

4 years ago

0.5.12

4 years ago

0.5.13

4 years ago

0.7.2

4 years ago

0.7.1

4 years ago

0.6.2

4 years ago

0.7.0

4 years ago

0.6.1

4 years ago

0.6.0

4 years ago

0.5.6

4 years ago

0.5.5

4 years ago

0.5.4

4 years ago

0.5.3

4 years ago

0.5.0

4 years ago

0.5.2

4 years ago

0.5.1

4 years ago

0.4.0

4 years ago

0.3.0

4 years ago

0.3.2

4 years ago

0.3.1

4 years ago

0.3.4

4 years ago

0.3.3

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago