Skip to content

Standard Catalog Reference

The Standard Catalog (@freesail/standard-catalog) provides the baseline set of UI components and client-side functions for Freesail surfaces.

Catalog ID: https://freesail.dev/catalogs/standard-catalog.json


import { ReactUI } from 'freesail';
import { StandardCatalog } from '@freesail/standard-catalog';
<ReactUI.FreesailProvider
theme={ReactUI.defaultLightTokens}
catalogs={[StandardCatalog]}
>
<App />
</ReactUI.FreesailProvider>

The catalog namespace is exported as StandardCatalog.namespace — use this as the catalogId when calling create_surface.


Use the show and hide functions to toggle component visibility dynamically. These write to the client-side __componentState path and take effect immediately without a round-trip to the agent.

{
"id": "open_modal_btn",
"component": "Button",
"label": "Open",
"action": {
"functionCall": {
"call": "show",
"args": { "componentId": "my_modal" }
}
}
}

The visible property on any component can also be bound to the data model for agent-controlled visibility.


Every component inherits these properties from ComponentCommon:

PropertyTypeRequiredDescription
idComponentIdUnique identifier within the surface
componentstringComponent type name (e.g. 'Text', 'Button')
visibleDynamicBooleanControls rendering (default true). Use show/hide functions for dynamic control.
widthDynamicStringCSS width. Use '100%' for full parent width, px for small fixed elements. Prefer weight for proportional sizing.
heightDynamicStringCSS height. Prefer minHeight over fixed height so elements can grow.
weightDynamicNumberFlex-grow equivalent. Only valid as a direct child of Row or Column.
flexBasisDynamicStringDefines the wrap breakpoint in a Row (e.g. '300px').
minWidthDynamicStringHard minimum width floor after wrapping.
minHeightDynamicStringHard minimum height floor (e.g. '300px' for a chart card).
accessibilityobject{ label, description } for screen readers.

Arranges children vertically.

PropertyTypeRequiredDescription
childrenChildListChild component IDs or template
gapDynamicStringSpacing: none | sm | md | lg | xl or CSS length (default sm)
paddingDynamicStringPadding around content
justifystringMain axis: start | center | end | spaceBetween | spaceAround | spaceEvenly | stretch
alignstringCross-axis: start (default) | center | end | stretch. Set to stretch for list layouts.
themeThemeDesign token overrides cascading to all children

Arranges children horizontally. Wraps by default.

PropertyTypeRequiredDescription
childrenChildListChild component IDs or template
gapDynamicStringSpacing: none | sm | md | lg | xl or CSS length (default sm)
paddingDynamicStringPadding around content
justifystringMain axis: start | center | end | spaceBetween | spaceAround | spaceEvenly | stretch
alignstringCross-axis: start | center | end | stretch. Use end when mixing labelled inputs with unlabelled Buttons.
wrapstringwrap (default) | nowrap | wrap-reverse
themeThemeDesign token overrides cascading to all children

A styled container with border and optional shadow. Two variants: raised (default — elevated with shadow and rounded corners) and flat (no shadow, square corners, blends with main surface background).

PropertyTypeRequiredDescription
childComponentIdID of the single child component. Wrap multiple elements in a Column/Row.
variantstringraised (default) | flat
borderWeightnumberBorder thickness in pixels (default 1; set to 0 to remove)
paddingDynamicStringInternal padding (default '16px')
alignstringCross-axis alignment of children: start | center | end | stretch (default)
justifystringMain-axis distribution: start (default) | center | end | between | around
zoomablebooleanWhen true, adds a zoom toggle that opens the card in a centred modal overlay
themeThemeDesign token overrides for the card and all content inside

A responsive auto-fill grid. Each column is at least minItemWidth wide; the browser fills as many columns as fit. Use for card galleries, icon grids, and tile layouts.

PropertyTypeRequiredDescription
childrenChildListChild component IDs or template
minItemWidthDynamicStringMinimum column width (default '200px')
gapDynamicStringGap between items

A fixed-column grid with optional header row and alternating row styling. Collapses to a single column on narrow containers (< 480px). Row content is composed using Row and Text components via the children template.

