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.DisplayCSS `display` property
inlinebooleanSets the `inline-block` property
boxSizingboolean | "border-box"CSS `box-sizing: border-box` property
flexProperty.Flex<string>CSS `flex` property
mnumber | stringCSS `margin` property
mtnumber | stringCSS `margin-top` property
mrnumber | stringCSS `margin-right` property
mbnumber | stringCSS `margin-bottom` property
mlnumber | stringCSS `margin-left` property
mxnumber | stringCSS `margin-left` and `margin-right` property
mynumber | stringCSS `margin-top` and `margin-bottom` property
pnumber | stringCSS `padding` property
ptnumber | stringCSS `padding-top` property
prnumber | stringCSS `padding-right` property
pbnumber | stringCSS `padding-bottom` property
plnumber | stringCSS `padding-left` property
pxnumber | stringCSS `padding-left` and `padding-right` property
pynumber | stringCSS `padding-top` and `padding-bottom` property
wnumber | stringCSS `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 | stringCSS `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 | stringCSS `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 | stringCSS `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 | stringCSS `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 | stringCSS `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.
scaleIndentnumberMultiplier of all indents. For example, if you specify a margin-top equal to 3 (mt = {3}), it will be 12px (3 * 4 = 12).
cssReact.CSSPropertiesProperty for specifying css properties in js
positionProperty.PositionCSS `position` property
topnumber | stringCSS `top` property
leftnumber | stringCSS `left` property
bottomnumber | stringCSS `bottom` property
rightnumber | stringCSS `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
inlinebooleanIt manages the `inline-flex` property
reversebooleanAdds the `reverse` property to `flex-direction`
flexWrapbooleanIt manages the `flex-wrap` property
directionProperty.FlexDirectionIt manages the `flex-direction` property
alignItemsProperty.AlignItemsIt manages the `align-items` property
alignContentProperty.AlignContentIt manages the `align-content` property
justifyContentProperty.JustifyContentCSS `justify-content` property
gapProperty.Gap<number>CSS `gap` property
rowGapProperty.RowGap<number>CSS `gap` property
columnGapProperty.ColumnGap<number>CSS `gap` property
scaleIndentnumberMultiplier 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.