Skip to content

Props

Style props are set directly on Uzumaki elements. Most props are shared across elements.

Numbers are logical pixels. Strings can carry a unit or a keyword.

<view p={16} fontSize="1.25rem" w="100%" h="full" m="auto" />
FormExampleWhere it works
Numberp={16}, fontSize={14}Any length prop. Unit is pixels.
"<n>"w="200"Same as a number.
"<n>px"w="200px"Same as a number.
"<n>rem"fontSize="1.25rem"Scaled by window.remBase.
"<n>%"w="50%"Sizing and inset props.
"full"h="full"Sizing and inset props. Same as 100%.
"auto"m="auto", w="auto"Sizing, inset, and margin.

gap accepts the same forms as sizing except auto.

Hex, named CSS colors, and rgb() / rgba() are all accepted.

<text color="#f4f4f5" />
<view bg="slategray" border={1} borderColor="rgba(255, 255, 255, 0.1)" />
FormExample
Hex"#f4f4f5", "#fff", "#0008", "#11223344"
Named"red", "slategray", "rebeccapurple", "transparent", …
rgb()"rgb(20, 30, 40)"
rgba()"rgba(20, 30, 40, 0.5)" or "rgba(20, 30, 40, 128)"

All standard CSS named colors are supported. Alpha in rgba() accepts either a 01 float or a 0255 integer.

Boolean props accept true/false. When passed as a string, these values count as false: "", "0", "false", "hidden", "none", "no", "off". Everything else is true.

PropDescription
w, hWidth and height.
minW, minHMinimum width and height.
p, px, py, pt, pr, pb, plPadding.
m, mx, my, mt, mr, mb, mlMargin.
PropValues
displayflex, block, none
positionrelative, absolute
top, right, bottom, leftNumber or string offset
PropValues
flexDirrow, col / column, row-reverse, col-reverse
flexWrapnowrap / no-wrap, wrap, wrap-reverse
flextrue, number, or a flexDir string (sets display:flex and direction)
flexGrowNumber
flexShrinkNumber
itemsstart / flex-start, end / flex-end, center, stretch, baseline
justifystart / flex-start, end / flex-end, center, between / space-between, around / space-around, evenly / space-evenly
gapNumber or string
<view display="flex" flexDir="row" items="center" justify="between" gap={12} />

flex accepts a direction string as a shortcut — <view flex="col" /> is the same as <view display="flex" flexDir="col" />.

PropValues
bg, colorHex color
opacityNumber or string
visibilityvisible, hidden
fontSizeNumber or string
fontWeightNumber (100900) or name (see below)
fontFamilyString
textAlignleft, center, right, start, end, justify
textWrapwrap, nowrap / none, anywhere, break-word
wordBreaknormal, break-all, keep-all

fontWeight accepts a numeric weight or one of these names:

NameNumber
thin100
extra-light / extralight / ultra-light / ultralight200
light300
normal / regular400
medium500
semi-bold / semibold / demi-bold / demibold600
bold700
extra-bold / extrabold / ultra-bold / ultrabold800
black / heavy900
PropDescription
rounded, roundedTL, roundedTR, roundedBR, roundedBLCorner radius.
border, borderTop, borderRight, borderBottom, borderLeftBorder width.
borderColorBorder color.
outline, outlineColor, outlineOffsetFocus or emphasis outline.
<view translate={[8, 0]} rotate={-3} scale={1.05} hover:scale={1.08} />
PropDescription
translateNumber, [x, y], or { x, y }.
translateX, translateYSingle-axis translate.
rotateRotation in degrees.
scaleNumber, [x, y], or { x, y }.
scaleX, scaleYSingle-axis scale.
PropDescription
cursorCursor shown while hovering.
focusableAllows a view to receive focus and keyboard events.
selectableAllows text inside a view to be selected.
<view scrollY h={320} scrollbarWidth={6} scrollbarRadius={999}>
{rows}
</view>
PropDescription
scroll, scrollX, scrollYEnable scrolling.
scrollbarWidthScrollbar thickness.
scrollbarColorDefault scrollbar color.
scrollbarHoverColorHover color.
scrollbarActiveColorActive drag color.
scrollbarRadiusScrollbar radius.

Prefix most visual props with hover:, active:, or focus:.

<button
bg="#18181b"
hover:bg="#27272a"
active:bg="#3f3f46"
focus:outline={2}
focus:outlineColor="#60a5fa"
>
<text>Open</text>
</button>

See Elements for element-specific props and Events for event handlers.