PropertyTypeRequiredDescription
childrenChildListTemplate pointing to a Row component and a data path
columnsnumberFixed column count (required when headers is absent)
headersDynamicString[]Column header labels. Length sets the column count.
columnWeightsnumber[]Fractional width weights per column. Defaults to equal sizing.
rowPaddingDynamicStringCell padding (default '10px 16px')
showGridLinesbooleanRow separators (default true)
gapDynamicStringGap between items
themeThemeToken overrides: bgMuted → header row, bgRaised → odd rows, bg → even rows, border → separators

When placing TextField or Dropdown components inside a TabularGrid, omit the label prop — the column headers already act as labels.

A scrollable list of children, vertical or horizontal.

PropertyTypeRequiredDescription
childrenChildListChild component IDs or template
directionstringvertical (default) | horizontal
alignstringCross-axis alignment

Tabbed container. TabGroup holds Tab children; one tab is visible at a time.

TabGroup:

PropertyTypeRequiredDescription
childrenComponentId[]Array of Tab component IDs

Tab:

PropertyTypeRequiredDescription
titleDynamicStringTab label
childComponentIdContent component ID

A modal overlay controlled by show/hide functions. Must be included in the parent layout’s children array to render (it renders as a fixed overlay regardless of its tree position). Visibility defaults to false. Includes a close button.

PropertyTypeRequiredDescription
childComponentIdComponent shown inside the modal
themeThemeToken overrides: bgRaised → modal panel background, textForeground → modal text

A horizontal or vertical separator line.

PropertyTypeRequiredDescription
axisstringhorizontal (default) | vertical

An empty space for layout purposes.

PropertyTypeRequiredDescription
widthDynamicStringWidth (default '16px')
heightDynamicStringHeight (default '16px')

Renders text content with Markdown support (bold, italic, links, inline code — no HTML, images, or headings inside Markdown). Heading variants (h1h5) render as native heading elements.

PropertyTypeRequiredDescription
textDynamicStringText content
variantstringh1 | h2 | h3 | h4 | h5 | caption | body (default)
sizeDynamicStringCSS font-size override (e.g. '12px', '1.2rem')
fontWeightDynamicStringCSS font-weight override (e.g. 'bold', '500')
colorDynamicStringCSS color or semantic token name

Displays a Material Symbols icon. The font is auto-injected on first render.

PropertyTypeRequiredDescription
namestringMaterial Symbols name in camelCase (e.g. 'home', 'accountCircle'). Brand/social icons are not available.
sizeDynamicStringSemantic size (sm | md | lg | xl | 2xl | 3xl | 4xl) or CSS length (default lg)
colorDynamicStringCSS color or semantic token

Displays an image from a URL (http/https only; invalid URLs show a placeholder).

PropertyTypeRequiredDescription
urlDynamicStringImage URL
fitstringCSS object-fit: contain (default) | cover | fill | none | scale-down
variantstringicon | avatar | smallFeature | mediumFeature | largeFeature | header

Plays a video. Set embed: true for YouTube and Vimeo URLs — the component detects the source and generates the correct embed URL automatically.

PropertyTypeRequiredDescription
urlDynamicStringVideo URL
embedbooleantrue for YouTube/Vimeo; false (default) for direct file URLs (.mp4, .webm)

Plays audio. Set embed: true for Spotify and SoundCloud URLs.

PropertyTypeRequiredDescription
urlDynamicStringAudio URL
descriptionDynamicStringTitle or summary shown above the player
embedbooleantrue for Spotify/SoundCloud; false (default) for direct file URLs (.mp3, .wav)

Renders a bar chart. Supports vertical (default) and horizontal orientations.

PropertyTypeRequiredDescription
dataarray | DataBindingArray of { label, value, color? } objects
titleDynamicStringChart title
orientationstringvertical (default) | horizontal
colorDynamicStringDefault bar color (CSS)
showValuesDynamicBooleanShow value labels on bars (default true)
chartHeightDynamicNumberChart height in pixels (default 300)

Renders a line chart. Good for showing trends over time.

PropertyTypeRequiredDescription
dataarray | DataBindingArray of { label, value } objects (minimum 2 points)
titleDynamicStringChart title
colorDynamicStringLine color (default '#2563eb')
showDotsDynamicBooleanShow data point circles (default true)
showAreaDynamicBooleanFill area under the line (default false)
chartHeightDynamicNumberChart height in pixels (default 300)

