GlobalStacks logo GlobalStacks Extensions
Open app
Extensions

Style Extension UI

Style GlobalStacks extension views with approved tokens, layout props, spacing, sizing, and preset component styles.

Style extension UI

GlobalStacks extensions render inside sandboxed console iframes. Extension views can style approved layout components with GlobalStacks tokens, while interactive and semantic components keep preset styles so extension UI continues to match the console.

This page describes the extension styling API. Use the design system page for product-level visual rules and the component library for per-component props.

Styling model

Extension style is intentionally narrower than browser CSS:

  • Style only approved layout primitives such as Box, Inline, and Stack.
  • Use token values instead of arbitrary colors, fonts, shadows, or breakpoints.
  • Use preset component props for buttons, badges, alerts, inputs, tables, and data grids.
  • Keep all style props serializable.
  • Do not rely on parent DOM access, global stylesheets, custom fonts, or browser storage.
Terminal
<Box
  style={{
    backgroundColor: "surface",
    border: "soft",
    padding: "medium",
    radius: "md",
  }}
>
  <Text variant="heading">Cluster storage</Text>
</Box>

Custom styles

Box, Inline, and Stack can accept a limited style object. The renderer validates this object before applying it in the iframe.

PropertyValues
backgroundColorBackground color tokens.
borderBorder tokens.
colorText and icon color tokens.
fontTypography tokens.
fontWeightregular, medium, semibold, bold, black.
paddingSpacing tokens.
marginSpacing tokens.
gapSpacing tokens.
radiusRadius tokens.
widthSizing tokens.
heightSizing tokens.
overflowX / overflowYvisible, hidden, scroll, auto.
textAlignstart, center, end.
textOverflowclip, ellipsis.
whiteSpacenormal, nowrap, pre-wrap.
overflowWrapnormal, anywhere.

Unsupported CSS is ignored or rejected by the SDK validator. Do not use custom selectors, pseudo-classes, keyframes, media queries, global CSS, or arbitrary style strings.

Color

Use semantic tokens so dark mode, light mode, and future themes can render extension UI consistently.

Backgrounds

TokenUse
canvasThe iframe base surface.
surfaceDefault panels and grouped content.
surfaceElevatedHoverable or raised content areas.
surfaceMutedLow-emphasis inset areas.
successMutedSuccess background.
warningMutedWarning background.
dangerMutedError or destructive background.
infoMutedInformational background.

Borders

TokenUse
softDefault separation.
strongFocus, selected, or important boundaries.
successPositive state.
warningWarning state.
dangerError or destructive state.
infoInformational state.

Text and icons

TokenUse
defaultPrimary text.
mutedSecondary labels and captions.
mutedStrongSupporting text that must remain readable.
successReady, connected, complete.
warningPending, degraded, unverified.
dangerFailed, blocked, denied.
infoIn progress or diagnostic.

Typography

Extensions use the console typography scale. Do not import custom fonts.

TokenUse
bodyDefault interface text.
headingSection headings inside panels.
captionLabels, metadata, and helper text.
monoIDs, commands, endpoints, and digests.

Use fontWeight only when hierarchy needs it. Avoid oversized headings inside compact extension viewports.

Text overflow

Generated values often exceed the viewport. Use explicit overflow behavior:

Terminal
<Text variant="mono" style={{ overflowWrap: "anywhere" }}>
  gssbx_01JZ8Z3Y8QK7V6M2R9B4X5N0PA
</Text>

Use ellipsis only when the full value is available in a tooltip, details row, or copy action.

Layout

GlobalStacks layouts are stack-based. Use layout props instead of hand-written CSS grids unless the component specifically supports columns.

Horizontal stack

Terminal
<Stack direction="x" gap="small" alignY="center" wrap>
  <Badge tone="success">ready</Badge>
  <Badge tone="muted">private</Badge>
</Stack>

Vertical stack

Terminal
<Stack direction="y" gap="medium">
  <Text variant="heading">Storage backend</Text>
  <Text tone="muted">R2-backed storage for this cluster.</Text>
</Stack>

Layout properties

PropertyValues
directionx, y, z.
alignXstart, center, end, stretch.
alignYtop, center, baseline, bottom, stretch.
distributepacked, space-between.
gapSpacing tokens.
wraptrue, false.
overflowX / overflowYvisible, hidden, scroll, auto.

Spacing

Use spacing tokens for margin, padding, and layout gaps.

TokenValue
00px
xxsmall2px
xsmall4px
small8px
medium16px
large24px
xlarge32px
xxlarge48px

Compact extension panes should usually use small or medium. Reserve large spacing for full-page extension views.

Sizing

Use fractions and content-based sizing tokens. Avoid viewport-relative font sizing.

TokenValue
00px
1/250%
1/3, 2/333.333333%, 66.666667%
1/4, 2/4, 3/425%, 50%, 75%
1/5, 2/5, 3/5, 4/520%, 40%, 60%, 80%
1/6, 2/6, 3/6, 4/6, 5/616.666667%, 33.333333%, 50%, 66.666667%, 83.333333%
fill100%
minMinimum content size.
maxMaximum content size.
fitFit available space up to content size.

Radius

Use radius tokens consistently:

TokenUse
noneFlush table or full-bleed iframe surfaces.
smCompact rows and chips.
mdButtons and normal panels.
lgLarger grouped panels.
fullPills, badges, and circular icon controls.

Preset component styles

Most components do not accept custom visual styles. They expose constrained props instead.

ComponentStyling control
Buttonvariant, size, disabled, loading.
Badgetone.
Alerttone, optional title.
Progressvalue, optional label.
TextInputLabel, helper text, disabled, error state.
SelectLabel, options, disabled, error state.
DataGridColumn type, alignment, pinned columns, empty/loading states.
TableColumn alignment and static row values.

Preset styles preserve keyboard behavior, accessibility, theme mapping, and consistent visual hierarchy.

Restrictions

Extension style props are serialized across the iframe bridge, so the following are unsupported:

  • Arbitrary HTML elements inside GlobalStacks UI components.
  • React refs on renderer-owned components.
  • DOM measurement, direct focus management, or parent-window DOM access.
  • Custom CSS classes, external stylesheets, keyframes, or global selectors.
  • Render functions as component props.
  • Non-serializable prop values such as Map, Set, class instances, or circular data.
  • Event propagation control from extension handlers.

Use uncontrolled form fields when possible. Controlled inputs can feel laggy because input data crosses the iframe bridge asynchronously.

See also