1.0.2 • Published 2 years ago

darkel-helpers v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

darkel-helpers

npm version License

A collection of helpful utilities and components for React Web Development.

Installation

npm install darkel-helpers

Usage

import React, { useState } from 'react';
import { MobileSelectDialog } from 'darkel-helpers';

const MyComponent = () => {
  const [isOpen, setIsOpen] = useState(false);
  const [selectedOption, setSelectedOption] =
    (useState < Country) | (null > null);

  function closeHandler() => {
    setOpen(false);
  }

  function selectedHandler(country: Country|null) {
    alert(JSON.stringify(country, null, 2));
  }

  return (
    <div>
      <button onClick={() => setIsOpen(true)}>Open Select Dialog</button>

      <MobileSelectDialog
        open={isOpen}
        onClose={closeHandler}
        country={null}
        onSelect={selectedHandler}
      />
    </div>
  );
};

export default MyComponent;

Preview

MobileSelectDialog

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago