1.5.0 • Published 2 years ago

@piksl/grid v1.5.0

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

@piksl/grid

  • Establish a set of column <Col /> in the horizontal space defined by row <Row />.

  • Your content elements should be placed directly in the <Col />, and only <Col /> should be placed directly in<Row />.

  • The column grid system is a value of 1-12 to represent its range spans. For example, three columns of equal width can be created by <Col xl={4} />.

  • If the sum of <Col /> spans in a row are more than 12, then the overflowing <Col /> as a whole will start a new line arrangement.

API

Container

PropDescriptionTypeDefault
minHeightMinimum height of the <Container />string-
backgroundBackground of the <Container />string-
backgroundColorBackground-color of the <Container />string-
backgroundImageBackground-image of the <Container />string-
backgroundSizeBackground-size of the <Container />cover contain string-
backgroundPositionBackground-position of the <Container />string-
justifyVertical alignment children of the <Row /> insideflex-start flex-end center space-between space-around space-evenly-
classNameThe classname of the <Container />string-
idThe id of the <Container />string-
refThe ref that is passed to the <Container />any-
paddingTop and/or bottom padding of the <Container /> Use it like [top] or [top, bottom][number] [number, number]-

Row

PropDescriptionTypeDefault
fluidMakes the <Row /> fluidbooleanfalse
backgroundColorBackground-color of the <Row />string-
justifyHorizontal alignment of the <Col /> insideflex-start flex-end center space-between space-around space-evenly-
alignVertical alignmentflex-start flex-end center stretch-
wrapReverseReverse the order at wrapbooleanfalse
paddingTop and/or bottom padding of the <Row /> Use it like [top] or [top, bottom][number] [number, number][20, 20]
marginTop and/or bottom margin of the <Row /> Use it like [top] or [top, bottom][number] [number, number][0, 0]
borderRadiusBorder-radius of the <Row />string-
classNameThe classname of the <Row />string-
idThe id of the <Row />string-

Col

PropDescriptionTypeDefault
xsSpan of the <Col /> when window.innerWidth <= 576px1 2 3 4 5 6 7 8 9 10 11 1212
smSpan of the <Col /> when window.innerWidth between 577px and 768px1 2 3 4 5 6 7 8 9 10 11 1212
mdSpan of the <Col /> when window.innerWidth between 769px and 992px1 2 3 4 5 6 7 8 9 10 11 1212
lgSpan of the <Col /> when window.innerWidth between 993px and 1200px1 2 3 4 5 6 7 8 9 10 11 1212
xlSpan of the <Col /> when window.innerWidth > 1200px1 2 3 4 5 6 7 8 9 10 11 1212
minWidthMinimum width of the <Col />string-
maxWidthMaximum width of the <Col />string-
classNameThe classname of the <Col />string-
idThe id of the <Col />string-

The breakpoints of responsive grid follow BootStrap 4 media queries rules (not including occasionally part).

ConfigProvider

Wrap the <ConfigProvider /> around the components where you would like to use <Container />, <Row /> and <Col /> with a different styling then the default, without adjusting the properties continually.

Usage example

To create a layout like the example image below, the could would look like:

<Container justify="flex-end" >
    <Row
        justify="space-between"
        align="flex-start"
    >
        <Col xl={6} />
        <Col xl={3} />
    </Row>
</Container>

@piksl/grid example

1.4.6

2 years ago

1.4.5

3 years ago

1.4.4

3 years ago

1.4.3

3 years ago

1.4.2

3 years ago

1.5.0

2 years ago

1.4.8

2 years ago

1.4.7

2 years ago

1.4.1

4 years ago

1.4.0

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.10

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago