0.2.35 • Published 6 months ago

hokui v0.2.35

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

HOK UI

HOK-UI is a UI library for React created by HOK in beased on React-Aria and Tailwind

Installation

Use the package manager to install.

# Using npm
npm install hokui tailwindcss-react-aria-components tailwindcss-animate

# Using yarn
yarn add hokui tailwindcss-react-aria-components tailwindcss-animate

Configuration

// tailwind.config.ts

import { hokTheme, hokLayout } from "hokui";
import type { Config } from "tailwindcss";

export default {
  content: [
    "./node_modules/hokui/dist/**/*.{js,ts,jsx,tsx}",
    // your component path
  ],
  theme: {},
  plugins: [
    require("tailwindcss-react-aria-components"),
    require("tailwindcss-animate"),
    hokTheme(),
    hokLayout(),
  ],
} satisfies Config;

Usage

// app.tsx

import { Button } from "hokui";
import "./tailwind.css";

function App() {
  return (
    <div>
      <Button
        size="xl"
        rounded="full"
      >
        this is Button
      </Button>
    </div>
  );
}

export default App;

i18n Provider

// app.tsx

import { HokUi } from "hokui";
import "./tailwind.css";

function App() {
  return (
    <div>
      {/* locale Thai with Gregorian calendar */}
      <HokUi.Provider locale="th-TH-u-ca-gregory-nu-latn">
        <Button
          size="xl"
          rounded="full"
        >
          this is Button
        </Button>
      </HokUi.Provider>
    </div>
  );
}

export default App;

useAlert Hook

// app.tsx

import { HokUi, useAlert } from "hokui";
import "./tailwind.css";

function App() {
  const { toast, dialog } = useAlert();

  return (
    <div>
      {/* locale Thai with Gregorian calendar */}
      <HokUi.Provider locale="th-TH-u-ca-gregory-nu-latn">
        <Button
          size="xl"
          rounded="full"
          onPress={() =>
            toast({
              delay: 3000,
              color: "info",
              render: <div>this is taost content</div>,
            })
          }
        >
          this is Button for toast
        </Button>
        <Button
          size="xl"
          rounded="full"
          onPress={() =>
            dialog({
              type: "confirm",
              variant: "success",
              title: "test",
              subTitle: "test",
            })
          }
        >
          this is Button for dialog
        </Button>
      </HokUi.Provider>
    </div>
  );
}

export default App;

License

MIT

0.2.27

7 months ago

0.2.26

7 months ago

0.2.25

7 months ago

0.2.24

7 months ago

0.2.23

8 months ago

0.2.22

8 months ago

0.2.21

8 months ago

0.2.20

8 months ago

0.2.19

8 months ago

0.2.18

8 months ago

0.2.17

8 months ago

0.2.16

8 months ago

0.2.15

8 months ago

0.2.14

8 months ago

0.2.13

8 months ago

0.2.12

8 months ago

0.2.11

8 months ago

0.2.10

8 months ago

0.2.30

7 months ago

0.2.35

6 months ago

0.2.33

6 months ago

0.2.32

6 months ago

0.2.31

6 months ago

0.2.1

9 months ago

0.2.0

9 months ago

0.2.29

7 months ago

0.2.28

7 months ago

0.2.7

8 months ago

0.2.6

8 months ago

0.2.9

8 months ago

0.2.8

8 months ago

0.2.3

9 months ago

0.2.2

9 months ago

0.2.5

8 months ago

0.2.4

8 months ago

0.1.8

9 months ago

0.1.9

9 months ago

0.1.7

9 months ago

0.1.4

9 months ago

0.1.3

9 months ago

0.1.6

9 months ago

0.1.5

9 months ago

0.1.2

9 months ago

0.1.1

9 months ago

0.1.0

9 months ago

0.0.69

9 months ago

0.0.68

9 months ago

0.0.67

9 months ago

0.0.66

9 months ago

0.0.65

9 months ago

0.0.64

9 months ago

0.0.63

9 months ago

0.0.62

9 months ago

0.0.61

9 months ago

0.0.60

9 months ago

0.0.59

9 months ago

0.0.58

9 months ago

0.0.57

9 months ago

0.0.56

9 months ago

0.0.54

9 months ago

0.0.53

9 months ago

0.0.52

9 months ago

0.0.51

9 months ago

0.0.50

9 months ago

0.0.49

9 months ago

0.0.48

9 months ago

0.0.47

10 months ago

0.0.46

10 months ago

0.0.45

10 months ago

0.0.44

10 months ago

0.0.43

10 months ago

0.0.42

10 months ago

0.0.41

10 months ago

0.0.40

10 months ago

0.0.39

10 months ago

0.0.38

10 months ago

0.0.37

10 months ago

0.0.36

10 months ago

0.0.35

10 months ago

0.0.34

10 months ago