You could do these by adding arbitrary values to the shadow.

<div class="relative h-screen bg-red-50">
  <div class="absolute inset-20 h-12 w-36 rounded-lg bg-indigo-500 shadow-[rgba(0,0,15,0.5)_10px_5px_4px_0px]">shadow</div>
</div>

Here's a live demo. I hope this helps you.

Answer from nuser137 on Stack Overflow
🌐
Tailwind CSS
tailwindcss.com › docs › box-shadow
box-shadow - Effects - Tailwind CSS
By default colored shadows have an opacity of 100% but you can adjust this using the opacity modifier. Use ring or ring-<number> utilities like ring-2 and ring-4 to apply a solid box-shadow to an element:
Discussions

How to use box shadows with Tailwind CSS, including custom and arbitrary values
I think the following article will help: https://www.bing.com/ck/a?!&&p=76e1ba7d9d9cb659JmltdHM9MTY5MTM2NjQwMCZpZ3VpZD0zYjg2ZmE2MS03ZWFlLTZiMGItMjIzMy1lODk5N2YxYTZhNDcmaW5zaWQ9NTQ2Mw&ptn=3&hsh=3&fclid=3b86fa61-7eae-6b0b-2233-e8997f1a6a47&psq=tailwind+add+custom+box+shadow&u=a1aHR0cHM6Ly9kZXNpZ24ydGFpbHdpbmQuY29tL2Jsb2cvdGFpbHdpbmRjc3MtYm94LXNoYWRvd3MtaG93LXRvLyM6fjp0ZXh0PUlmJTIweW91JTIwd2FudCUyMHRvJTIwYWRkJTIweW91ciUyMG93biUyMHNoYWRvd3MsJTNEJTIwJTdCJTIwdGhlbWUlM0ElMjAlN0IlMjBleHRlbmQlM0ElMjAlN0IlMjBib3hTaGFkb3clM0ElMjAlN0I&ntb=1 But I myself, am not able to use a custom shadow defined in my theme. If I am able to, I'll post here. More on reddit.com
🌐 r/tailwindcss
1
1
September 16, 2022
css - Tailwinds Box-shadow - Stack Overflow
Its not possible to do shadow at the center of the div with tailwind's choices so you have to make a custom shadow yourself which is possible in tailwind like this: More on stackoverflow.com
🌐 stackoverflow.com
Support for css variables in box shadow
When I use css variables in box-shadow, the box shadow color does not work, which is why the shadow does not match the color that was specified, how can I fix this? and is it possible? tailwindcss ... More on github.com
🌐 github.com
1
January 31, 2024
html - How to add multiple box shadows using Tailwind css? - Stack Overflow
I want to give 2 box shadows using tailwind css CSS: button{ box-shadow: inset 0px 0px 0px 1px var(--primary-500), inset 0px 0px 0px 2px red; } This is what I'm able to achieve using ta... More on stackoverflow.com
🌐 stackoverflow.com
People also ask

How do I use the generated Tailwind CSS shadow class?
Simply copy the generated class (e.g., 'shadow-[0px_5px_15px_rgba(0,0,0,0.1)]') and add it to your HTML element's class list. Tailwind CSS will apply the custom shadow based on this class.
🌐
folge.me
folge.me › home › all free tools › tailwind tools › tailwind css shadow generator
Tailwind CSS Shadow Generator
What is Tailwind CSS?
Tailwind CSS is a utility-first CSS framework that allows you to build custom designs quickly by composing utility classes. It provides low-level utility classes that let you build completely custom designs without ever leaving your HTML.
🌐
folge.me
folge.me › home › all free tools › tailwind tools › tailwind css shadow generator
Tailwind CSS Shadow Generator
Can I use this tool for projects not using Tailwind CSS?
While the tool generates Tailwind-specific classes, you can still use it to visualize and experiment with shadow effects. The shadow values can be adapted for use in standard CSS box-shadow properties.
🌐
folge.me
folge.me › home › all free tools › tailwind tools › tailwind css shadow generator
Tailwind CSS Shadow Generator
🌐
Aceternity UI
ui.aceternity.com › tools › box-shadows
Box Shadows | Aceternity UI
A curated list of box shadows for TailwindCSS. Available in classes, JIT and vanilla CSS. Click to copy styles and paste it in your HTML div section to apply box shadows instantly.
🌐
Tailwind CSS
v3.tailwindcss.com › docs › box-shadow
Box Shadow - Tailwind CSS
By default, Tailwind provides six drop shadow utilities, one inner shadow utility, and a utility for removing existing shadows. You can customize these values by editing theme.boxShadow or theme.extend.boxShadow in your tailwind.config.js file.
🌐
Tailwind CSS
tailwindcss.com › docs › filter-drop-shadow
filter: drop-shadow() - Filters - Tailwind CSS
This is useful for applying shadows to irregular shapes, like text and SVG elements. For applying shadows to regular elements, you probably want to use box shadow instead.
Find elsewhere
🌐
Epic Web Dev
epicweb.dev › tips › adding-a-shadow-to-an-svg-icon-with-tailwind-css
Adding a Shadow to an SVG Icon with Tailwind CSS | Epic Web Dev
That's the thing with box shadows—they take the bounding rectangle of an element and then apply the shadow around it. We don't want that, so maybe we can try outline or ring utilities?
Published   March 27, 2024
🌐
Folge
folge.me › home › all free tools › tailwind tools › tailwind css shadow generator
Tailwind CSS Shadow Generator
Generate custom Tailwind CSS box shadows in seconds. Our free shadow generator supports Tailwind v3 and v4: arbitrary values, inset shadows, and v4 presets (shadow-sm, shadow-lg, inset-shadow-xs). Adjust offset, blur, spread, and color with real-time preview, then copy the Tailwind class or raw CSS.
Top answer
1 of 2
3

