as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
Ring
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持
感谢您的访问。此页面目前仅提供英语版本。我们正在开发中文版本。谢谢您的理解。

BoxShadowValue Object Type

The BoxShadowValue object is taken by the boxShadow style prop. It is comprised of 2-4 lengths, an optional color, and an optional inset boolean. These values collectively define the box shadow's color, position, size, and blurriness.

Example

{
  offsetX: 10,
  offsetY: -3,
  blurRadius: '15px',
  spreadDistance: '10px',
  color: 'red',
  inset: true,
}

Keys and values

offsetX

The offset on the x-axis. This can be positive or negative. A positive value indicates right and negative indicates left.

Type Optional
number | string No

offsetY

The offset on the y-axis. This can be positive or negative. A positive value indicates up and negative indicates down.

Type Optional
number | string No

blurRadius

Represents the radius used in the Gaussian blur algorithm. The larger the value the blurrier the shadow is. Only non-negative values are valid. The default is 0.

Type Optional
number | string Yes

spreadDistance

How much larger or smaller the shadow grows or shrinks. A positive value will grow the shadow, a negative value will shrink the shadow.

Type Optional
number | string Yes

color

The color of the shadow. The default is black.

Type Optional
color Yes

inset

Whether the shadow is inset or not. Inset shadows will appear around the inside of the element's border box as opposed to the outside.

Type Optional
boolean Yes

Used by


Last updated: Jul 07, 2026