1.4.0 • Published 10 months ago

@paalan/react-hooks v1.4.0

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

Paalan React UI Hooks

This package contains the hooks for the Paalan React UI.

Installation

npm install @paalan/react-hooks

Usage

  • Import the useToggle hook from the package and use them in your project.
import React from 'react';

import { useToggle } from '@paalan/react-hooks';
import { Box, Button, Text } from '@paalan/react-ui';

export const App = () => {
  const [isOn, toggle] = useToggle();

  return (
    <Box>
      <Text>Current state is {isOn ? 'on' : 'off'}</Text>
      <Button onClick={toggle}>Toggle</Button>
    </Box>
  );
};
  • Import the useDisclosure hook from @paalan/react-hooks.
import { useDisclosure } from '@paalan/react-hooks';

const { isOpen, onOpen, onClose, onToggle } = useDisclosure();
1.4.0

10 months ago

1.3.0

11 months ago

1.2.0

11 months ago

1.1.0

11 months ago

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago