effects field that controls its visual presentation independently of its content. You set opacity, round corners, apply CSS filters, align text vertically inside its box, and stack multiple drop shadows — all through a single typed object rather than an untyped style bag. Programmatic layers behave identically to ones produced by the editor.
The effects object
Theeffects field follows the Effects type, which is a strict object with five optional properties. You can set any combination of them; omitted fields have no effect on the layer.
Layer opacity from
0 (fully transparent) to 1 (fully opaque). Applied to the entire layer including its fills, borders, and children.Corner radius in pixels. Useful for rounding the corners of rectangle shapes or clipping image layers. Must be
0 or greater.A raw CSS
filter value, applied verbatim to the layer. Use it for blur, brightness, contrast, or any other CSS filter function.Controls how a text layer’s content is aligned vertically within its bounding box. Has no effect on non-text layers.
An ordered array of shadow entries. Shadows are rendered back-to-front, so the last entry in the array sits on top. Build each entry with the
shadow() helper.shadow()
shadow(input?) builds a single Shadow entry with sensible defaults. All parameters are optional — calling shadow() with no arguments produces a soft, mid-opacity drop shadow that works well on most content.
Shadow color as any CSS color string. Defaults to
'rgba(0,0,0,0.25)'.Horizontal offset in pixels. Positive values push the shadow right, negative values push it left. Defaults to
0.Vertical offset in pixels. Positive values push the shadow down. Defaults to
4.Blur radius in pixels. Must be
0 or greater. Defaults to 12.Spread radius in pixels. Positive values expand the shadow; negative values shrink it. Defaults to
0.Fractional opacity (
0–1) applied on top of the color value. Defaults to 1.When
true, renders the shadow as an inner shadow instead of a drop shadow. Defaults to false.Examples
- Opacity + shadow
- Rounded image
- Stacked shadows
- CSS filter
- Vertical alignment
Add a soft drop shadow and slight transparency to a heading layer.
Combining effects
All five properties work together on the same layer. The order of composition is: CSS filter is applied first (to the layer pixels), then border radius clips the result, then shadows are painted outside the clipped shape, and finally opacity fades the entire composited layer.shadow() fills in all unspecified fields with their defaults, so you only need to write
the values that differ from the baseline. shadow({}) and shadow() produce the same
result: a 0 4px 12px rgba(0,0,0,0.25) drop shadow.