iOS 16+ only
For Buttons
You could use a SwiftUI shape as background.
Use .fill(.shadow(.inner(radius: 1, y: 1))) for inner shadow.
The .foregroundColor of the shape is the background color of the button.
Here's my example using pawello2222's answer
For a RoundedRectangle Button same as the question
Button(action: {}){ Image(systemName: "heart.fill") .resizable() .frame(width: 40, height: 40) .padding(25) .foregroundColor(Color(red: 52/255, green: 57/255, blue: 133/255)) .background( RoundedRectangle(cornerRadius: 20, style: .continuous) .fill( .shadow(.inner(color: Color(red: 197/255, green: 197/255, blue: 197/255),radius: 3, x:3, y: 3)) .shadow(.inner(color: .white, radius: 3, x: -3, y: -3)) ) .foregroundColor(Color(red: 236/255, green: 234/255, blue: 235/255))) } }

For a Circle Button
Button(action: {}){ Image(systemName: "heart.fill") .resizable() .frame(width: 40, height: 40) .padding(25) .foregroundColor(Color(red: 52/255, green: 57/255, blue: 133/255)) .background( Circle() .fill( .shadow(.inner(color: Color(red: 197/255, green: 197/255, blue: 197/255),radius: 5, x:3, y: 3)) .shadow(.inner(color: .white, radius:5, x: -3, y: -3)) ) .foregroundColor(Color(red: 236/255, green: 234/255, blue: 235/255))) }
