Skip to content

BeeFlex ​

A flexbox container to align and space items, with an automatic switch to a column on small screens.

ts
import { BeeFlex } from "@thaisrr/beedesign";
import "@thaisrr/beedesign/style.css";

Usage ​

Items go in the default slot. By default they are centered, spaced by lg, and wrap to the next line when there is not enough room.

First
Second
Third

Justify ​

The justify prop sets the distribution along the main axis.

flex-start
OneTwoThree
center
OneTwoThree
flex-end
OneTwoThree
space-between
OneTwoThree

Align ​

The align prop sets the alignment along the cross axis.

flex-start
A
B
C
center
A
B
C
flex-end
A
B
C
stretch
A
B
C

Gap ​

The gap prop accepts a keyword (none, sm, md, lg) tied to the spacing tokens, or a number in pixels.

gap="none"
OneTwoThree
gap="sm"
OneTwoThree
gap="md"
OneTwoThree
gap="lg"
OneTwoThree
:gap="48"
OneTwoThree

Direction ​

With direction="column", items stack vertically.

Responsive ​

By default, below 768px wide, the container switches to a column and centers its items. Turn this off with :responsive="false".

Stacked below 768px
Resize the window
to see the difference

API ​

Props ​

NameTypeDefaultDescription
justify"flex-start" | "flex-end" | "center" | "space-between""center"Distribution along the main axis.
align"flex-start" | "flex-end" | "center" | "stretch""center"Alignment along the cross axis.
direction"row" | "column""row"Direction of the main axis.
gap"none" | "sm" | "md" | "lg" | number"lg"Spacing. A number is in pixels.
responsivebooleantrueSwitches to a centered column below 768px.

Slots ​

NameDescription
defaultItems to lay out.

CSS variables used ​

--bd-space-sm, --bd-space-md, --bd-space-lg.