Search the documentation

Type to search page titles, component names and descriptions.

    Design

    Spacing and size

    One spacing scale, control heights and the radii of each level.

    Spacing is a single 4-pixel scale with half steps for tight places. A component uses it for its inside; a parent Stack, Inline or Grid uses it for the gaps between its children.

    #Spacing by level

    Deeper is tighter. Each level has a named token, so a region does not invent its own inset.

    WhereTokenDesktop value
    Between regions of a page--faifo-layout-gap, --faifo-gap-section12px
    Page side padding--faifo-page-padding-x12px
    Inside a working surface--faifo-surface-inset16px
    Heading to its content--faifo-surface-head-gap8px
    Between form rows--faifo-gap-form-row16px
    Between form columns--faifo-gap-form-column24px
    Between controls in a row--faifo-gap-control8px

    On a phone --faifo-layout-gap drops to 8px and --faifo-surface-inset to 12px; pages keep the same gutter on every side of their content.

    #Controls

    A default action is as high as an input, so a button lines up with the field beside it.

    SizeTokenValue
    Default control--faifo-control-height32px
    Compact--faifo-control-height-compact28px
    Touch target--faifo-touch-target44px
    Table row--faifo-table-row-height40px

    data-density="compact" or data-density="comfortable" on a data-faifo-design scope shifts the density tokens for everything inside it.

    #A control as wide as its value

    A control fills its column by default, which suits a name, an address or a note. A value of a few characters in a wide form reads lost in an empty box, so the field states how long its value is with width; the control keeps to the start of its column at that width and never grows past the column. Label, help and error keep their own tracks, so a short control still lines up with the fields above it. Field, TextField, NumberField, MoneyField, DatePicker and Combobox accept it.

    widthControlFor
    xs7rema rate, a percentage, a count of days or months
    sm11reman amount, a quantity, a date, a reference, a barcode, a phone number
    md18rema short choice: a unit, a group, a warehouse, a tax
    nonethe columna name, a long choice (an account), an address, a description
    <MoneyField id="price" name="price" label="Sales price" currency="VND" width="sm" />
    <Field id="shelf-life" name="shelfLife" label="Shelf life" type="number" width="xs" />

    Choose it from the value's length, not from the space left on the row. Specimen: field-width.

    In an Inline row (a toolbar's search, a quantity between a minus and a plus button) there is no column to fill, so a sized field starts at its width and shrinks only when the row runs out of room, never below 4rem. Without width a field in a row takes what its control measures. A row whose fields all hide their label (labelHidden) is not a container for the label rule, so a row sized by its content, such as a quantity stepper at the end of a card, keeps its width.

    #Shape

    Radii grow with the level: --faifo-radius-xs and -sm for small marks and controls inside rows, --faifo-control-radius for controls, --faifo-radius-md and -lg for surfaces and overlays, --faifo-radius-full for pills.

    TokenValueGroup
    --faifo-radius-xs0.1875remShape
    --faifo-radius-sm0.3125remShape
    --faifo-radius-md0.4375remShape
    --faifo-radius-lg0.5625remShape
    --faifo-radius-xl0.75remShape
    --faifo-radius-full9999pxShape
    --faifo-radius-app-region0Shape

    #Spacing tokens

    TokenValueGroup
    --faifo-space-00Spacing
    --faifo-space-0-50.125remSpacing
    --faifo-space-10.25remSpacing
    --faifo-space-1-50.375remSpacing
    --faifo-space-20.5remSpacing
    --faifo-space-2-50.625remSpacing
    --faifo-space-30.75remSpacing
    --faifo-space-41remSpacing
    --faifo-space-51.25remSpacing
    --faifo-space-61.5remSpacing
    --faifo-space-71.75remSpacing
    --faifo-space-82remSpacing
    --faifo-space-102.5remSpacing
    --faifo-space-123remSpacing
    --faifo-space-164remSpacing
    --faifo-gap-controlvar(--faifo-space-2)Spacing
    --faifo-gap-form-rowvar(--faifo-space-4)Spacing
    --faifo-gap-field-groupvar(--faifo-space-4)Spacing
    --faifo-gap-form-columnvar(--faifo-space-6)Spacing
    --faifo-layout-gap0.75remSpacing
    --faifo-gap-sectionvar(--faifo-layout-gap)Spacing
    --faifo-surface-insetvar(--faifo-space-4)Spacing
    --faifo-surface-head-gapvar(--faifo-space-2)Spacing
    --faifo-page-padding-xvar(--faifo-layout-gap)Spacing
    --faifo-page-padding-yvar(--faifo-space-5)Spacing

    #Dimension tokens

    TokenValueGroup
    --faifo-touch-target2.75remDimensions
    --faifo-app-topbar-height3remDimensions
    --faifo-help-width32remDimensions
    --faifo-control-height-xs1.5remDimensions
    --faifo-control-height-sm1.75remDimensions
    --faifo-control-height-md2remDimensions
    --faifo-control-height-lg2remDimensions
    --faifo-control-radius0.5remDimensions
    --faifo-control-padding-blockvar(--faifo-space-1-5)Dimensions
    --faifo-control-padding-inlinevar(--faifo-space-3)Dimensions
    --faifo-action-heightvar(--faifo-control-height-md)Dimensions
    --faifo-control-heightvar(--faifo-control-height-md)Dimensions
    --faifo-control-height-compactvar(--faifo-control-height-sm)Dimensions
    --faifo-control-height-prominentvar(--faifo-control-height-lg)Dimensions
    --faifo-density-control-heightvar(--faifo-control-height-md)Dimensions
    --faifo-density-row-height2.5remDimensions
    --faifo-density-content-gapvar(--faifo-space-4)Dimensions
    --faifo-app-switcher-width3remDimensions
    --faifo-sidebar-width14.25remDimensions
    --faifo-right-rail-width21.25remDimensions
    --faifo-reading-width75remDimensions
    --faifo-sidebar-item-height1.875remDimensions
    --faifo-sidebar-child-height1.75remDimensions
    --faifo-sidebar-icon-sizevar(--faifo-space-5)Dimensions
    --faifo-sidebar-indentvar(--faifo-space-5)Dimensions
    --faifo-table-row-height2.5remDimensions
    --faifo-table-header-height2.625remDimensions
    --faifo-table-text-max-width28remDimensions
    --faifo-table-text-min-width12remDimensions
    --faifo-table-text-wide-min-width18remDimensions
    --faifo-row-heightvar(--faifo-table-row-height)Dimensions
    --faifo-container-field-narrow42remDimensions
    --faifo-container-rail-collapse64remDimensions
    --faifo-container-page-wide80remDimensions