Knit UI
GitHub

Playground

Loading playground…

Playground
<ShadowView
  shadowColor="#0f172a"
  shadowOffset={{ width: 0, height: 8 }}
  shadowRadius={20}
  shadowOpacity={0.35}
/>

Examples

Default

A soft drop shadow under the card.

Loading example…

DefaultSourceStorybook

Elevated

A tight, dark shadow offset down-right.

Loading example…

ElevatedSourceStorybook

Inner

An inset shadow painted inside the box.

Loading example…

InnerSourceStorybook

Colored

A colored glow-like shadow.

Loading example…

ColoredSourceStorybook

Props

PropTypeDefaultDescription
androidWarmupboolean | undefined
innerboolean | undefinedRender the shadow inset (inner) rather than as an outer drop shadow.
refRef<View> | undefined
shadowColorstring | undefined#0f172aShadow color. Any alpha in the color is honored; `shadowOpacity` further scales it. With no color there is no shadow. Opacity scaling only applies to `#rgb[a]` / `#rrggbb[aa]` and `rgb()/rgba()` colors — named colors and theme tokens are used as-is.
shadowOffset{ width: number; height: number; } | undefinedOffset in px. Defaults to `{ width: 0, height: 0 }`.
shadowOpacitynumber | undefined0.350–1 multiplier applied to the shadow color's alpha. `0` paints no shadow.
shadowRadiusnumber | undefined20Blur radius in px. Defaults to `0` (a hard-edged shadow).

Plus 90 inherited style props from Box — the full Tamagui/React Native style surface, including token shorthands like p, mx, bg and c. See Tokens for the scales they accept, or the full list.