1.0.0 • Published 2 years ago

devs-react-box v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

Flex, Grid, Container

Box

PropsValuesDefault
justifyContentstringcenter
alignItems"flex-start" , "flex-end" , "center" , "baseline" , "stretch"center
alignContent"flex-start" , "flex-end" , "center" , "space-between" , "space-around" , "stretch"null
widthstring eg: 20px100%
heightstring eg: 20px100%
textAlign"left" , "right" , "center" , "justify" , "inherit"center
wrap(fle-wrap)"nowrap" , "wrap" , "wrap-reverse"wrap
direction(flex-direction)row, row-reverse, column, column-reverserow
marginstring. Eg: 20px0
pad(padding)string0
bgColor(background-color)stringtransparent

Usage

    import { Components, ThemeTypes } from "devs-react-box"
    
    const theme: ThemeTypes = {
        palette: {
            Blue: {
                dark: {
                    5: '#F2F6FA'
                },
            },
        };
        // shadows,
        // typography,
        // zIndex,
        // shape,
        // fontSizes,
    };
    const { Flex } = Components(theme)

   const App = () => (
        <Flex
            justifyContent="center"
            bgColor='Blue.dark.5'
            // ...other propps if needed
        >
            This is a div
        </Flex>
   )

Grid

PropsValuesDefault
columns(grid-template-columns)string1fr
rows(gird-template-rows)stringauto
gap(grid-gap)string10px
justifyContentstringcenter
alignItems"flex-start" , "flex-end" , "center" , "baseline" , "stretch"center
width100%

Usage

    import { Components, ThemeTypes } from "devs-react-component-library"

    const theme: ThemeTypes = {
        // palette: 
        // shadows,
        // typography,
        // zIndex,
        // shape,
        // fontSizes,
    };
    const { Grid } = Components(theme)

   const App = () => (
        <Grid
            row="1fr 1fr"
            // ...other propps if needed
        >
            This is a div
        </Grid>
   )

   

Container

PropsValuesDefault
widthstring eg: 20px100%
heightstring eg: 20px100%
textAlign"left" , "right" , "center" , "justify" , "inherit"center
marginstring. Eg: 20px0
pad(padding)string0
bgColor(background-color)stringtransparent

Usage

     import { Components, ThemeTypes } from "devs-react-component-library"
    
    const theme: ThemeTypes = {
        palette: {
            read:   '#F2F6FA' 
        };
        // shadows,
        // typography,
        // zIndex,
        // shape,
        // fontSizes,
    };
    const { Grid } = Components(theme)


    const App = () => (
        <Container
            width="50px"
            bgColor='read'
            // ...other propps if needed
        >
            This is a div
        </Container>
    )