The elevation is an important design concept of material design. Column composable helps to create a layout with child components arranged vertically. Let’s check how to add elevation to the Column in Jetpack Compose.
You can show shadow around the Column using the modifier parameter and Modifier.shadow. You can give a predefined value and it sets the size of the shadow. See the following code snippet where elevation is given to a Column with a yellow color background.
@Composable
fun ColumnExample() {
Column(modifier = Modifier
.fillMaxWidth()
.height(300.dp)
.padding(40.dp)
.shadow(20.dp)
.background(Color.Yellow)) {
Text(text = "Column Elevation Example")
}
}
You can see the shadow in the output.

Following is the complete code for reference.
package com.example.composeapplication
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.material.*
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.shadow
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.example.composeapplication.ui.theme.ComposeApplicationTheme
class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
ComposeApplicationTheme {
Surface(
modifier = Modifier.fillMaxWidth(),
color = MaterialTheme.colors.background
) {
ColumnExample()
}
}
}
}
}
@Composable
fun ColumnExample() {
Column(modifier = Modifier
.fillMaxWidth()
.height(300.dp)
.padding(40.dp)
.shadow(20.dp)
.background(Color.Yellow)) {
Text(text = "Column Elevation Example")
}
}
@Preview(showBackground = true)
@Composable
fun DefaultPreview() {
ComposeApplicationTheme {
ColumnExample()
}
}
That’s how you set Column elevation in Jetpack Compose. I hope this Android tutorial is helpful for you.