Style props
Every style key a node understands is also a prop on it — 138 of them, with the React Native names and the React Native values. No scale steps, no shorthand of our own: padding={16} is sixteen density-independent pixels.
On the node that draws it
A root takes the view keys; a text slot takes the text keys; an image slot takes the image keys. The prop goes on the part it paints, so you never reach a nested element through a configuration object.
<Button variant="primary" paddingHorizontal={20} borderRadius={12}><Button.Icon as={SaveIcon} /><Button.Label fontSize={15} letterSpacing={0.4}>Save</Button.Label></Button>
Order against style
A component resolves its own styles first, then its tint, then your style props, then your style. So a style prop overrides the variant's value and style overrides everything — style is where transforms, shadows and computed values belong.
// borderRadius wins over the recipe, and style wins over borderRadius<Card borderRadius={20} style={{ transform: [{ rotate: '2deg' }] }} />
Values are kept, not transformed: a key written as undefined still counts as written, and undefined in a style is already a no-op.
Reach for the theme when you want the scale
Style props take raw values on purpose — a number here is never a hidden step. When you do want the theme's rhythm, ask it for the number.
const theme = useXAUITheme()<Card padding={theme.spacing(4)} borderRadius={theme.radius.lg} />
The theme guide lists the scales.
What is not a style prop
- The Left and Right keys. React Native mirrors a layout under RTL through Start and End only, so those are the ones exposed:
paddingStart, notpaddingLeft. pointerEvents— a style key and a View prop both. It stays the prop it always was.- Names the component owns.
variant,sizeandcoloron a root are the component's vocabulary —sizeis the control's scale,colorits tint. On a text slot,coloris the text colour it has always been.
leftrightpaddingLeftpaddingRightmarginLeftmarginRightborderLeftWidthborderRightWidthborderLeftColorborderRightColorborderTopLeftRadiusborderTopRightRadiusborderBottomLeftRadiusborderBottomRightRadiusThe whole set
Read out of the source at build time, so a React Native upgrade that adds a key shows up here on its own.
Flex and layout (18)
alignContentalignItemsalignSelfaspectRatioboxSizingcolumnGapdirectiondisplayflexflexBasisflexDirectionflexGrowflexShrinkflexWrapgapjustifyContentoverflowrowGapPosition (13)
bottomendinsetinsetBlockinsetBlockEndinsetBlockStartinsetInlineinsetInlineEndinsetInlineStartpositionstarttopzIndexMargin (13)
marginmarginBlockmarginBlockEndmarginBlockStartmarginBottommarginEndmarginHorizontalmarginInlinemarginInlineEndmarginInlineStartmarginStartmarginTopmarginVerticalPadding (13)
paddingpaddingBlockpaddingBlockEndpaddingBlockStartpaddingBottompaddingEndpaddingHorizontalpaddingInlinepaddingInlineEndpaddingInlineStartpaddingStartpaddingToppaddingVerticalSize (6)
heightmaxHeightmaxWidthminHeightminWidthwidthBorder (24)
borderBlockColorborderBlockEndColorborderBlockStartColorborderBottomColorborderBottomEndRadiusborderBottomStartRadiusborderBottomWidthborderColorborderCurveborderEndColorborderEndEndRadiusborderEndStartRadiusborderEndWidthborderRadiusborderStartColorborderStartEndRadiusborderStartStartRadiusborderStartWidthborderStyleborderTopColorborderTopEndRadiusborderTopStartRadiusborderTopWidthborderWidthFill, shadow, and the rest of a box's paint (18)
backfaceVisibilitybackgroundColorboxShadowcursorelevationexperimental_backgroundImagefilterisolationmixBlendModeopacityoutlineColoroutlineOffsetoutlineStyleoutlineWidthshadowColorshadowOffsetshadowOpacityshadowRadiusTransform (8)
rotationscaleXscaleYtransformtransformMatrixtransformOrigintranslateXtranslateYText — a text slot only (21)
colorfontFamilyfontSizefontStylefontVariantfontWeightincludeFontPaddingletterSpacinglineHeighttextAligntextAlignVerticaltextDecorationColortextDecorationLinetextDecorationStyletextShadowColortextShadowOffsettextShadowRadiustextTransformuserSelectverticalAlignwritingDirectionImage — an image slot only (4)
objectFitoverlayColorresizeModetintColor