Skip to content

Flex-box and spacing system

Box

Component responsible for spacings and sizes 📐

jsx
import { Box } from 'intergalactic/flex-box';
<Box />;
import { Box } from 'intergalactic/flex-box';
<Box />;

BoxProps

& {...}
NameTypeDescription
displayProperty.Display CSS `display` property
inlineboolean Sets the `inline-block` property
boxSizingboolean | "border-box" CSS `box-sizing: border-box` property
flexProperty.Flex<string> CSS `flex` property
mnumber | string CSS `margin` property
mtnumber | string CSS `margin-top` property
mrnumber | string CSS `margin-right` property
mbnumber | string CSS `margin-bottom` property
mlnumber | string CSS `margin-left` property
mxnumber | string CSS `margin-left` and `margin-right` property
mynumber | string CSS `margin-top` and `margin-bottom` property
pnumber | string CSS `padding` property
ptnumber | string CSS `padding-top` property
prnumber | string CSS `padding-right` property
pbnumber | string CSS `padding-bottom` property
plnumber | string CSS `padding-left` property
pxnumber | string CSS `padding-left` and `padding-right` property
pynumber | string CSS `padding-top` and `padding-bottom` property
wnumber | string CSS `width` property. If its value is less than 1, is considered as a fraction of 100%. If its value is more than 1, is considered as value in px, if it is a string, is passed as is.
wMinnumber | string CSS `min-width` property. If its value is less than 1, is considered as a fraction of 100%. If its value is more than 1, is considered as value in px, if it is a string, is passed as is.
wMaxnumber | string CSS `max-width` property. If its value is less than 1, is considered as a fraction of 100%. If its value is more than 1, is considered as value in px, if it is a string, is passed as is.
hnumber | string CSS `height` property. If its value is less than 1, is considered as a fraction of 100%. If its value is more than 1, is considered as value in px, if it is a string, is passed as is.
hMinnumber | string CSS `min-height` property. If its value is less than 1, is considered as a fraction of 100%. If its value is more than 1, is considered as value in px, if it is a string, is passed as is.
hMaxnumber | string CSS `max-height` property. If its value is less than 1, is considered as a fraction of 100%. If its value is more than 1, is considered as value in px, if it is a string, is passed as is.
scaleIndentnumber Multiplier of all indents. For example, if you specify a margin-top equal to 3 (mt = {3}), it will be 12px (3 * 4 = 12).
cssReact.CSSPropertiesDeprecated Property for specifying css properties in js
positionProperty.Position CSS `position` property
topnumber | string CSS `top` property
leftnumber | string CSS `left` property
bottomnumber | string CSS `bottom` property
rightnumber | string CSS `right` property
zIndexnumber
childrenReact.ReactNode

Flex

The layout building component is a wrapper over CSS-flex. It inherits all properties from Box.

jsx
import { Flex } from 'intergalactic/flex-box';
<Flex />;
import { Flex } from 'intergalactic/flex-box';
<Flex />;

FlexProps

& {...}
NameTypeDescription
inlineboolean It manages the `inline-flex` property
reverseboolean Adds the `reverse` property to `flex-direction`
flexWrapboolean It manages the `flex-wrap` property
directionProperty.FlexDirection It manages the `flex-direction` property
alignItemsProperty.AlignItems It manages the `align-items` property
alignContentProperty.AlignContent It manages the `align-content` property
justifyContentProperty.JustifyContent CSS `justify-content` property
gapProperty.Gap<number> CSS `gap` property
rowGapProperty.RowGap<number> CSS `gap` property
columnGapProperty.ColumnGap<number> CSS `gap` property
scaleIndentnumber Multiplier of all indents. For example, if you specify a margin-top equal to 3 (mt = {3}), it will be 12px (3 * 4 = 12).

Released under the MIT License.

Released under the MIT License.