1.2.61 • Published 3 years ago

bycoders-ui-react v1.2.61

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
3 years ago

This is bycoders_ oficial React Ui-Kit library.

Usage

yarn add bycoders-ui-react

You'll need to wrap your application with a context to use this library:

  • React:

    // src/index.js
    
    import { ThemeProvider, defaultTheme, ResetCSS } from 'bycoders-ui-react'
    
    function MyApp() {
      return(
        <ThemeProvider theme={defaultTheme}>
          <ResetCSS />
          <Router />
          <OtherComponents />
        </ThemeProvider>
      )
    }
    
    export default MyApp
  • Next:

    // src/pages/_app.js
    
    import { ThemeProvider, defaultTheme } from 'bycoders-ui-react'
    
    function MyApp({ Component, pageProps }) {
      return(
        <ThemeProvider theme={defaultTheme}>
          <ResetCSS />
          <Component {...pageProps} />
        </ThemeProvider>
      )
    }
    
    export default MyApp

you should import Google's Inter font, which is the default font, in your <head/> tag:

<head>
  ...
  <link rel="preconnect" href="https://fonts.gstatic.com" />
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap" rel="stylesheet" />
  ...
</head>

then you can use components like this:

// src/pages/foo.tsx

import React from 'react';
import { Input } from 'bycoders-ui-react';

export default function Foo() {
  return (
    <Input label="Your Label" error="Foo"/>
  );
}

Customize Theme

You can customize theme colors and add properties:

  • Adding new colors/properties:

    import { defaultTheme } from 'bycoders-ui-react';
    
    const newTheme = {
      ...defaultTheme,
      foo: '#fff',
      baz: '#ABCDEF',
    };
  • Customizing existing props:

    You can use BycodersTheme interface to view all properties of the theme.

    import { defaultTheme } from 'bycoders-ui-react';
    
    const newTheme = {
      ...defaultTheme,
      textColor: '#F3F3F3',
    };
  • Typescript

    If you're using Typescript maybe you should connect theme with styled-components:

    • If you're using legacy theme:

      // src/@types/styled-components.d.ts
      
      import { BycodersTheme } from 'bycoders-ui-react';
      
      declare module 'styled-components' {
        export interface DefaultTheme extends BycodersTheme {}
      }
    • If you're using a custom theme:

      // src/styles/newTheme.ts
      
      import { defaultTheme } from 'bycoders-ui-react';
      
      const newTheme = {
        ...defaultTheme,
        textColor: '#F3F3F3',
      };
      // src/@types/styled-components.d.ts
      
      import { newTheme } from '../styles/newTheme';
      
      type MyThemeType = typeof newTheme
      
      declare module 'styled-components' {
        export interface DefaultTheme extends MyThemeType {}
      }

Documentation

This project is documented on Storybook. You'll need to clone the project and execute storybook:

git clone git@github.com:ByCodersTec/ui-kit-react.git
yarn install
yarn storybook

Contribute

yarn install

To contribute, merge your desired PR to development and then:

git checkout development
git pull origin development
yarn bump-patch
git push origin development --follow-tags
git checkout master
git pull origin master
git merge development
git push origin master
1.2.61

3 years ago

1.2.60

3 years ago

1.2.41

4 years ago

1.2.42

4 years ago

1.2.40

4 years ago

1.2.45

3 years ago

1.2.46

3 years ago

1.2.43

4 years ago

1.2.44

4 years ago

1.2.49

3 years ago

1.2.47

3 years ago

1.2.48

3 years ago

1.2.52

3 years ago

1.2.53

3 years ago

1.2.56

3 years ago

1.2.57

3 years ago

1.2.54

3 years ago

1.2.55

3 years ago

1.2.58

3 years ago

1.2.59

3 years ago

1.2.38

4 years ago

1.2.39

4 years ago

1.2.36

4 years ago

1.2.37

4 years ago

1.2.20

4 years ago

1.2.23

4 years ago

1.2.24

4 years ago

1.2.21

4 years ago

1.2.22

4 years ago

1.2.27

4 years ago

1.2.28

4 years ago

1.2.25

4 years ago

1.2.26

4 years ago

1.2.29

4 years ago

1.2.30

4 years ago

1.2.31

4 years ago

1.2.34

4 years ago

1.2.35

4 years ago

1.2.32

4 years ago

1.2.33

4 years ago

1.2.17

4 years ago

1.2.18

4 years ago

1.2.19

4 years ago

1.2.16

4 years ago

1.2.15

4 years ago

1.2.14

4 years ago

1.2.13

4 years ago

1.2.12

4 years ago

1.2.10

4 years ago

1.2.11

4 years ago

1.2.8

4 years ago

1.2.7

4 years ago

1.2.9

4 years ago

1.2.6

4 years ago

1.2.5

4 years ago

1.2.0

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.1.49

4 years ago

1.1.48

4 years ago

1.1.45

4 years ago

1.1.43

4 years ago

1.1.42

4 years ago

1.1.47

4 years ago

1.1.46

4 years ago

1.1.38

4 years ago

1.1.39

4 years ago

1.1.41

4 years ago

1.1.40

4 years ago

1.1.34

4 years ago

1.1.33

4 years ago

1.1.37

4 years ago

1.1.35

4 years ago

1.1.32

4 years ago

1.1.31

4 years ago

1.1.29

4 years ago

1.1.28

4 years ago

1.1.27

4 years ago

1.1.26

4 years ago

1.1.25

4 years ago

1.1.22

4 years ago

1.1.21

4 years ago

1.1.19

4 years ago

1.1.18

4 years ago

1.1.17

4 years ago

1.1.20

4 years ago

1.1.16

4 years ago

1.1.15

4 years ago

1.1.14

4 years ago

1.1.12

4 years ago

1.1.11

4 years ago

1.1.10

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.0.0

4 years ago