Skip to content

The practical utils and hooks I developed for different cases.

Notifications You must be signed in to change notification settings

serhhan/practical-utils-and-hooks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Practical Utils and Hooks

Welcome to the Practical Utils and Hooks repository! This repository contains a collection of practical utility functions and custom React hooks developed solely by me for personal use.

Purpose

The purpose of this repository is to provide simple and focused solutions for common tasks encountered in web development. Instead of relying on libraries with numerous features, the utilities and hooks included here aim to address specific needs efficiently.

Contents

Below are the utilities and hooks included in this repository:

  1. exportPdf Function: A function to export the content of an HTML element as a PDF file.
  2. useSwipe Hook: A custom React hook for enabling swipe functionality within a container element.
  3. useInView Hook: A custom React hook leveraging the Intersection Observer API to detect when an element becomes visible in the viewport.

Usage

All utilities and hooks provided in this repository are open for anyone to use and customize according to their requirements. They are designed to be lightweight and easy to integrate into any project.

Contribution

While these utilities and hooks are primarily developed for personal use, contributions are welcome! Feel free to suggest improvements, report issues, or submit new utilities and hooks that you find useful.

License

This repository is licensed under the MIT License. Feel free to use the code in your own projects, modify it as needed, and share it with others.


exportPdf Function

The exportPdf function is designed to export the content of an HTML element as a PDF file.

useSwipe Hook

The useSwipe hook is a custom React hook for enabling swipe functionality within a container element. It allows users to swipe horizontally within the container to scroll its content.

useInView Hook

The useInView hook uses the Intersection Observer API to efficiently detect when an element becomes visible within the viewport. This can be particularly useful for triggering animations, loading content lazily, or executing any other action that depends on the visibility of elements.

useMouseSide Hook

The useMouseSide hook is a custom React hook designed to determine which side (left or right) of a specified element the mouse is currently hovering over. By utilizing this hook, developers can easily implement dynamic UI/UX effects based on the mouse's position relative to an element. This could include visual feedback, animations, or other interactive elements. The hook provides a simple and efficient way to enhance user interaction within your application.

About

The practical utils and hooks I developed for different cases.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published