Coder Social home page Coder Social logo

karkranikhil / umqombothi-component-library Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pimp-my-book/umqombothi-component-library

0.0 1.0 0.0 2.34 MB

PMB Plus - React Component Library ๐Ÿถ

Home Page: https://umqombothi.netlify.com

JavaScript 2.01% CSS 97.77% HTML 0.22%

umqombothi-component-library's Introduction

Umqombothi ๐ŸถBuild Status npm

This is the React component Library based off the Design System for PMB Plus.

The design system can be viewed on Figma

๐ŸŽ‰ Features

  • Range of components from buttons, navs, inputs etc
  • Uses TailwindCSS
  • Storybook app to view all components.
  • Ability to interact with components on Bit.

๐Ÿ“ฆ Installation

You can easily install the library via NPM or Yarn:

npm

$ npm install umqombothi-component-library

yarn

$ yarn add umqombothi-component-library

๐ŸŒช๏ธ Usage

You can import the components like so:

import React from 'react'
import {Input} from 'umqombothi-component-library'
import ReactDOM from 'react-dom';

function App() {
  return (
    <Input
    value={this.state.inputValue}
    placeholder="Type in me"
    />
  );
}

ReactDOM.render(<App />, document.querySelector('#app'));

๐Ÿ›ฐ๏ธSSR Usage

To render it with NextJS there are additional steps. Check out this Codesandbox for a working example.

Steps to follow once you have your NextJS app setup:

This is just to make sure you have the correct setup in your next.config.js and modules installed. ๐Ÿ˜€

I. Install modules

$ yarn add umqombohti-component-library next-transpile-modules @zeit/next-css @svgr/webpack

II. Get your next.config.js setup correctly.

The reason why you installed : next-transpile-modules & @zeit/next-cs was to tell Next that you need these files to be transpiled and included with your NextJS bundle for when you deploy your app.

//next.config.js

const withTM = require("next-transpile-modules");
const withCSS = require("@zeit/next-css");

module.exports = withCSS(
  withTM({
    transpileModules: [
      "umqombothi-component-library"
    ],
    webpack(config) {
      config.module.rules.push({
        test: /\.svg$/,
        use: ["@svgr/webpack"]
      });
      return config;
    }
  })
);

Because the lib includes svgs in it, we need to a loader so Next can read them. (Wow we do a lot for this Next thingy ๐Ÿคจ)

Styling

So the lib uses TailwindCSS for writting scalable CSS. You can easliy customes colours, spacing etc of components, but what is also great is you can easily use the provided classes to apply custom margin,padding,height, width etc.

For example:

<>

 <div className="flex flex-col p-10">
    <HeadingOne text="Welcome to Umqombothi!" />
    <Input placeholder="You can tell me anything inbetween everything." />
    <LightPinkButton text="Send it" />
  </div>

</>

Hear we just created a flex column and added about 2.5rem of padding to the column. ๐ŸŒŸ

umqombothi-component-library's People

Contributors

amodinho avatar krampus-nuggets avatar giladshoham avatar joshk2 avatar dependabot[bot] avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.