# @frontity/hooks

This package is a collection of React hooks that have proven to be pretty useful for a Frontity project.

## Table of Contents

* [Installation](#installation)
* [How to use](#how-to-use)
* [Hooks](#hooks)

## Installation

Add the `@frontity/hooks` package to your project:

```
npm i @frontity/hooks
```

## How to use

In order to use it, you just have to import the hook you want to use in your theme from `@frontity/hooks` and place it wherever needed. For example, if we want to use the `useInView` hook:

```javascript
import useInView from "@frontity/hooks/use-in-view";
```

## Hooks

These are the hooks available from the package `@frontity/hooks`

* [**Intersection Observer Hooks**](https://api.frontity.org/frontity-packages/collections-packages/hooks/intersection-observer-hooks)
  * [`useInView`](https://api.frontity.org/frontity-packages/collections-packages/intersection-observer-hooks#useinview)
* [**Infinite Scroll Hooks**](https://api.frontity.org/frontity-packages/collections-packages/hooks/infinite-scroll-hooks)
  * [`useInfiniteScroll`](https://api.frontity.org/frontity-packages/collections-packages/infinite-scroll-hooks#useinfinitescroll)
  * [`useArchiveInfiniteScroll`](https://api.frontity.org/frontity-packages/collections-packages/infinite-scroll-hooks#usearchiveinfinitescroll)
  * [`usePostTypeInfiniteScroll`](https://api.frontity.org/frontity-packages/collections-packages/infinite-scroll-hooks#useposttypeinfinitescroll)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://api.frontity.org/frontity-packages/collections-packages/hooks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
