All Projects β†’ gregnb β†’ use-detect-print

gregnb / use-detect-print

Licence: other
A react hook to detect when a page is being printed

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to use-detect-print

Graphql Hooks
🎣 Minimal hooks-first GraphQL client
Stars: ✭ 1,610 (+2827.27%)
Mutual labels:  hooks, react-hooks
react-ui-hooks
🧩Simple repository of React hooks for building UI components
Stars: ✭ 20 (-63.64%)
Mutual labels:  hooks, react-hooks
Haunted
React's Hooks API implemented for web components πŸ‘»
Stars: ✭ 2,197 (+3894.55%)
Mutual labels:  hooks, react-hooks
Formik
Build forms in React, without the tears 😭
Stars: ✭ 29,047 (+52712.73%)
Mutual labels:  hooks, react-hooks
react-cool-form
😎 πŸ“‹ React hooks for forms state and validation, less code more performant.
Stars: ✭ 246 (+347.27%)
Mutual labels:  hooks, react-hooks
Awesome React Hooks
Awesome React Hooks
Stars: ✭ 7,616 (+13747.27%)
Mutual labels:  hooks, react-hooks
Fre
πŸ‘» Tiny Footprint Concurrent UI library for Fiber.
Stars: ✭ 3,195 (+5709.09%)
Mutual labels:  hooks, react-hooks
React Hook Form
πŸ“‹ React Hooks for form state management and validation (Web + React Native)
Stars: ✭ 24,831 (+45047.27%)
Mutual labels:  hooks, react-hooks
flhooks
React like Hooks implementation for Flutter.
Stars: ✭ 38 (-30.91%)
Mutual labels:  hooks, react-hooks
react-breakpoints
Respond to changes in a DOM element's size. With React Breakpoints, element queries are no longer "web design's unicorn" πŸ¦„
Stars: ✭ 74 (+34.55%)
Mutual labels:  hooks, react-hooks
The Platform
Web. Components. πŸ˜‚
Stars: ✭ 4,355 (+7818.18%)
Mutual labels:  hooks, react-hooks
use-app-state
🌏 useAppState() hook. that global version of setState() built on Context.
Stars: ✭ 65 (+18.18%)
Mutual labels:  hooks, react-hooks
Beautiful React Hooks
πŸ”₯ A collection of beautiful and (hopefully) useful React hooks to speed-up your components and hooks development πŸ”₯
Stars: ✭ 5,242 (+9430.91%)
Mutual labels:  hooks, react-hooks
jedisdb
redis like key-value state management solution for React
Stars: ✭ 13 (-76.36%)
Mutual labels:  hooks, react-hooks
Easy Peasy
Vegetarian friendly state for React
Stars: ✭ 4,525 (+8127.27%)
Mutual labels:  hooks, react-hooks
React Form
βš›οΈ Hooks for managing form state and validation in React
Stars: ✭ 2,270 (+4027.27%)
Mutual labels:  hooks, react-hooks
React-Combine-Provider
combine react providers in ease
Stars: ✭ 29 (-47.27%)
Mutual labels:  hooks, react-hooks
Constate
React Context + State
Stars: ✭ 3,519 (+6298.18%)
Mutual labels:  hooks, react-hooks
react-use-comlink
Three ways to use Comlink web workers through React Hooks (and in a typesafe manner).
Stars: ✭ 39 (-29.09%)
Mutual labels:  hooks, react-hooks
resynced
An experimental hook that lets you have multiple components using multiple synced states using no context provider
Stars: ✭ 19 (-65.45%)
Mutual labels:  hooks, react-hooks

use-detect-print

React Hook to detect printing

Installation

npm install use-detect-print --save

Usage

import React from 'react';
import useDetectPrint from 'use-detect-print';

function App() {

  const isPrinting = useDetectPrint();

  return (
    <div>
     <span>Is it printing? </span>      
     {isPrinting ? (
       <span style={{ color: 'green', fontSize: 50 }}>Yes</span>
     ): (
       <span style={{ color: 'red' }}>No!</span>
     )}
    </div>
  );
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].