0.1.0 • Published 1 year ago

grid-spacer v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Grid Spacer

Fill in the space with the blocks when you use CSS Grid Layout.

Usage

npm i grid-spacer

You can use this like the follow example:

const { execute } = useGridSpacer({
  containerClass: 'container', // this is required.
  spacerClass: 'box', // default is 'spacer'.
  spacerTag: 'div', // default is 'div'.
  type: 'fill' // default is 'fill'. You can use 'fill' or 'fit'.
})

// Call `execute` after the page is rendered. 
execute()
<html>
  <head>...</head>
  <body>
    <div class="container">
      <div class="box" />
      <div class="box" />
      <div class="box" />
      <div class="box" />
      <div class="box" />
    </div>
    <script ...></script>
  </body>
</html>