JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 16001
  • Score
    100M100P100Q137321F
  • License MIT

React Hook & Utility Library

Package Exports

  • react-haiku

Readme

React Haiku



react-haiku

An awesome collection of React Hooks & Utilities!




NPM npm npm

What is this?

Haiku is a simple & lightweight React library with the goal of saving
you time by offering a large collection of hooks & utilities that will
help you get the job done faster & more efficiently!

Install

Installing Haiku is very easy!
Requires React >=16.8.0

NPM

npm install react-haiku

Yarn

yarn add react-haiku

PNPM

pnpm install react-haiku

Usage Examples


Please check the official Documentation for full usage examples.


Using Hooks


import { useHover } from 'react-haiku';

const Component = () => {
  const { hovered, ref } = useHover();

  return (
    <p ref={ref}>
      {hovered ? 'All mice on me' : 'No mice on me'}
    </p>
  );
}

export default Component;

Using Utilities


import { For } from 'react-haiku';

const Component = () => {
    const list = [{ name: 'React' }, { name: 'Haiku' }]

    render(
        <>
            <For each={list} render={(item, index) =>
                <p>{item.name}</p>
            }/>
        </>
    )
}

export default Component;

PACKAGE CONTENTS

Hooks

Utilities

  • If - Component for simple conditional rendering!
  • Show - Component for complex conditional rendering!
  • For - Dynamic rendering component with automatic key assignment!

Maintainers

David Haz

License

MIT