1.4.4 • Published 3 years ago
amc-component-library v1.4.4
amc-component-library
The AMC component library is a themable repository of simple and complex UI components
Tech Stack
- React,
- Styled Components,
- typescript,
Using The Component Library
Install the component library.
npm i amc-component-library yarn add amc-component-libraryImport the ComponentThemeProvider and wrap it around your app.
import {ComponentThemeProvider} from "amc-component-library" import {Home} from './home' const App = () => { return( <ComponentThemeProvider> <Home /> </ComponentThemeProvider> ) } export default AppOptionally Provide your theme object to override the default theme.
import {ComponentThemeProvider} from "amc-component-library" import {Home} from './home' const theme = {primaryColor: '#f4561e'} const App = () => { return( <ComponentThemeProvider theme={theme}> <Home /> </ComponentThemeProvider> ) } export default AppImport Any Other Component & use within the context of the ComponentThemeProvider
// home.js import {Button} from "amc-component-library" export const Home = () => { return( <Button onClick={() => console.log('hello world!!!)}> click Me <Button> ) }
Run The Component Library Locally
Clone the mobile repository via SSH
git@github.com:Ayu-Digital-Ltd/amc-component-library.gitchange to directory
cd amc-component-libraryInstall dependencies
yarnStart Project
yarn startTesting The Component Library Locally
change to directory to the example folder
cd exampleInstall dependencies
yarnStart Project
yarn startApp would be running on http://localhost:1234,
Folder Structure
- The main file i.e the file from which the library export from is the src/index.js file on the project root.
- Only use named export through out the project.