0.0.16 • Published 10 months ago

kaze-ui v0.0.16

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

Kaze React UI

Component library that extends your tailwind config to provide powerful responsive layouts that don't rely on media queries.

Getting started

  1. Install
npm i kaze-ui
  1. Configure tailwind.config.js
const {kaze} = require('kaze-ui/config');

module.exports = kaze({
  purge: [],
  theme: {
    extend: {},
  }
  variants: {},
  plugins: [],
});
  1. Wrap your app with the Kaze theme provider
import React from 'react'
import ReactDOM from 'react-dom'
import App from './App'
import { Kaze } from 'kaze-ui'

ReactDOM.render(
  <Kaze>
    <App />
  </Kaze>,
  document.getElementById('root')
)
  1. Extend the styles of the components.

Here is an example styles directory. In this example we will style the Box component

styles/
┣ components/
┃ ┗ Box.ts
┗ index.ts

Export the Box component from styles/index.ts

import Box from './components/Box';

export default {
  components: {
    Box,
  },
};

Add a theme to the Box component

export default {
  base: 'rounded', // Add a border radius to all of the `Box` components
  // Create variants for the `Box` component
  variants: {
    red: 'bg-red-400',
    blue: 'bg-blue-400',
    purple: 'bg-purple-400',
    green: 'bg-green-400'
  }
};

Provide the theme to your Kaze provider

import React from 'react'
import ReactDOM from 'react-dom'
import App from './App'
import { Kaze } from 'kaze-ui'
import theme from "../styles";

ReactDOM.render(
  <Kaze theme={theme}>
    <App />
  </Kaze>,
  document.getElementById('root')
)

Use a Box component with a variant

import React from 'react';
import { Box } from 'kaze-ui';

const IndexPage: React.FC<Props> = () => {
  return (
    <Box variant="purple">
      Test Box component
    </Box>
  );
}
0.0.16

10 months ago

0.0.15

12 months ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.10

3 years ago

0.0.11

3 years ago

0.0.12

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago