Skip to content

Props

Props accept numbers, strings, or specific keywords:

  • Numbers are treated as pixels: w={100}
  • Strings: "100" (px), "2rem", "50%", "auto"
  • "full" is shorthand for 100%
  • Colors: hex strings like "#FF5733" or with alpha "#FF573380", or "transparent"
PropDescription
wWidth
hHeight
minHMinimum height
pPadding (all sides)
pxHorizontal padding
pyVertical padding
pt, pb, pl, prPadding per side
mMargin (all sides)
mx, myMargin horizontal / vertical
mt, mb, ml, mrMargin per side
gapGap between flex children
PropValuesDescription
display"flex", "none", "block"Display mode
flexnumberFlex shorthand
flexDir"row", "col"Flex direction
flexGrownumber / stringFlex grow factor
flexShrinknumber / stringFlex shrink factor
items"center", "start", "end", "stretch"Align items
justify"center", "between", "around", "evenly"Justify content
PropDescription
bgBackground color
colorText color
fontSizeFont size
fontWeightFont weight (numeric)
roundedBorder radius (all corners)
roundedTL, roundedTR, roundedBR, roundedBLPer-corner radius
borderBorder width (all sides)
borderTop, borderRight, borderBottom, borderLeftPer-side border
borderColorBorder color
opacityOpacity (0-1)
cursorCursor style
visibleVisibility

Style props that apply on hover or active (press) states:

PropDescription
hover:bgBackground on hover
hover:colorText color on hover
hover:opacityOpacity on hover
hover:borderColorBorder color on hover
active:bgBackground on press
active:colorText color on press
active:opacityOpacity on press
active:borderColorBorder color on press
<view
bg="#2d2d30"
hover:bg="#3e3e42"
active:bg="#4e4e52"
rounded={6}
p={10}
cursor="pointer"
>
<text color="#e4e4e7" hover:color="#ffffff">
Hover me
</text>
</view>
PropTypeDescription
onClick() => voidClick / tap handler
onMouseDown() => voidMouse down handler
onMouseUp() => voidMouse up handler