This page lists every key of the style prop, and the method of Styled that sets it in Rust. Rust components style elements with typed methods named after Tailwind’s utilities (.p_4(), .rounded(px(12.0)), .bg(color), from nsh_core::prelude), which lower to the same keys; TSX passes style objects (and classes). The Rust column names the method; a value, a signal or a closure goes to most of them, and .style_when(…) / .style_with(…) make any of them conditional. The keys and their types come from the generated declarations in .nsh/types/nsh/types.d.ts, so your editor checks them as you type. Layout is flexbox with a column default, numbers are points, and the CSS features are there too: grid, gradients, box shadows, filters, blend modes, outlines, transitions and keyframe animations.
For how to apply styles, combine them with classes and inherit text styles, see Styling. For the class syntax, see the Tailwind reference.
style also takes an array; entries merge left to right and falsy entries are skipped, so conditional styles need no spreading. In Rust, .style_when(condition, …) adds styles while the condition holds:
Points (density-independent). 1 is one point on iOS and one dp on Android.
Points: px(16.0)
DimensionValue
number (points), `${number}%` (of the parent), or "auto".
Length: px(…), relative(0.5), auto()
LengthValue
number (points) or `${number}%`. No "auto".
DefiniteLength: px(…), relative(0.5)
ColorValue
A CSS color string: #rgb, #rgba, #rrggbb, #rrggbbaa, rgb(), rgba(), hsl(), hsla(), oklch(), oklab(), or a named CSS color (black, white, transparent, rebeccapurple, …).
An environment variable in a padding or margin: env(name), env(name, <length>) (the length stands in for an unknown name), calc(env(name) + <length>) or calc(<length> + env(name)). The names are safe-area-inset-top, -right, -bottom, -left (Safe area) and keyboard-inset-height (Keyboard). Accepted by the physical padding and margin keys and their shorthands.
A native animated value or a node derived from it (see nsh’s animation API). Accepted by backgroundColor, opacity and the steps of transform; the value then animates on the UI thread without JS.
AnimatedValue / AnimatedNode, bound with .bind_opacity(&v), .bind_background(&v), .bind_translate_x(&v), …
Strings with CSS syntax (boxShadow, backgroundImage, filter, gridTemplateColumns, …) take lengths in px and bare numbers (both points), pt (4/3 of a point, as in CSS), or rem (16 points).
Layout is computed in Rust (flexbox and CSS grid). The defaults differ from CSS’s: display: "flex", flexDirection: "column", flexShrink: 0, alignContent: "flex-start" (grids: CSS’s "normal"), alignItems: "stretch", and no automatic minimum size. See Layout.
"absolute" takes the element out of the flow and places it by top / right / bottom / left relative to its nearest positioned ancestor (its parent unless that is "static"). "static" stays in flow and ignores insets. "fixed" preserves the element type and lays out and mounts it in its surface or modal root, keeping it in place while surrounding content scrolls. "sticky" stays in the flow and, while its parent is in view, sticks top (left in a horizontal scroll view) from the start of the viewport of the scroll view around it, until its end meets its parent’s content box’s; it draws above its siblings of the same zIndex. Default "relative".
top
DimensionValue | AnimatedNode
.top(…), .inset(…), .bind_sticky_top(&node)
Offset from the parent’s top edge (absolute) or from the element’s own position (relative). On a sticky view, where it sticks, which an animated value moves every frame.
right
DimensionValue
.right(…)
Offset from the right edge. In right-to-left layouts it means the end edge.
bottom
DimensionValue
.bottom(…)
Offset from the bottom edge.
left
DimensionValue | AnimatedNode
.left(…), .bind_sticky_left(&node)
Offset from the left edge. In right-to-left layouts it means the start edge. On a sticky view in a horizontal scroll view, where it sticks, which an animated value moves every frame.
start
DimensionValue
Left in left-to-right layouts, right in right-to-left ones.
end
DimensionValue
Right in left-to-right layouts, left in right-to-left ones.
zIndex
number
.z_index(z)
Order among siblings (stable for equal values); also the native stacking order.
direction
"inherit" | "ltr" | "rtl"
Layout direction, inherited by default. Right to left, left and right properties mean start and end.
Whether children wrap onto several lines. Default "nowrap".
flex
number
.flex_1(), .flex_auto(), .flex_none()
One number, not the CSS shorthand: a positive number sets flexGrow to it, flexShrink: 1 and flexBasis: 0; 0 makes the element inflexible; a negative number shrinks it down to its minimum size.
flexGrow
number
.flex_grow(f)
How much of the free space the element takes. Default 0.
flexShrink
number
.flex_shrink(f), .flex_shrink_0()
How much the element shrinks when space runs out. Default 0, not 1 as in CSS.
flexBasis
DimensionValue
.basis(…)
The main-axis size before free space is distributed.
Distribution of wrapped lines (and grid tracks) on the cross axis. Default "flex-start" in flex containers and "normal" in grids, where tracks sized auto stretch. "start" / "end" follow the writing direction.
Margins accept "auto" (absorbs free space, as in flexbox) and negative values. The physical keys (all but marginStart / marginEnd) also take an EnvValue: marginBottom: "env(keyboard-inset-height)" (Rust .mb_keyboard(), .mt_safe_area(), …).
Key
Type
Rust
Description
margin
DimensionValue | EnvValue
.m(…), .m_4()
All four sides.
marginHorizontal
DimensionValue | EnvValue
.mx(…)
Left and right.
marginVertical
DimensionValue | EnvValue
.my(…)
Top and bottom.
marginTop
DimensionValue | EnvValue
.mt(…)
Top.
marginRight
DimensionValue | EnvValue
.mr(…)
Right.
marginBottom
DimensionValue | EnvValue
.mb(…)
Bottom.
marginLeft
DimensionValue | EnvValue
.ml(…)
Left.
marginStart
DimensionValue
.ms(…)
Left in left-to-right layouts, right in right-to-left ones.
The physical keys (all but paddingStart / paddingEnd) also take an EnvValue: paddingTop: "env(safe-area-inset-top)", paddingBottom: "calc(env(safe-area-inset-bottom) + 16px)" (Rust .pt_safe_area(), .pb_safe_area_plus(px(16.0)), .pb_keyboard(), …). A padding is at least 0.
Key
Type
Rust
Description
padding
LengthValue | EnvValue
.p(…), .p_4()
All four sides.
paddingHorizontal
LengthValue | EnvValue
.px(…)
Left and right.
paddingVertical
LengthValue | EnvValue
.py(…)
Top and bottom.
paddingTop
LengthValue | EnvValue
.pt(…)
Top.
paddingRight
LengthValue | EnvValue
.pr(…)
Right.
paddingBottom
LengthValue | EnvValue
.pb(…)
Bottom.
paddingLeft
LengthValue | EnvValue
.pl(…)
Left.
paddingStart
LengthValue
.ps(…)
Left in left-to-right layouts, right in right-to-left ones.
"continuous": corners whose curvature eases into the edges, like iOS app icons. Where the box is too small the curve falls back to circular, so pills stay pills. Works on both platforms.
Where a view or image inside a <Text> sits in its line, as CSS’s vertical-align: its bottom on the baseline (default), its top or bottom at the text font’s top or bottom, or its middle half the x height above the baseline. The line grows to hold it.
CSS filters of the view and its content: brightness(), contrast(), grayscale(), hue-rotate(), invert(), saturate(), sepia(), opacity(), blur(), drop-shadow().
backdropFilter
string
.backdrop_blur(r), .backdrop_brightness(…), …
CSS filters of what is behind the view, such as "blur(10px)" for frosted glass.
glassEffect
"none" | "regular" | "clear"
ViewStyle::glass_effect (GlassEffect)
Liquid Glass behind the view’s content on iOS 26 and later. "regular" uses the standard material; "clear" takes less color from the background. "none" is the default. Pair with backdropFilter for the blur shown on earlier iOS versions and other platforms.
When a transitioned property changes (from a new style, a class or a variant such as active:), the platform animates it natively. No JS runs during the animation.
CSS’s paint properties of SVG shapes, which any element takes and the elements inside it inherit, as in a browser.
They paint what Rust components draw on canvases.
Key
Type
Rust
Description
fill
"none" | "currentColor" | ColorValue
.fill_color(c), .fill_none(), .fill_current()
What shapes are filled with; currentColor is the element’s text color.
Text styles apply to <Text> and <Input>. They are also inherited, as in CSS: text properties set on a view pass to the texts and inputs inside it, and nested <Text> spans inherit from their parent text. All keys of ViewStyle apply too. See Text.
Recolors a template image (every opaque pixel takes this color), for monochrome icons.
objectPosition
string
.object_position(p), .object_top(), … of an image
Where the image sits in its box once resizeMode has sized it, as CSS’s object-position: keywords, percentages and lengths ("top", "left bottom", "25% 75%", "right 10px bottom 20%"). A covering image is cropped around it. Default the center.
How an image fills its box is the resizeMode prop of <Image>, not a style; see image.