20.0.0 • Published 5 years ago

@seregpie/vueflex v20.0.0

Weekly downloads
20
License
MIT
Repository
github
Last release
5 years ago

VueFlex

A flexbox grid system.

demo

Try it out!

setup

npm

npm install @seregpie/vueflex

Register the components globally.

import Vue from 'vue';
import VueFlex from '@seregpie/vueflex';

Vue.use(VueFlex);

or

Register the components in the scope of another component.

import VueFlex from '@seregpie/vueflex';

export default {
  components: {
    [VueFlex.Box.name]: VueFlex.Box,
    [VueFlex.Item.name]: VueFlex.Item,
  },
};

browser

<script src="https://unpkg.com/vue"></script>
<script src="https://unpkg.com/@seregpie/vueflex"></script>

If Vue is detected, the components are registered automatically.

usage

<vue-flex-box
  align-items="center"
  gap="16px"
  justify-content="space-between"
  wrap
>
  <vue-flex-item><!--...--></vue-flex-item>
  <vue-flex-item><!--...--></vue-flex-item>
</vue-flex-box>

Nested boxes can inherit the gap from their parent.

<vue-flex-box gap="8px">
  <vue-flex-item
    style="width: 100px;"
  ><!--...--></vue-flex-item>
  <vue-flex-box
    direction-column
    gap="inherit"
    style="flex-grow: 1;"
  >
    <vue-flex-item><!--...--></vue-flex-item>
    <vue-flex-item><!--...--></vue-flex-item>
  </vue-flex-box>
</vue-flex-box>

Provide any unit for the gap.

<vue-flex-box gap="2em"><!--...--></vue-flex-box>

components

VueFlexBox

properties

propertytypedefault
alignContentString'stretch'
alignItemsString'stretch'
directionColumnBooleanfalse
gapString'0px'
justifyContentString'flex-start'
reverseDirectionBooleanfalse
reverseWrapBooleanfalse
tagString'div'
wrapBooleanfalse

VueFlexItem

properties

propertytypedefault
tagString'div'
20.0.0

5 years ago

19.0.0

5 years ago

18.10.26

6 years ago

18.10.25

6 years ago

18.7.4

6 years ago

18.5.11

6 years ago

18.5.3

6 years ago

18.5.1

6 years ago

18.4.10

6 years ago

18.3.5

6 years ago