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, andStack. - 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.
<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.
| Property | Values |
|---|---|
backgroundColor | Background color tokens. |
border | Border tokens. |
color | Text and icon color tokens. |
font | Typography tokens. |
fontWeight | regular, medium, semibold, bold, black. |
padding | Spacing tokens. |
margin | Spacing tokens. |
gap | Spacing tokens. |
radius | Radius tokens. |
width | Sizing tokens. |
height | Sizing tokens. |
overflowX / overflowY | visible, hidden, scroll, auto. |
textAlign | start, center, end. |
textOverflow | clip, ellipsis. |
whiteSpace | normal, nowrap, pre-wrap. |
overflowWrap | normal, 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
| Token | Use |
|---|---|
canvas | The iframe base surface. |
surface | Default panels and grouped content. |
surfaceElevated | Hoverable or raised content areas. |
surfaceMuted | Low-emphasis inset areas. |
successMuted | Success background. |
warningMuted | Warning background. |
dangerMuted | Error or destructive background. |
infoMuted | Informational background. |
Borders
| Token | Use |
|---|---|
soft | Default separation. |
strong | Focus, selected, or important boundaries. |
success | Positive state. |
warning | Warning state. |
danger | Error or destructive state. |
info | Informational state. |
Text and icons
| Token | Use |
|---|---|
default | Primary text. |
muted | Secondary labels and captions. |
mutedStrong | Supporting text that must remain readable. |
success | Ready, connected, complete. |
warning | Pending, degraded, unverified. |
danger | Failed, blocked, denied. |
info | In progress or diagnostic. |
Typography
Extensions use the console typography scale. Do not import custom fonts.
| Token | Use |
|---|---|
body | Default interface text. |
heading | Section headings inside panels. |
caption | Labels, metadata, and helper text. |
mono | IDs, 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:
<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
<Stack direction="x" gap="small" alignY="center" wrap>
<Badge tone="success">ready</Badge>
<Badge tone="muted">private</Badge>
</Stack>Vertical stack
<Stack direction="y" gap="medium">
<Text variant="heading">Storage backend</Text>
<Text tone="muted">R2-backed storage for this cluster.</Text>
</Stack>Layout properties
| Property | Values |
|---|---|
direction | x, y, z. |
alignX | start, center, end, stretch. |
alignY | top, center, baseline, bottom, stretch. |
distribute | packed, space-between. |
gap | Spacing tokens. |
wrap | true, false. |
overflowX / overflowY | visible, hidden, scroll, auto. |
Spacing
Use spacing tokens for margin, padding, and layout gaps.
| Token | Value |
|---|---|
0 | 0px |
xxsmall | 2px |
xsmall | 4px |
small | 8px |
medium | 16px |
large | 24px |
xlarge | 32px |
xxlarge | 48px |
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.
| Token | Value |
|---|---|
0 | 0px |
1/2 | 50% |
1/3, 2/3 | 33.333333%, 66.666667% |
1/4, 2/4, 3/4 | 25%, 50%, 75% |
1/5, 2/5, 3/5, 4/5 | 20%, 40%, 60%, 80% |
1/6, 2/6, 3/6, 4/6, 5/6 | 16.666667%, 33.333333%, 50%, 66.666667%, 83.333333% |
fill | 100% |
min | Minimum content size. |
max | Maximum content size. |
fit | Fit available space up to content size. |
Radius
Use radius tokens consistently:
| Token | Use |
|---|---|
none | Flush table or full-bleed iframe surfaces. |
sm | Compact rows and chips. |
md | Buttons and normal panels. |
lg | Larger grouped panels. |
full | Pills, badges, and circular icon controls. |
Preset component styles
Most components do not accept custom visual styles. They expose constrained props instead.
| Component | Styling control |
|---|---|
Button | variant, size, disabled, loading. |
Badge | tone. |
Alert | tone, optional title. |
Progress | value, optional label. |
TextInput | Label, helper text, disabled, error state. |
Select | Label, options, disabled, error state. |
DataGrid | Column type, alignment, pinned columns, empty/loading states. |
Table | Column 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.