1.0.1 • Published 3 years ago

iron-grid-system v1.0.1

Weekly downloads
-
License
-
Repository
github
Last release
3 years ago

Iron Grid System

A responsive grid system for 3.x.

📦 Installation

npm install iron-grid-system --save

or

yarn install iron-grid-system

🔨 Usage

For Vue 3.x

import { createApp } from "vue";
import App from "./App.vue";
import 'iron-grid-system/dist/style.css';

const app = createApp(App);
app.mount("#app");

You can create your grid system using three components (Container, Row, Col)

<script>
import { defineComponent } from 'vue';
import { Container, Row, Col } from 'iron-grid-system';

export default defineComponent({
  name: 'ServeDev',
  components: {
    Container,
    Row,
    Col,
  },
});
</script>

<template>
  <div id="app">
    <Container>
      <Row>
        <Col :cols="6">
          <h1>Demo 1</h1>
        </Col>
        <Col :cols="6">
          <h1>Demo 2</h1>
        </Col>
      </Row>
    </Container>
  </div>
</template>

🛠️ Configuration

custom.scss file should be created for customization

import { createApp } from "vue";
import App from "./App.vue";

import "./assets/custom.scss";

const app = createApp(App);
app.mount("#app");

Default values

Variable nameDescriptionDefault value
\$grid-columnsDefault number of grid columns.12
\$container-max-widthMaximum container width.1480px
\$container-gutterRight and left space value of the container.30px
\$grid-gutterSpace between columns.(0, 4, 8, 16, 24, 32, 40)
\$breakpointsScreen breakpoints.sm: '(max-width: 480px)' md: '(min-width: 481px) and (max-width: 767px)' lg: '(min-width: 768px) and (max-width: 1024px)' xl: '(min-width: 1025px)'

Example custom.scss

@import "../../node_modules/iron-grid-system/src/style/iron-variables";

$grid-columns: 12;
$container-max-width: 1000px;
$container-gutter: 0px;
$grid-gutter: (0, 4, 8);

$breakpoints: (
  sm: "(max-width: 480px)",
  md: "(min-width: 481px) and (max-width: 767px)",
  lg: "(min-width: 768px) and (max-width: 1024px)",
  xl: "(min-width: 1025px)",
);

@import "../../node_modules/iron-grid-system/src/style/iron-container";
@import "../../node_modules/iron-grid-system/src/style/iron-row";
@import "../../node_modules/iron-grid-system/src/style/iron-col";

📃 API

Container

Container properties

PropertyDescriptionTypeDefault
tagContainer's html tag element.div, section, aside, nav, header, main, footerdiv
fluidFull width container, spanning the entire width of the viewport.Booleanfalse

Row

Row properties

PropertyDescriptionTypeDefault
tagRow html tag element.div, section, aside, nav, header, main, footerdiv
justifyHorizontal arrangement.start, end, center, between, aroundstart
alignVertical alignment.start, end, center, between, aroundstart
hGutterSpacing horizontal between columnNumber, Object({sm: 4, md: 8, lg: 16, xl: 24})0
vGutterSpacing vertical between columnNumber, Object({sm: 4, md: 8, lg: 16, xl: 24})0

Col

Col properties

PropertyDescriptionTypeDefault
tagCol html tag element.div, section, aside, nav, header, main, footerdiv
colsCol width.Number, Object({sm: 12, md: 6, lg: 4 , xl: 3})0
offsetNumber of cells to shift the cell from the leftNumber, Object({sm: 12, md: 6, lg: 4 , xl: 3})0
orderRaster orderNumber, Object({sm: 3, md: 4, lg: 2 , xl: 1})0