---json
{
"description": "Shadows are used mostly to add more emphasis to important component or to add a elevation effect. ",
"page_id": "d1ed71dhvj2nv2b9wvsz9",
"title": "Shadow - This attribute will create a shadow, giving more emphasis"
}
---
====== ComboStrap Styling - Shadow attribute (Elevation) ======
===== About =====
''shadow'' (known also as ''elevation'') is a [[docs:styling:styling|styling attribute]] that elevates a [[docs:block:block|block]].
It adds a ''shadow'' and gives the block more [[docs:styling:emphasis|emphasis]].
As [[color|color]], it helps prioritizing the components on your page in order to guide the viewer's eyes.
It's mostly used on a ''call-to-action'' component such as a [[docs:content:button|button]].
===== Syntax =====
To add a shadow, you can use the ''shadow'' attribute or its alias ''elevation''.
elevation="sm|md|lg|1"
shadow="sm|md|lg|1"
where the value of the attribute sets the scale height of the elevation
^ Value ^ OnHover Animation Name ^ Name ^
| ''sm'' | ''shadow-sm'' | Small |
| ''md'' | ''shadow-md'' | Medium |
| ''lg'' | ''shadow-lg'' | Large |
| ''xl'' | ''shadow-xl'' | Extra-Large |
| ''true'', ''1'' | ''shadow'' | [[#default|Default]] |
The '' OnHover animation name'' is the name that can be used to apply a shadow when the mouse [[docs:animation:hover|is over]] an element
. See the [[#on hover|example]]
Elevation since [[release:release#version_112|version 1.12]], Shadow since [[release:release#version_114|version 1.14]]
===== Example =====
==== Button ====
With a [[docs:content:button|button]]
Flat
|
Small Shadow
|
Medium Shadow
|
Default Shadow
|
Large Shadow
|
Extra-Large Shadow
|
==== Card ====
With a [[docs:block:card|card]]
===== Elevated card =====
Guide on how to elevate
==== Image ====
With a [[docs:content:image|image]] and a [[docs:layout:component:box|box]]
{{:docs:block:stock_image_surfer_in_the_see.png?400|}}
==== On Hover ====
You can also apply a shadow [[docs:animation:hover|on hover]] with the [[#syntax|shadow animation name]]
Example with a large shadow.
{{:docs:styling:subway_card_tile.png|}}
===== Configuration =====
==== default ====
You can change the default level of shadow with the ''defaultShadowLevel'' [[docs:app:configuration|configuration]].