# `<box-shadow>`

[Canonical page](https://nothing.graphics/docs/format/reference/box-shadow) · [Page source on GitHub](https://github.com/gridaco/nothing/blob/main/ncf/docs/reference/box-shadow.md)

Cast an independent shadow from sampled rectangle geometry.



<!-- Generated by ncf/tools/reference/generate.mjs. -->

A box shadow uses the shape's rounded rectangle as its caster. A shape may have multiple box shadows, including on a rectangle with no fill.

## Syntax [#syntax]

### Put an inset shadow on an unfilled panel [#put-an-inset-shadow-on-an-unfilled-panel]

The purple band paints at (21, 35) while (35, 35) stays transparent. At (16, 35) the mint stroke paints over the shadow.

```xml
<box-shadow inset="true" dx="8" dy="0" sigma="0" spread="2" color="#B34FE9FF"/>
```

[Complete .nothing source](https://github.com/gridaco/nothing/blob/main/ncf/examples/inner-shadows.nothing) · [Sample checks](https://github.com/gridaco/nothing/blob/main/ncf/conformance/README.md#layer-effects)

## Usage context [#usage-context]

Allowed parents are [`<shape>`](https://nothing.graphics/docs/format/reference/shape).

Includes [Gaussian blur](https://nothing.graphics/docs/format/reference/gaussian-blur), [Shadow style](https://nothing.graphics/docs/format/reference/shadow-style).

Requires rectangle geometry. Outer shadows paint behind the fill. Inset shadows paint after the fill and before every stroke. Paint in document order within each kind.

## Attributes [#attributes]

[Property animation](https://nothing.graphics/docs/format/spec/animation#property-types-and-exceptions)

### `inset` [#inset]

**Value** `false`, `true` · **If omitted** `false` · **Keys** Held

True shades inside the rectangle. False casts outside the rectangle. [Inset box shadows](https://nothing.graphics/docs/format/spec/filters#inset-box-shadows)

### `spread` [#spread]

**Value** local units · **If omitted** `0` · **Keys** Scalar

Positive spread grows an outer caster or shrinks an inset opening. Negative spread reverses the adjustment.

### `sigma` [#sigma]

**Value** local units · **If omitted** `0` · **Keys** Scalar · **Declared by** [Gaussian blur](https://nothing.graphics/docs/format/reference/gaussian-blur#sigma)

Nonnegative Gaussian standard deviation. Zero copies the input to the blur stage.

### `dx` [#dx]

**Value** local units · **If omitted** `0` · **Keys** Scalar · **Declared by** [Shadow style](https://nothing.graphics/docs/format/reference/shadow-style#dx)

Horizontal displacement, positive to the right.

### `dy` [#dy]

**Value** local units · **If omitted** `0` · **Keys** Scalar · **Declared by** [Shadow style](https://nothing.graphics/docs/format/reference/shadow-style#dy)

Vertical displacement, positive down.

### `color` [#color]

**Value** `#RRGGBBAA` · **Required** · **Keys** Color channels · **Declared by** [Shadow style](https://nothing.graphics/docs/format/reference/shadow-style#color)

Required shadow tint in encoded sRGB with linear alpha. The filter converts the sampled color to its working space.

## Children [#children]

| Elements                                                              | Cardinality  | Declared by | Role and source order                                                                                                                                                                                                |
| --------------------------------------------------------------------- | ------------ | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [`<animate>`](https://nothing.graphics/docs/format/reference/animate) | Zero or more | Animation   | A track targets one keyable property on this owner. For equal first-key times, the later track in document order wins. [Evaluating animation tracks](https://nothing.graphics/docs/format/spec/animation#evaluation) |

## Specifications [#specifications]

* [Outer box shadows](https://nothing.graphics/docs/format/spec/filters#outer-box-shadows)
* [Inset box shadows](https://nothing.graphics/docs/format/spec/filters#inset-box-shadows)
* [Source filter operations](https://nothing.graphics/docs/format/spec/filters#operations)
* [Evaluating animation tracks](https://nothing.graphics/docs/format/spec/animation#evaluation)
