Tokens and sizing

Component scale, parent-space behavior, spacing, height, and radius tokens.

FreakUI separates a component's visual scale from the space it occupies. Use FComponentSize for the visual hierarchy, sizing modes for parent-space behavior, and semantic tokens for app-owned spacing and geometry.

Component scale

FComponentSize is a seven-step scale. A component size can change typography, padding, gaps, icons, radius, and control metrics without prescribing the component's width or height.

SizeBodyTitleLabelCaptionNumberIconControl height
.extraExtraSmall.bodyXS.title3XS.labelXS.captionXS.numberXS.icon3XS.height2XS
.extraSmall.bodyS.title2XS.labelS.captionS.numberS.icon2XS.heightXS
.small.bodyM.titleXS.labelM.captionM.numberM.iconXS.heightS
.medium.bodyL.titleS.labelL.captionL.numberL.iconS.heightM
.large.bodyXL.titleM.labelXL.captionXL.numberXL.iconM.heightL
.extraLarge.body2XL.titleL.label2XL.caption2XL.number2XL.iconL.heightXL
.extraExtraLarge.body3XL.titleXL.label3XL.caption3XL.number3XL.iconXL.height2XL
FButton(
    size: .medium,
    horizontalSizingMode: .fillContainer,
    title: "Continue"
) {
    continueFlow()
}

Parent-space sizing

FHorizontalSizingMode and FVerticalSizingMode provide .hugContents, .fillContainer, and .fixed(CGFloat). FContentAlignment aligns content inside a component when the component has extra horizontal space.

Use intrinsic sizing by default, fill when the parent proposes meaningful space, and fixed sizing only for deliberate product or platform geometry.

Spacing tokens

FSpacingScale selects the active density column. All values are points.

TokenXSSMLXL
.paddingNone00000
.paddingFixed111111
.paddingStandard1616161616
.padding4XS02468
.padding3XS246810
.padding2XS4681012
.paddingXS68101214
.paddingS810121416
.paddingM1012141618
.paddingL1214161820
.paddingXL1416182022
.padding2XL1618202224
.padding3XL1820222426
.padding4XL2022242628
.padding5XL2224262830
.paddingFixed323232323232
.paddingFixed484848484848
.paddingFixed565656565656
.paddingFixed727272727272
VStack(spacing: .paddingS) {
    Text("Summary")
    Text("Details")
}
.padding(.paddingL)

Height tokens

Height tokens follow the active FSpacingScale.

TokenXSSMLXL
.height4XS1418222630
.height3XS1822263034
.height2XS2226303438
.heightXS2630343842
.heightS3034384246
.heightM3438424650
.heightL3842465054
.heightXL4246505458
.height2XL4650545862
.height3XL5054586266
.height4XL5458626670
.height5XL5862667074

Radius tokens

FRadiusScale selects the active roundness column. The .none scale resolves every scalable radius to 0; .rounded resolves every scalable radius to 100. The table shows the five intermediate scales.

TokenXSSMLXL
.radiusNone00000
.radiusFixed111111
.radiusStandard68162428
.radius4XS02468
.radius3XS246810
.radius2XS4681012
.radiusXS68101214
.radiusS810121416
.radiusM1012141618
.radiusL1214161820
.radiusXL1416182022
.radius2XL1618202224
.radius3XL1820222426
.radius4XL2022242628
.radius5XL2224262830
.radiusFixed323232323232
.radiusFixed484848484848
RoundedRectangle(cornerRadius: .radiusM)
    .fill(.secondaryBackground)