Effects
Overview of shadow and blur effect tokens in Apsara.Effects add depth and visual hierarchy to your interface through shadows and blur. Apsara provides semantic effect tokens that work consistently across light and dark themes.
Shadows
Shadow tokens create elevation and depth, helping users understand the layering of interface elements.
| Token | Description | Use Case |
|---|---|---|
--rs-shadow-feather | Subtle, minimal shadow | Cards, subtle elevation |
--rs-shadow-soft | Soft, gentle shadow | Buttons, interactive elements |
--rs-shadow-lifted | Noticeable elevation | Dropdowns, popovers |
--rs-shadow-floating | Strong floating effect | Modals, dialogs, tooltips |
--rs-shadow-inset | Inner shadow | Pressed states, inputs |
Blur Effects
Blur tokens are used for backdrop effects and creating depth through transparency.
| Token | Value | Use Case |
|---|---|---|
--rs-blur-sm | blur(0.5px) | Subtle blur effect |
--rs-blur-md | blur(1px) | Medium blur effect |
--rs-blur-lg | blur(2px) | Noticeable blur effect |
--rs-blur-xl | blur(4px) | Strong blur for overlays |
Usage
Shadows
1/* Card with subtle shadow */2.card {3 box-shadow: var(--rs-shadow-feather);4}56/* Card on hover with lifted effect */7.card:hover {8 box-shadow: var(--rs-shadow-lifted);9}1011/* Dropdown menu */12.dropdown {13 box-shadow: var(--rs-shadow-lifted);14}1516/* Modal dialog */17.modal {18 box-shadow: var(--rs-shadow-floating);19}2021/* Pressed button state */22.button:active {23 box-shadow: var(--rs-shadow-inset);24}
Blur Effects
1/* Frosted glass effect */2.glass {3 backdrop-filter: var(--rs-blur-lg);4 background-color: var(--rs-color-overlay-white-a4);5}67/* Subtle background blur */8.overlay {9 backdrop-filter: var(--rs-blur-xl);10}
Elevation Hierarchy
Use shadows to establish visual hierarchy and indicate interactive states:
| Level | Shadow | Examples |
|---|---|---|
| Level 0 | None | Flat surfaces, backgrounds |
| Level 1 | --rs-shadow-feather | Cards, panels |
| Level 2 | --rs-shadow-soft | Buttons, interactive cards |
| Level 3 | --rs-shadow-lifted | Dropdowns, popovers, hover states |
| Level 4 | --rs-shadow-floating | Modals, dialogs, toasts |
Best Practices
- Use shadows sparingly - Too many shadows can make interfaces feel cluttered
- Match elevation to importance - Higher elevation shadows for more prominent elements
- Consider theme context - Shadows are automatically adjusted for dark theme
- Combine with blur - Use blur effects with overlays for a modern frosted glass aesthetic
- Animate transitions - Smooth shadow transitions on hover create polished interactions