Styling & Theme
SYSTEM

REACT WIDGET SDK / STYLING

Styling & Theme

Deskset's visual system adapts your widget automatically across Light and Dark Glass cards as well as frameless Minimal mode. Always prefer semantic color tokens over hardcoded black or white.

1. Semantic Color Tokens#

Every color prop (color, background, borderColor, trackColor, fill, stroke) accepts hex colors ("#0EA5E9", "#0EA5E933"), "clear", or any semantic token below (left dot = Light mode, right dot = Dark mode):

theme.ink

Primary text and icons; flips automatically against light/dark wallpapers in Minimal mode.

theme.secondary

Subtitles, metadata, and secondary captions.

theme.tertiary

Muted hints and placeholders.

theme.accent

Widget accent color (inherited from deskpack.json accentColor or user preference).

theme.card

Standard card surface (use for background only; adapts to active material).

theme.faint

Subtle inset pill, icon well, or subcard fill.

theme.raised

Elevated control surface above the base card.

theme.track

Inactive track color for ProgressBar, Ring, RingGauge, and Slider.

theme.divider

Hairline borders and Divider strokes.

theme.surface

Secondary grouped surface background.

theme.danger

Destructive actions, errors, and critical alerts.

theme.success

Positive status, completion, and healthy metrics.

theme.warning

Warnings and medium-load indicators.

theme.blue

System blue.

theme.purple

System purple.

2. Supporting Both Glass & Minimal Modes#

When your deskpack.json declares "styles": ["glass", "minimal"], users can switch the widget to Minimal / Transparent mode (theme.isPure === true) in Edit Widget or Widget Studio. Reuse this standard root container pattern so your layout looks intentional on both cards and bare wallpapers:

TSX
const { theme } = useWidget();

const card = {
  maxWidth: true,
  maxHeight: true,
  background: theme.isPure ? "clear" : "theme.card",
  cornerRadius: theme.isPure ? 0 : theme.corner,
  clip: !theme.isPure,
} as const;

return (
  <VStack {...card} padding={16} spacing={8}>
    <Text fontSize={18} fontWeight="bold" color="theme.ink">Hello</Text>
  </VStack>
);

3. WidgetTheme Properties#

Returned by useWidget().theme:

stylestringRead-only
Active global visual style ("modern").
materialstringRead-only
Active card material: "glass", "graphite", or "pure" (frameless Minimal).
isDarkbooleanRead-only
true when rendering in dark appearance.
isPurebooleanRead-only
true when Minimal (transparent borderless) mode is active.
accentstringRead-only
Resolved hex accent color.
inkstringRead-only
Resolved primary foreground ink color.
secondarystringRead-only
Resolved secondary text color.
surfacestringRead-only
Resolved secondary surface color.
cornernumberRead-only
Standard continuous corner radius (pt) for desktop cards.
wallpaperTonestringOptional
Luminance of the wallpaper behind the widget: "light" or "dark".
use24HourbooleanOptional
macOS 24-hour clock preference.
firstWeekdaynumberOptional
macOS first weekday (1 = Sunday ... 7 = Saturday).
tempUnitstringOptional
macOS temperature unit preference: "C" or "F".
timeZonestringOptional
System IANA time zone (e.g. "America/Los_Angeles").
utcOffsetSecondsnumberOptional
Current system UTC offset in seconds.

4. StyleProps Common Modifiers#

All 23 native Deskset components accept StyleProps directly as JSX attributes:

Dimensions, Spacing & Alignment#

paddingnumber | EdgeInsetsOptional
Inner spacing (pt): single number or { top, bottom, leading, trailing, horizontal, vertical }.
spacingnumberOptional
Gap between children (pt) on VStack and HStack.
alignmentAlignmentOptional
"leading", "center", "trailing", "top", "bottom", "topLeading", "topTrailing", "bottomLeading", "bottomTrailing", "firstTextBaseline", or "lastTextBaseline".
widthnumberOptional
Fixed width in points.
heightnumberOptional
Fixed height in points.
minWidthnumberOptional
Minimum width in points.
minHeightnumberOptional
Minimum height in points.
maxWidthboolean | numberOptional
Pass true to expand horizontally, or a numeric cap in points.
maxHeightboolean | numberOptional
Pass true to expand vertically, or a numeric cap in points.
fullBleedbooleanOptional
Draw edge-to-edge ignoring default padding (or use <FullBleed>).

Surface, Material, Borders & Shadows#

backgroundstringOptional
Background color token, hex string, or "clear".
materialMaterialKindOptional
Native macOS vibrancy material: "ultraThin", "thin", "regular", "thick", "pill", or "glass".
gradientGradientSpecOptional
Gradient fill { colors: string[], start?: string, end?: string, kind?: "linear" | "radial" | "angular" }.
cornerRadiusnumberOptional
Continuous corner radius in points.
clipbooleanOptional
Clip overflowing children to cornerRadius.
borderColorstringOptional
Stroke color used alongside borderWidth.
borderWidthnumberOptional
Stroke width in points.
shadowboolean | ShadowSpecOptional
Pass true for subtle card shadow, or { color?, radius?, x?, y? }.
opacitynumberOptional
Opacity from 0 to 1.
blurRadiusnumberOptional
Gaussian blur radius in points.

Transforms, Animation & Interactions#

offsetXnumberOptional
Horizontal offset in points.
offsetYnumberOptional
Vertical offset in points.
zIndexnumberOptional
Stacking order within a ZStack or sibling container.
rotationnumberOptional
Clockwise rotation in degrees.
scalenumberOptional
Scale factor (0–8, default 1).
animationAnimationKindOptional
Automatic SwiftUI animation on prop/child changes: "none", "spring", "easeInOut", "easeIn", "easeOut", or "linear". Automatically disabled under Reduce Motion.
animationDurationnumberOptional
Animation duration in seconds (0.05–2, default 0.35).
onClickfunctionOptional
Tap/click callback () => void.
onClickAtfunctionOptional
Spatial click callback ({ x, y, width, height }) => void in local points.
onHoverfunctionOptional
Pointer hover enter/exit callback (hovered: boolean) => void.