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. A style key means the CSS property of its name, the same as the class that sets it: paddingLeft is CSS’s padding-left and pl-4, boxShadow is box-shadow and shadow-md; a few keys take plainer names apps write (paddingHorizontal for padding-inline, marginStart for margin-inline-start, numberOfLines for line-clamp). Numbers are points, and the CSS features are there too: grid, gradients, box shadows, filters, blend modes, outlines, transforms, 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:
Style keys follow CSS, so a style and a class that name one property do the same thing:
Layout direction. A view that sets no display lays its children out in a column. display: "flex" is a row unless flexDirection is set, as in CSS and the flex class. flexShrink is 0 unless set.
Physical and logical sides.left, right, marginLeft, paddingRight, borderLeftWidth, borderTopLeftRadius and textAlign: "left" keep their side in right-to-left layouts. The start and end keys (marginStart, paddingEnd, start, end, borderStartWidth, …), the borderTopStartRadius family and textAlign: "start" | "end" follow the direction: inline start is the left in left-to-right layouts and the right in right-to-left ones.
Border colors. A border or an outline whose width is set and whose color is not is drawn in the text color (CSS’s currentColor).
Transforms.translate, rotate and scale are properties of their own, and transform takes CSS’s string of functions or a list of steps whose amounts may be animated values. They compose in that order: translate, rotate, scale, then transform.
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 opacity, backgroundColor, borderColor, color, translate, rotate, scale, the steps of a transform list, and a sticky view’s top / left; the value then animates on the UI thread without JS.
Strings with CSS syntax (boxShadow, textShadow, 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). A view that sets no display is a flex container whose children stack in a column; display: "flex" makes it a row unless flexDirection is set, as in CSS. Elements default to flexShrink: 0, alignContent: "flex-start" (grids: CSS’s "normal"), alignItems: "stretch", and no automatic minimum size. See Layout.
The layout of the children. "flex" lays them out in a row unless flexDirection sets a direction, as in CSS; a view that sets no display lays them out in a column. "none" removes the element from layout and hides it. "block" stacks children as CSS block layout does.
boxSizing
"border-box" | "content-box"
Dimensions include borders and padding, or content alone. Default "border-box".
"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 either direction.
bottom
DimensionValue
.bottom(…)
Offset from the bottom edge.
left
DimensionValue | AnimatedNode
.left(…), .bind_sticky_left(&node)
Offset from the left edge, in either direction. On a sticky view in a horizontal scroll view, where it sticks, which an animated value moves every frame.
start
DimensionValue
Offset from the inline start edge: left in left-to-right layouts, right in right-to-left ones.
end
DimensionValue
Offset from the inline end edge: 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. As in CSS, left and right properties keep their sides right to left, while the inline start / end ones (marginStart, end, …) take the sides the direction gives them.
The main axis. Default "column" for a view that sets no display, "row" once display: "flex" is set.
flexWrap
"wrap" | "nowrap" | "wrap-reverse"
.flex_wrap()
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(…)
Inline start: 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(…)
Inline start: left in left-to-right layouts, right in right-to-left ones.
Line style. Default "solid". "none" and "hidden" draw and lay out no border whatever the widths, set before or after, as in CSS.
A side whose width is set and whose color nothing sets is drawn in the text color, CSS’s currentColor: { borderWidth: 1, color: "#2563eb" } draws a blue border. Outlines take the text color the same way.
"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.
CSS box-shadow: offsets, blur, spread and color, several layers separated by commas, inset for inner shadows; or its layers as numbers, [{ x, y, blur, spread, color, inset }] (only x and y required); a layer without a color is drawn in the text color, as CSS’s currentColor. .shadow_color(c) recolors the layers of a preset or of .shadow(…).
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.
Transforms are CSS’s: the translate, rotate and scale properties and transform, composed in that order. Each is a property of its own, so a style’s scale replaces a class’s scale-* and keeps its rotate-*, and a style’s transform replaces a class’s transform functions (rotate-x-*, skew-*).
CSS’s translate: x, then y ("10px 20px"; percentages of the view’s own size, "-50% 0"). A number is points along x. [x, y] takes a number, a string ("50%", "10px") or an animated value per axis; an animated value alone moves it along x.
rotate
string | number | AnimatedNode
.rotate(deg(…)); .bind_rotate(&v)
CSS’s rotate: "45deg", "0.5turn", or about an axis, "x 90deg". A number, and an animated value, is degrees about z, clockwise.
CSS’s transform: "translateX(10px) rotate(45deg) scale(1.5)", or "none". Functions: translate(), translateX(), translateY(), scale(), scaleX(), scaleY(), rotate() / rotateZ(), rotateX(), rotateY(), skew(), skewX(), skewY(), perspective(). Lengths take px (translations also %, of the view’s own size), angles deg, rad or turn. Or a list of steps whose amounts may be animated values: what the string cannot hold, such as an animated 3D rotation ([{ perspective: 800 }, { rotateY: angle }]), and a motion’s channels (m.transform). A style’s transform is one form or the other, so a perspective before animated steps is a step of the list. Applied after translate, rotate and scale.
transformOrigin
string | (number | string)[]
.transform_origin(…), .origin_top_left(), …
The point the transforms act around: keywords, percentages and lengths ("top left", "50% 0", [10, 20]). Default the center.
A TransformStep is an object with one key, applied in the order of the list:
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.
maskImage
string
A CSS gradient whose alpha decides how much of the view is drawn, fully where opaque and not at all where transparent: linear-gradient(...), radial-gradient(...), conic-gradient(...). Masks everything the view draws, its backdrop filter included, whose blur then draws without the system material’s tint. Not drawn on Windows and GPUI.
glassEffect
"none" | "regular" | "clear"
.glass_effect(GlassEffect::Regular)
Liquid Glass behind the view’s content on iOS 26 and macOS 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.
The pointer shape over the view, for pointers (iPad trackpads, Mac Catalyst, desktops). Diagonal resize keywords keep their axis: nwse-resize / nw-resize / se-resize (Cursor::NwseResize) and nesw-resize / ne-resize / sw-resize (Cursor::NeswResize). Windows, Linux, Android, the web and GPUI show diagonal cursors; AppKit uses them on macOS 15+, with an open hand on macOS 14. UIKit uses pointer effects on iPad and Mac Catalyst.
pointerEvents
"auto" | "none" | "box-none" | "box-only"
.pointer_events(PointerEvents::BoxNone)
Which touches the view and the views in it take (pointer-events-none, pointer-events-auto). "none": none, for the views in it too unless one sets "auto", inherited as in CSS. "box-none": none on the view itself, the views in it take theirs; "box-only": the view itself takes them, the views in it none (both React Native’s, for the view only). Default "auto". See touch and gestures.
userSelect
"auto" | "none" | "text"
.select_text(), .select_none()
Whether a <Text> can be selected and copied ("text", select-text) or not ("none", select-none); a view’s reaches the texts in it that set none. "auto" (select-auto), the default, leaves it to the view around it, else to the platform. See text.
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.
Text color. Takes a native animated color. Also the color of borders and outlines that set none.
fontSize
number
.text_size(s), .text_sm(), .text_lg(), …
Size in points.
fontWeight
"normal" | "bold" | number | "${number}"
.font_weight(FontWeight::SEMIBOLD)
"normal" (400), "bold" (700) or 100–900.
fontFamily
string
.font_family(name)
A system family, or the name an imported font evaluates to (import Inter from "./Inter.ttf"), or a list of them, most preferred first ("Brand, 'Noto Sans SC', sans-serif"). See Fonts.
OpenType number and letter forms, a list (["tabular-nums"]) or CSS’s names separated by spaces ("tabular-nums small-caps"). tabular-nums keeps digits the same width, useful for counters and timers.
The most lines a <Text> shows (CSS’s line-clamp, line-clamp-*); 0 (line-clamp-none), the default, shows them all. truncate is one line cut with an ellipsis.
How a clamped <Text> is cut: an ellipsis at its end ("ellipsis", text-ellipsis, the default), clipped ("clip", text-clip), or the ellipsis at its start or in its middle (file paths).
placeholderColor and caretColor belong to InputStyle, the style of <Input>; selectionColor to TextStyle, as
selectable texts take it too.
Key
Type
Rust
Description
placeholderColor
ColorValue
.placeholder_color(c) of an input
The color of an <Input>’s placeholder (placeholder:text-*).
textAlignVertical
"auto" | "top" | "center" | "bottom"
Where text shorter than its box sits (a <Text> with a height).
selectionColor
ColorValue
.selection_color(c) of an input or a text
An <Input>’s or a selectable <Text>’s selection highlight and handles (selection:bg-*); the platform’s accent by default. On iOS also an input’s caret, unless caretColor is set (UIKit tints both with one color).
caretColor
ColorValue
.caret_color(c) of an input
An <Input>’s caret (caret-*); the platform’s default when unset.
CSS’s text-shadow: offsets, blur and color ("0 1px 2px rgb(0 0 0 / 0.3)"), or its layers as numbers, [{ x, y, blur, color }]; several layers drawn as the widest one; a layer without a color is drawn in the text color; "none".
CSS’s object-fit: how an image or a video fits its box. "cover" fills it and crops, "contain" fits inside it, "fill" stretches, "none" keeps the natural size, "scale-down" is "none" or "contain", whichever is smaller. Images cover their box by default, videos are contained in it.
objectPosition
string
.object_position(p), .object_top(), … of an image
Where the image sits in its box once objectFit 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.
objectFit applies to <Video> too; see image and video.