Skip to content

Box Shadows

These utility classes provide consistent drop shadow effects for elements. Use them to add depth and visual hierarchy to your UI components.

Usage

Drop Shadows

Class NameDescriptionUnderlying Class
.spr-drop-shadow-smSmall drop shadow for subtle depthspr-shadow-drop-sm
.spr-drop-shadowMedium drop shadow for standard elevationspr-shadow-drop
.spr-drop-shadow-mdLarge drop shadow for high elevationspr-shadow-drop-md

Top Drop Shadows

Class NameDescriptionUnderlying Class
.spr-drop-shadow-top-smSmall top drop shadowspr-shadow-drop-top-sm
.spr-drop-shadow-topMedium top drop shadowspr-shadow-drop-top
.spr-drop-shadow-top-mdLarge top drop shadowspr-shadow-drop-top-md

Visual Hierarchy

Box shadows are an excellent way to establish visual hierarchy in your interface:

  • Small shadows (spr-drop-shadow-sm) - For subtle elevation like cards or inputs
  • Medium shadows (spr-drop-shadow) - For standard components like buttons or modals
  • Large shadows (spr-drop-shadow-md) - For floating elements like dropdowns or tooltips

Examples

html
<!-- Basic usage -->
<div class="p-4 spr-drop-shadow">Card with medium shadow</div>

<!-- Different shadow sizes -->
<div class="p-4 mb-4 spr-drop-shadow-sm">Subtle shadow for input-like elements</div>

<div class="p-4 mb-4 spr-drop-shadow">Standard shadow for cards</div>

<div class="p-4 mb-4 spr-drop-shadow-md">Prominent shadow for floating elements</div>

<!-- Top shadows for elements anchored to bottom -->
<div class="spr-drop-shadow-top p-4">Footer with top shadow</div>

<!-- Responsive shadow usage -->
<div class="spr-drop-shadow-sm md:spr-drop-shadow">Responsive shadow that increases on larger screens</div>

<!-- Combined with other utilities -->
<div class="spr-background-color p-6 spr-rounded-border-radius-lg spr-drop-shadow">
  Card with shadow, rounded corners and background
</div>

Common Use Cases

  • Cards: Use spr-drop-shadow or spr-drop-shadow-sm for content cards
  • Modals: Use spr-drop-shadow-md for modal overlays
  • Dropdowns: Use spr-drop-shadow-md for dropdown menus
  • Buttons: Use spr-drop-shadow-sm for subtle button elevation
  • Floating Action Buttons: Use spr-drop-shadow-md for prominent floating elements
  • Navigation: Use spr-drop-shadow-top for sticky footers or bottom navigation