Skip to content
pixi-silk
GitHub repository
Interface

SmartStyle

import type { SmartStyle } from 'pixi-silk/ui/layout';

A flex style plus how a child sits in its slot.

Extends#

Extended by#

Properties#

PropertyTypeDescriptionInherited fromDefined in
alignContent?AlignContentLine distribution of a wrapping container. Default stretch.LayoutStyle.alignContentlayout/style.ts:82
alignItems?AlignItemsCross axis alignment of the children. Default stretch.LayoutStyle.alignItemslayout/style.ts:76
alignSelf?"auto" | AlignItemsCross axis alignment of this node, over its parent’s alignItems.LayoutStyle.alignSelflayout/style.ts:78
animate?booleanGlide this child to new slots. Default the container’s transition.-ui/layout/flex-container.ts:33
aspectRatio?numberWidth divided by height. Sizes the missing axis when only one is known.LayoutStyle.aspectRatiolayout/style.ts:102
basis?LengthMain size before growing or shrinking. Default auto (the width or height, else the content).LayoutStyle.basislayout/style.ts:88
bottom?LengthDistance from the parent’s bottom edge, for position: 'absolute'.LayoutStyle.bottomlayout/style.ts:108
columnGap?numberSpace between columns. Overrides gap.LayoutStyle.columnGaplayout/style.ts:54
direction?FlexDirectionMain axis. Default row.LayoutStyle.directionlayout/style.ts:46
display?"none" | "flex"none takes the node out of layout: it gets a zero box. Default flex.LayoutStyle.displaylayout/style.ts:42
fit?FitModeHow the child scales into its slot. Default none.-ui/layout/flex-container.ts:17
fitAlign?readonly [number, number]Where the child sits in its slot, 0 to 1 per axis. Default [0.5, 0.5], the centre.-ui/layout/flex-container.ts:19
gap?numberSpace between items and between lines, in pixels. Default 0.LayoutStyle.gaplayout/style.ts:50
grow?numberShare of the free space this item takes. Default 0.LayoutStyle.growlayout/style.ts:84
height?LengthBorder-box height. Default auto.LayoutStyle.heightlayout/style.ts:92
inset?LengthSets top, right, bottom and left at once. The single sides override it.LayoutStyle.insetlayout/style.ts:112
justifyContent?JustifyContentMain axis distribution of the free space. Default start.LayoutStyle.justifyContentlayout/style.ts:80
left?LengthDistance from the parent’s left edge, for position: 'absolute'.LayoutStyle.leftlayout/style.ts:110
margin?Edges<Length>Space outside the box. 'auto' takes up free space, which centres or pushes the item.LayoutStyle.marginlayout/style.ts:66
marginBottom?LengthBottom margin. Overrides margin.LayoutStyle.marginBottomlayout/style.ts:72
marginLeft?LengthLeft margin. Overrides margin.LayoutStyle.marginLeftlayout/style.ts:74
marginRight?LengthRight margin. Overrides margin.LayoutStyle.marginRightlayout/style.ts:70
marginTop?LengthTop margin. Overrides margin.LayoutStyle.marginToplayout/style.ts:68
maxHeight?LengthLargest height. Default none.LayoutStyle.maxHeightlayout/style.ts:100
maxScale?numberLargest fit scale. Default no limit.-ui/layout/flex-container.ts:23
maxWidth?LengthLargest width. Default none.LayoutStyle.maxWidthlayout/style.ts:98
measure?(child: Container, availableWidth: number, availableHeight: number) => SizeMeasures the child for the space offered. Default its local bounds, whatever the space.-ui/layout/flex-container.ts:25
minHeight?LengthSmallest height. Default 0.LayoutStyle.minHeightlayout/style.ts:96
minScale?numberSmallest fit scale. With fit: 'scale-down' it is the text shrink-to-fit floor. Default 0.-ui/layout/flex-container.ts:21
minWidth?LengthSmallest width. Default 0.LayoutStyle.minWidthlayout/style.ts:94
onSize?(width: number, height: number, child: Container) => voidCalled with the slot size whenever it changes, so the child can redraw at that size (a panel background, a bar). A child with onSize and no measure measures as 0 by 0, so give it a size, grow or inset.-ui/layout/flex-container.ts:31
padding?Edges<number | `${number}%`>Space inside the box. Percents are of the parent’s width, as in CSS.LayoutStyle.paddinglayout/style.ts:56
paddingBottom?number | `${number}%`Bottom padding. Overrides padding.LayoutStyle.paddingBottomlayout/style.ts:62
paddingLeft?number | `${number}%`Left padding. Overrides padding.LayoutStyle.paddingLeftlayout/style.ts:64
paddingRight?number | `${number}%`Right padding. Overrides padding.LayoutStyle.paddingRightlayout/style.ts:60
paddingTop?number | `${number}%`Top padding. Overrides padding.LayoutStyle.paddingToplayout/style.ts:58
position?"relative" | "absolute"absolute places the node against its parent’s box with top, right, bottom and left.LayoutStyle.positionlayout/style.ts:44
right?LengthDistance from the parent’s right edge, for position: 'absolute'.LayoutStyle.rightlayout/style.ts:106
rowGap?numberSpace between lines (rows). Overrides gap.LayoutStyle.rowGaplayout/style.ts:52
shrink?numberShare of the overflow this item gives up, weighted by its basis. Default 1.LayoutStyle.shrinklayout/style.ts:86
top?LengthDistance from the parent’s top edge, for position: 'absolute'.LayoutStyle.toplayout/style.ts:104
width?LengthBorder-box width. Default auto.LayoutStyle.widthlayout/style.ts:90
wrap?"nowrap" | "wrap" | "wrap-reverse"Break items into several lines when they overflow. Default nowrap.LayoutStyle.wraplayout/style.ts:48