Its not possible to do shadow at the center of the div with tailwind's choices so you have to make a custom shadow yourself which is possible in tailwind like this:

<div class="bg-white drop-shadow-[0_0px_10px_rgba(0,0,0,0.25)] rounded-md">
        <p>Hello</p>
</div>

or you can go to tailwind.config.js and add some custom CSS for example:

module.exports = {
  theme: {
    extend: {
      dropShadow: {
        '3xl': '0 35px 35px rgba(0, 0, 0, 0.25)',
        '4xl': [
            '0 35px 35px rgba(0, 0, 0, 0.25)',
            '0 45px 65px rgba(0, 0, 0, 0.15)'
        ]
      }
    }
  }
}

or another choice is to just make another CSS file (if you have already then no need to make another CSS file). and then add this:

.customShadow {
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.25);
}

then as for the html file:

<div class="bg-white customShadow rounded-md">
        <p>Hello</p>
</div>
2 of 2
0

Though the above accepted answer is correct enough, there are a few more important details:

  1. If you look at the tailwind documentation

Notice how for shadow size md, lg & xl instead of one set of values, two set of values are passed.

  1. Apparently box-shadow CSS property can accept more then one set of values!

Use Case: Suppose you are trying to apply shadow-md on a bottom-aligned navbar, in which case you need the shadow to be above the navbar (& not below).

In order to get it right, you need something like this:

shadow-[0px_-4px_6px_-1px_rgba(0,0,0,0.1),0px_-2px_4px_-2px_rgba(0,0,0,0.1)]

Also somehow:

shadow-[rgba(0,0,0,0.1)_0px_-4px_6px_-1px,rgba(0,0,0,0.1)_0px_-2px_4px_-2px]

(notice the reverse order) Also seems to work just fine!

🌐
Tailwind CSS
v3.tailwindcss.com › docs › box-shadow-color
Box Shadow Color - Tailwind CSS
If you need to use a one-off box-shadow value that doesn’t make sense to include in your theme, use square brackets to generate a property on the fly using any arbitrary value. <button class="shadow-[#50d71e]"> <!-- ...
🌐
Tailscan
tailscan.com › tailwind › effects › shadow-white
shadow-white - Tailwind Box Shadow Color - Tailscan for Tailwind CSS
The class shadow-white is a Tailwind CSS class, part of the box shadow color classes in the category effects.
🌐
Kombai
kombai.com › tailwind › box-shadow
Tailwind CSS Box Shadow - Kombai Blog
Box shadows are a fundamental styling ... more shadows to an element's box. With Tailwind CSS, you get a predefined set of utilities to handle box shadows effortlessly, ranging from subtle shadows to deep, dramatic effects....
🌐
Design2Tailwind
design2tailwind.com › blog › tailwindcss-box-shadows-how-to
How to use box shadows with Tailwind CSS, including custom and arbitrary values
September 12, 2022 - As a quick recap, you apply shadows using the box-shadow CSS property and the property allows up to 5 values per shadow: x offset, y offset, blur-radius, spread-radius, and color.
🌐
GitHub
github.com › tailwindlabs › tailwindcss › issues › 12861
Support for css variables in box shadow · Issue #12861 · tailwindlabs/tailwindcss
January 31, 2024 - When I use css variables in box-shadow, the box shadow color does not work, which is why the shadow does not match the color that was specified, how can I fix this? and is it possible? tailwindcss 3.4.1 · Reactions are currently unavailable · reinink · No labels ·
Author   Kogomre
🌐
Tailkits
tailkits.com › tools › converters
Tailwind Box Shadow Generator | Free Live CSS Builder | Tailkits
July 24, 2025 - When you need something hyper-specific, ... a stylesheet. Faster iteration, fewer context switches. A simple and effective online tool for generating CSS box-shadow styles....
🌐
Tailscan
tailscan.com › tailwind › effects › shadow-inner
shadow-inner - Tailwind Box Shadow - Tailscan for Tailwind CSS
shadow-inner is a Tailwind CSS class. Check out the css, examples how to use this class and other classes for styling the Box Shadow in our Tailscan Library.
🌐
GeeksforGeeks
geeksforgeeks.org › css › how-to-add-custom-box-shadow-in-tailwind-css
How To Add Custom Box Shadow In Tailwind CSS? - GeeksforGeeks
October 3, 2024 - Start by creating and initializing a new project with npm init -y, then install Tailwind CSS with PostCSS and Autoprefixer. Next, generate a tailwind.config.js file using npx tailwindcss init, set the content paths, and extend the theme to add ...
🌐
Tailwind CSS
tailwindcss.com › docs › text-shadow
text-shadow - Effects - Tailwind CSS
The default text shadow opacities are quite low (20% or less), so increasing the opacity (to like 50%) will make the text shadows more pronounced.
🌐
Pagedone
pagedone.io › docs › shadows-blurs
Tailwind CSS Blur and Shadow | Pagedone
The built-in shadow utility classes in Tailwind CSS make it easy to create box shadows to elements.