Renders a pie or donut chart. Colors are auto-assigned if not provided per segment.

PropertyTypeRequiredDescription
dataarray | DataBindingArray of { label, value, color? } objects
titleDynamicStringChart title
donutDynamicBooleanRender as donut chart (default false)
sizeDynamicNumberChart diameter in pixels (default 250)
alignstringHorizontal alignment: start (default) | center | end

A compact inline sparkline chart from an array of numbers. Use inside StatCard or alongside text.

PropertyTypeRequiredDescription
valuesnumber[] | DataBindingNumeric trend data (minimum 2 values)
colorDynamicStringLine color (default '#2563eb')

A KPI summary card with a large value, label, and optional trend indicator. Use multiple StatCard components in a Row to build a dashboard header.

PropertyTypeRequiredDescription
labelDynamicStringMetric label (e.g. 'Total Revenue')
valueDynamicStringFormatted display value (e.g. '$12,340', '98%')
trendstringup | down | neutral
trendValueDynamicStringChange text next to the arrow (e.g. '+12%')
trendColorDynamicStringColor of the trend arrow
colorDynamicStringAccent color for the card’s left border
childrenChildListOptional children below the stat value (e.g. a Sparkline)

A clickable button that triggers a server-side action or a local client-side function.

PropertyTypeRequiredDescription
actionActionServer event or local function call
labelDynamicStringText label (used if child is not provided)
childComponentIdID of a child component (e.g. an Icon)
variantstringprimary (default) | secondary | outline | borderless | danger
checksCheckRule[]Client-side validation — button is disabled if any check fails

A text input field.

PropertyTypeRequiredDescription
placeholderDynamicStringHint text shown inside the input when empty
valueDynamicStringData binding for the input value
labelDynamicStringLabel shown above the input. Use in stacked Column forms; omit in inline Row forms.
variantstringshortText (default) | longText | number | obscured
minDynamicNumberMinimum value (number variant only)
maxDynamicNumberMaximum value (number variant only)
checksCheckRule[]Client-side validation rules

A checkbox toggle for boolean values.

PropertyTypeRequiredDescription
labelDynamicStringLabel text
valueDynamicBooleanData binding for the checked state
checksCheckRule[]Client-side validation rules

Selects exactly one option from a list.

PropertyTypeRequiredDescription
optionsarray | DataBindingArray of { label, value } objects
valueDynamicStringData binding for the selected value (string)
labelDynamicStringGroup label
variantstringradio (default) | chips
checksCheckRule[]Client-side validation rules

Selects one or more options from a list.

PropertyTypeRequiredDescription
optionsarray | DataBindingArray of { label, value } objects
valueDynamicStringListData binding for the selected values (string array)
labelDynamicStringGroup label
variantstringcheckbox (default) | chips
checksCheckRule[]Client-side validation rules

A select dropdown for choosing a single option.

PropertyTypeRequiredDescription
optionsarray | DataBindingArray of { label, value } objects
valueDynamicStringData binding for the selected value
labelDynamicStringLabel text
placeholderDynamicStringPlaceholder when no option is selected (default 'Select an option')
checksCheckRule[]Client-side validation rules

A date picker. Supports single date or date-range (from/to) selection. Emits ISO 8601 date strings with no time component. For time selection, use a TimeInput separately.

PropertyTypeRequiredDescription
valueDynamicStringListArray of ISO 8601 date strings bound to the data model. Initialise to []. Single mode: ["YYYY-MM-DD"]. Range mode: ["YYYY-MM-DD", "YYYY-MM-DD"].
modestringsingle (default) | range
minDynamicStringEarliest selectable date (ISO 8601)
maxDynamicStringLatest selectable date (ISO 8601)
labelDynamicStringLabel text
checksCheckRule[]Client-side validation rules

A standalone time picker with hour/minute spinners. Use alongside a DateInput when you need separate date and time controls.

PropertyTypeRequiredDescription
valueDynamicStringListSingle-element array holding "HH:MM" in 24-hour format. Initialise to [].
labelDynamicStringLabel text
timeStepnumber | DataBindingMinute increment (default 1). Use 15 or 30 for slot-based selection.
timeFormatstring | DataBinding24h (default) | 12h
checksCheckRule[]Client-side validation rules

