ArcaneJaspr Codex
Documentation
Display & Layout
Reference for display, position, and flex layout enums
Live Demo
Display.flex
1
2
3
Display.grid (3 columns)
1
2
3
4
5
6
FlexDirection comparison
row
column

Display & Layout#

These enums control the display mode, positioning, and flex/grid layout of elements.

Display#

Controls how an element is displayed.

ValueCSS OutputDescription
nonenoneHidden, removed from layout
blockblockBlock-level element
inlineinlineInline element
inlineBlock inline-block Inline with block behavior
flexflexFlex container
inlineFlexinline-flexInline flex container
gridgridGrid container
inlineGridinline-gridInline grid container
contentscontentsOnly children are rendered
flowRootflow-rootBlock with BFC

Usage#

ArcaneDiv(
  styles: const ArcaneStyleData(
    display: Display.flex,
  ),
  children: [...],
)

Position#

Controls element positioning.

ValueCSS OutputDescription
static_staticDefault positioning
relativerelativeRelative to normal position
absoluteabsoluteRelative to positioned parent
fixedfixedRelative to viewport
stickystickySticky positioning

Usage#

ArcaneDiv(
  styles: const ArcaneStyleData(
    position: Position.absolute,
    raw: {
      'top': '0',
      'right': '0',
    },
  ),
  children: [...],
)

FlexDirection#

Controls the direction of flex items.

ValueCSS OutputDescription
rowrowHorizontal, left to right
rowReverserow-reverseHorizontal, right to left
columncolumnVertical, top to bottom
columnReverse column-reverse Vertical, bottom to top

Usage#

ArcaneDiv(
  styles: const ArcaneStyleData(
    display: Display.flex,
    flexDirection: FlexDirection.column,
  ),
  children: [...],
)

FlexWrap#

Controls whether flex items wrap.

ValueCSS OutputDescription
nowrapnowrapSingle line, may overflow
wrapwrapWrap to multiple lines
wrapReversewrap-reverseWrap in reverse order

AlignItems#

Controls cross-axis alignment of flex/grid items.

ValueCSS OutputDescription
stretchstretchStretch to fill
flexStartflex-startAlign to start
flexEndflex-endAlign to end
centercenterCenter alignment
baselinebaselineAlign baselines

Usage#

ArcaneDiv(
  styles: const ArcaneStyleData(
    display: Display.flex,
    alignItems: AlignItems.center,
  ),
  children: [...],
)

JustifyContent#

Controls main-axis alignment of flex/grid items.

ValueCSS OutputDescription
flexStartflex-startPack at start
flexEndflex-endPack at end
centercenterPack at center
spaceBetween space-between Even spacing, no edge space
spaceAround space-around Even spacing with half edge space
spaceEvenly space-evenly Even spacing including edges

Usage#

ArcaneDiv(
  styles: const ArcaneStyleData(
    display: Display.flex,
    justifyContent: JustifyContent.spaceBetween,
  ),
  children: [...],
)

AlignSelf#

Controls alignment of individual flex/grid items.

ValueCSS OutputDescription
autoautoInherit from parent
stretchstretchStretch to fill
flexStartflex-startAlign to start
flexEndflex-endAlign to end
centercenterCenter alignment
baselinebaselineAlign baseline

CrossAxisAlignment#

Alternative alignment enum (same as AlignItems).

ValueDescription
startAlign to start
endAlign to end
centerCenter alignment
stretchStretch to fill
baselineAlign baselines

Size#

Preset size values for width/height.

ValueCSS OutputDescription
autoautoContent-based size
full100%Full parent size
screen100vhFull viewport height
fitfit-contentFit to content
minmin-contentMinimum content size
maxmax-contentMaximum content size
half50%Half parent size
third33.333%One third
quarter25%One quarter
threeQuarter75%Three quarters

Usage#

ArcaneDiv(
  styles: const ArcaneStyleData(
    width: Size.full,
    height: Size.screen,
  ),
  children: [...],
)

MaxWidth#

Maximum width presets for containers.

ValueCSS OutputDescription
nonenoneNo maximum
card400pxCard width
form480pxForm width
narrowText560pxNarrow text
text640pxText content
narrow768pxNarrow layout
content1024pxMain content
container1280pxPage container
full1440pxFull width

Usage#

ArcaneDiv(
  styles: const ArcaneStyleData(
    maxWidth: MaxWidth.content,
    margin: MarginPreset.autoX,
  ),
  children: [...],
)

MaxHeight#

Maximum height presets for containers.

ValueCSS OutputDescription
nonenoneNo maximum
sm200pxSmall content area
md300pxMedium content area
lg400pxLarge content area
codeBlock500pxCode block height
xl600pxExtra large
modal80vhModal height
screen100vhFull screen

MinWidth#

Minimum width presets.

ValueCSS OutputDescription
none0No minimum
touchTarget44pxMinimum touch target
sm100pxSmall minimum
md200pxMedium minimum
lg300pxLarge minimum

Overflow#

Controls overflow behavior.

ValueCSS OutputDescription
visiblevisibleContent visible outside
hiddenhiddenContent clipped
scrollscrollAlways show scrollbars
autoautoScrollbars when needed
clipclipClip without scroll

OverflowAxis#

Per-axis overflow control (for overflowX/overflowY).

ValueCSS OutputDescription
visiblevisibleContent visible
hiddenhiddenContent clipped
scrollscrollAlways scrollable
autoautoScrollable when needed
clipclipClip without scroll

Visibility#

Controls element visibility.

ValueCSS OutputDescription
visiblevisibleElement visible
hiddenhiddenHidden but takes space
collapsecollapseCollapsed (table rows)

ZIndex#

Semantic z-index layers.

ValueCSS OutputDescription
autoautoDefault stacking
below-1Below content
base0Base layer
dropdown1000Dropdowns
sticky1020Sticky elements
fixed1030Fixed elements
fab1035FABs
modalBackdrop1040Modal backdrops
modal1050Modals
popover1060Popovers
tooltip1070Tooltips
toast1080Toasts

ObjectFit#

Controls how replaced content (images) fits.

ValueCSS OutputDescription
containcontainScale to fit, preserve aspect
covercoverScale to cover, may crop
fillfillStretch to fill
nonenoneOriginal size
scaleDownscale-downSmaller of none/contain

ObjectPosition#

Controls position of replaced content.

ValueCSS OutputDescription
centercenterCentered
toptopTop edge
bottombottomBottom edge
leftleftLeft edge
rightrightRight edge
topLefttop leftTop-left corner
topRighttop rightTop-right corner
bottomLeftbottom leftBottom-left corner
bottomRightbottom rightBottom-right corner