1.0.3 • Published 12 months ago

react-compkit v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

react-compkit

A versatile and customizable React component library designed to simplify UI development with pre-built and easy-to-use components.

Table of Contents

Installation

To install the component library, run the following command in your project directory:

npm install react-compkit

or using Yarn:

yarn add react-compkit

Usage

Button

The Button component provides customizable buttons for various use cases, including different styles, sizes, and icons.

Button Props

PropTypeDescriptionDefault
typestringSpecifies the button type (button, submit, reset).button
contentstringThe text content displayed on the button.Derived from type
contentTypestringDetermines if the button displays text, an icon, or both (ico-text, ico).text
icostringURL of the icon image.-
icoSizestringSize of the icon.16px
onClickfunctionFunction to handle click events.-
disabledbooleanDisables the button if true.false
noBorderbooleanRemoves the button border if true.false
invertedbooleanInverts the background and text colors if true.false
bgstringBackground color.white
colorstringText color.black
borderColorstringBorder color.black
compactbooleanReduces the padding for a more compact appearance if true.false
circularbooleanGives the button a circular shape if true.false
fontSizestringFont size of the button text.1rem
fullbooleanMakes the button take the full width of its container if true.false
gapstringSpace between icon and text when contentType is "ico-text".0px
capitalbooleanCapitalizes the text if true.false
upperbooleanTransforms the text to uppercase if true.false
presetstringPredefined styles for the button (default, primary, secondery, basic).-
presetColorstringColor for the "basic" preset. Available values: red, blue, black, yellow, green, grey, pink, orange, brown.-
bgHoverstringBackground color on hover.-
colorHoverstringText color on hover.-

Button Usage

Basic Button:

import React from 'react';
import { Button } from 'your-component-library-name';

const App = () => {
  return (
    <div>
      <Button content="Click Me" onClick={() => alert('Button clicked!')} />
    </div>
  );
}

export default App;

Primary Button with Preset:

<Button content="Primary" preset="primary" />

Secondary Button:

<Button content="Secondary" preset="secondery" />

Icon Button:

<Button content="Icon Button" contentType="ico-text" ico="icon-url" icoSize="20px" />

Container

The Container component is a flexible container for organizing content, with options for layout, styling, and more.

Container Props

PropTypeDescriptionDefault
headerstringText content for the header.-
headerTypestringSpecifies the type of header content (ico, ico-text).-
icostringURL of the icon image to display in the header.-
icoSizestringSize of the header icon.15px
headerSizestringFont size of the header text.18px
headerColorstringColor of the header text.black
headerFamilystringFont family for the header text.sans-serif
headerAlignstringAlignment of the header content (left, center, right).left
verticalbooleanIf true, arranges header and content vertically.false
heightstringHeight of the container.fit-content
widthstringWidth of the container.100%
bgstringBackground color of the container.transparent
paddingstringPadding inside the container.10px
colorstringText color inside the container.black
familystringFont family for the container content.sans-serif
fontSizestringFont size for the container content.16px
alignstringText alignment inside the container (left, center, right).left
roundedstringBorder radius of the container (full for full rounding, or any other CSS border-radius value).-
overflowbooleanIf true, hides overflowing content.false
dividerbooleanIf true, displays a divider line below the header.false
contentnodeThe main content to display inside the container.-

Container Usage

Basic Container:

import React from 'react';
import { Container } from 'your-component-library-name';

const App = () => {
  return (
    <Container header="My Container" content={<p>This is some content inside the container.</p>} />
  );
}

export default App;

Container with Icon and Header:

<Container 
  header="My Container" 
  headerType="ico-text" 
  ico="icon-url" 
  content={<p>This container has an icon in the header.</p>} 
/>

Vertical Layout with Divider:

<Container 
  header="Vertical Layout" 
  vertical 
  divider 
  content={<p>Content is arranged vertically.</p>} 
/>

Additional components and usage examples will be added as the library grows.

Contributing

Contributions are welcome! If you'd like to contribute to this project, please fork the repository and submit a pull request. For major changes, please open an issue to discuss what you would like to change.

GitHub Repository:

https://github.com/GLXALOKESH/CompKit

License

This project is licensed under the MIT License - see the LICENSE file for details.

1.0.3

12 months ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago