0.1.1 • Published 5 years ago

react-theme-components v0.1.1

Weekly downloads
4
License
MIT
Repository
-
Last release
5 years ago

react-theme-components

GitHub version

How to install?

npm i react-theme-components

Basic use

import { Button } from 'react-theme-components'

...
render() {
  return (
    <Button>This is a button</Button>
  );
};

Inline style

import { Button } from 'react-theme-components'

...
render() {
  return (
    <Button
      style={{
        color: 'red'
      }}
      >This is a button</Button>
  );
};

Editable attributes inline style

Button

PropertyDefaultTypeValues
color#ffffffStringhex, rgb
fontSize16pxString, Numberfont-size values
backgroundColor#1890ffStringhex, rgb
borderColor#1890ffStringhex, rgb

InputText

PropertyDefaultTypeValues
height32pxString, Numberheight values
colorrgba(0,0,0,0.65)Stringhex, rgb
fontSize14pxString, Numberfont-size values
backgroundColor#ffffffStringhex, rgb
borderColor#d9d9d9Stringhex, rgb

Title

PropertyDefaultTypeValues
color#0d1a26Stringhex, rgb
fontSize30pxString, Numberfont-size values

You can create a theme

import { Button, Title, Provider } from 'react-theme-components'

...
render() {
  return (
    <Provider theme={{
      Button: {
        color: 'red'
      },
      Title: {
        color: 'red'
      }
    }}>
      <Button>This is a button</Button>
      <Title>This is a Title</Title>
    </Provider>
  );
};

Editable attributes through the theme

Button

PropertyDefaultTypeValues
color#ffffffStringhex, rgb
fontSize16pxStringfont-size values
backgroundColor#1890ffStringhex, rgb
borderColor#1890ffStringhex, rgb
hoverBackgroundColor#40a9ffStringhex, rgb
hoverBorderColor#40a9ffStringhex, rgb
hoverColor#ffffffStringhex, rgb

InputText

PropertyDefaultTypeValues
height32pxStringheight values
colorrgba(0,0,0,0.65)Stringhex, rgb
fontSize14pxStringfont-size values
backgroundColor#ffffffStringhex, rgb
borderColor#d9d9d9Stringhex, rgb
hoverBorderColor#40a9ffStringhex, rgb

Title

PropertyDefaultTypeValues
color#0d1a26Stringhex, rgb
fontSize30pxStringfont-size values