CSS Box Shadow Generator

CSS Box Shadow Generator API

Design

Free CSS box shadow generator with live preview. Customize shadows for UI design and web development. Copy CSS code instantly for your projects.

Authentication

All API requests require a valid API key passed in the Authorization header as a Bearer token.

Rate Limit

120 requests per minute

Endpoints

1 endpoint available

Overview

Build a CSS box-shadow from its parts. The response has the declaration and just the value.

Notes

  • Offsets, blur and spread are whole numbers in pixels, between -1000 and 1000. Blur cannot be negative.
  • Colours can be hex, a colour name, or an rgb(), hsl(), hwb(), lab(), lch(), oklab() or oklch() function. Anything else is rejected.
  • The colour is written to the CSS exactly as you send it.

Endpoints

POST
https://opentools.ca/api/v1/tools/css-box-shadow-generator
Generate a box-shadow declaration

Request Body

Content-Type: application/json

ParameterTypeRequiredDescription
hOffset
number
OptionalHorizontal offset in px, -1000 to 1000.Default: 10
vOffset
number
OptionalVertical offset in px, -1000 to 1000.Default: 10
blur
number
OptionalBlur radius in px, 0 to 1000.Default: 10
spread
number
OptionalSpread radius in px, -1000 to 1000.Default: 0
color
string
OptionalShadow colour, e.g. "#000000", "red" or "rgba(0, 0, 0, 0.25)".Default: #000000
inset
boolean
OptionalDraw the shadow inside the box.Default: false

Response Example

{
  "success": true,
  "value": "10px 10px 10px 0px #000000",
  "css": "box-shadow: 10px 10px 10px 0px #000000;"
}

Error Codes

400
Bad Request - Out-of-range number or unsupported colour
401
Unauthorized - Invalid or missing API key
403
Forbidden - API key inactive, expired, or request from a disallowed IP
429
Too Many Requests - Rate limit exceeded
500
Internal Server Error

Code Examples

curl -X POST https://opentools.ca/api/v1/tools/css-box-shadow-generator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"hOffset": 0, "vOffset": 4, "blur": 12, "spread": 0, "color": "rgba(0, 0, 0, 0.25)"}'

Ready to get started?

Create an API key to start using the CSS Box Shadow Generator API.

Rather use it in your browser? Open the CSS Box Shadow Generator