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 OverflowYou 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.
Or you could use the Tailwind plugin, tailwind-extended-shadows; it adds utilities for specifying box-shadow x + y offsets (i.e. directions), and shadow spread. They work alongside the built-in shadow-{size} (controls blur) and shadow-{color} classes, so you have full control over your shadows via utility classes.
For example:
<div class="shadow-lg shadow-slate-900/20 shadow-b-2 shadow-r-[3px] -shadow-spread-2">...</div>
Github: https://github.com/kaelansmith/tailwind-extended-shadows
Playground: https://play.tailwindcss.com/9X5nqVNd1d
How to use box shadows with Tailwind CSS, including custom and arbitrary values
css - Tailwinds Box-shadow - Stack Overflow
Support for css variables in box shadow
html - How to add multiple box shadows using Tailwind css? - Stack Overflow
How do I use the generated Tailwind CSS shadow class?
What is Tailwind CSS?
Can I use this tool for projects not using Tailwind CSS?
Videos
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>
Though the above accepted answer is correct enough, there are a few more important details:
- 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.
- Apparently
box-shadowCSS 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!
To use multiple box-shadows you can use comma separated box-shadow's values inside square brackets.
<button
class="shadow-[inset_0_0_0_1px_var(--primary-500),inset_0px_0px_0px_2px_red]">
Hello World!
</button>
The shadow classes that come with Tailwind use multiple shadows, e.g. the class shadow translates to box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); in CSS.
If you need to add additional shadows or customise these values, you can do so by editing theme.boxShadow or theme.extend.boxShadow in your tailwind.config.js file.
If a DEFAULT shadow is provided, it will be used for the non-suffixed shadow utility. Any other keys will be used as suffixes, for example the key '2' will create a corresponding shadow-2 utility.