A slider for selecting a numeric value within a range. Supports multi-thumb for range selection.

PropertyTypeRequiredDescription
valueDynamicNumber | number[]Single number for one thumb, or an array (e.g. [20, 80]) for multi-thumb range.
minnumberMinimum value
maxnumberMaximum value
stepnumberStep increment (default 1)
labelDynamicStringLabel text
checksCheckRule[]Client-side validation rules

Container components (Row, Column, Card, Modal, TabularGrid) accept a theme prop — a Theme object that overrides design tokens as CSS custom properties (--freesail-*) on the component’s root element, cascading to all descendants. This enables dynamic theme changes without recreating the surface.

TokenCSS variableDescription
bg--freesail-bgBase surface background
bgRaised--freesail-bg-raisedElevated surface background (Card raised variant)
bgMuted--freesail-bg-mutedMuted/subtle background
textForeground--freesail-text-foregroundPrimary text colour
textSecondary--freesail-text-secondarySecondary text colour
primary--freesail-primaryBrand accent (buttons, links)
primaryHover--freesail-primary-hoverHover state for primary
primaryForeground--freesail-primary-foregroundText on primary backgrounds
border--freesail-borderBorders and dividers

All values are DynamicString — they accept CSS colour values, data bindings, or function calls.

{
"id": "root",
"component": "Row",
"children": ["hero_content"],
"theme": {
"bg": "#1a2a4a",
"textForeground": "#ffffff",
"primary": "#60a5fa"
}
}

FunctionReturnsDescription
required(value)booleantrue if value is not null, undefined, empty string, or empty array
email(value)booleantrue if value is a valid email address
regex(value, pattern)booleantrue if value matches the regex pattern
checkLength(value, { min?, max? })booleantrue if string/array length satisfies the constraints
numeric(value, { min?, max? })booleantrue if numeric value satisfies the constraints
FunctionReturnsDescription
getLength(value)numberNumber of characters (string), elements (array), or 0 (null/undefined)
FunctionReturnsDescription
formatString(template, ...args)stringInterpolates ${/path} and ${funcName()} expressions; also supports positional {0}, {1} placeholders
formatNumber(value, fractionDigits?, useGrouping?)stringLocale-aware number formatting
formatCurrency(value, currency)stringFormats a number as a currency string (e.g. '$1,234.56')
formatDate(value, pattern)stringFormats a date/time using a Unicode TR35 pattern
pluralize(count, { zero?, one?, two?, few?, many?, other })stringReturns the CLDR-appropriate plural form
now()stringCurrent date and time as ISO 8601
FunctionReturnsDescription
and(...values)booleantrue if all arguments are truthy
or(...values)booleantrue if any argument is truthy
isEmpty(value)booleantrue if null, undefined, empty string, empty array, or empty object
FunctionReturnsDescription
eq(a, b)booleanStrict equality
neq(a, b)booleanStrict inequality
gt(a, b)booleana > b (numeric or date comparison)
gte(a, b)booleana >= b
lt(a, b)booleana < b
lte(a, b)booleana <= b
FunctionReturnsDescription
show(componentId)voidMakes a component visible (writes to client-side __componentState)
hide(componentId)voidMakes a component invisible (writes to client-side __componentState)
openUrl(url)voidOpens a URL in a new browser tab (http/https only)
TokenExample output
yyyy2026
yy26
MMMMJanuary
MMMJan
MM01
M1
dd09
d9
EEEETuesday
ETue
HH14 (24h)
hh02 (12h)
mm30
ss05
aPM

Components that accept a color property support semantic token names in addition to CSS values:

Token nameCSS variableUsage
textForeground--freesail-text-foregroundPrimary text colour
textSecondary--freesail-text-secondarySecondary text colour
primary--freesail-primaryBrand accent
primaryHover--freesail-primary-hoverHover state
primaryForeground--freesail-primary-foregroundText on primary background
error--freesail-errorError / danger
success--freesail-successSuccess
warning--freesail-warningWarning
info--freesail-infoInformational

For background properties, these additional tokens are also available:

Token nameCSS variableUsage
bg--freesail-bgPage/surface background
bgRaised--freesail-bg-raisedCard/panel background
bgMuted--freesail-bg-mutedSubtle background fills
bgOverlay--freesail-bg-overlayModal/dialog overlay backdrop