1.1.1 • Published 12 months ago

gcs-flexbox v1.1.1

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

gcs-flexbox

gcs-flexbox is a React and styled-components based Flexbox layout component with customizable colors. It allows you to create responsive and flexible layouts with ease, while also providing a way to customize the colors used in the components.

Installation

Install the package using npm:

npm install gcs-flexbox

Usage

Importing Components

Import the Row and Column components from the package:

import React from 'react';
import { Row, Column, mergeColors } from 'gcs-flexbox';
import defaultColors from 'gcs-flexbox/constants/colors';

Using the Components

Use the Row and Column components to create a flexible layout. You can also customize the colors by using the mergeColors function.

import React from 'react';
import { Row, Column, mergeColors } from 'gcs-flexbox';

const userColors = {
  "primary-500": "#ff5733",
  "secondary-500": "#33c4ff",
  ...
};

const colors = mergeColors(userColors);

const App = () => (
  <Row backgroundColor="primary-500">
    <Column size={6} difference={2}>
      Content here
    </Column>
  </Row>
);

export default App;

Props

Row Component

PropTypeDescription
wrapTWrap or { [K in TMedia]?: TWrap }Flex wrap property
directionTDirection or { [K in TMedia]?: TDirection }Flex direction property
contentTContent or { [K in TMedia]?: TContent }Justify content property
align_itemsTItems or { [K in TMedia]?: TItems }Align items property
align_contentTItems or { [K in TMedia]?: TItems }Align content property
gapnumber or { [K in TMedia]?: number }Gap property
row_gapnumber or { [K in TMedia]?: number }Row gap property
column_gapnumber or { [K in TMedia]?: number }Column gap property
widthstringWidth of the row
minWidthstringMinimum width of the row
heightstringHeight of the row
backgroundColorTColorsBackground color of the row
paddingstringPadding of the row
borderRadiusstringBorder radius of the row

Column Component

PropTypeDescription
wrapTWrap or { [K in TMedia]?: TWrap }Flex wrap property
directionTDirection or { [K in TMedia]?: TDirection }Flex direction property
contentTContent or { [K in TMedia]?: TContent }Justify content property
align_itemsTItems or { [K in TMedia]?: TItems }Align items property
align_contentTItems or { [K in TMedia]?: TItems }Align content property
gapnumber or { [K in TMedia]?: number }Gap property
row_gapnumber or { [K in TMedia]?: number }Row gap property
column_gapnumber or { [K in TMedia]?: number }Column gap property
sizenumber or { [K in TMedia]?: number }Size of the column
differencenumber or { [K in TMedia]?: number }Difference in size for responsive adjustments

Custom Colors

You can customize the colors used in the components by providing your own color values using the mergeColors function. This function takes an object with your custom colors and merges them with the default colors.

import { mergeColors } from 'gcs-flexbox';

const userColors = {
  "primary-500": "#ff5733",
  "secondary-500": "#33c4ff",
  ...
};

const colors = mergeColors(userColors);

License

This project is licensed under the ISC License.

1.1.1

12 months ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago