I recently faced this problem while working on a client project. We can place a RoundedRectangle, applied with the shadow and a white fill, andalong with the desired content's background color within a ZStack.
ZStack { RoundedRectangle(cornerRadius: 10, style: .continuous) .fill(Color(white: 1, opacity: 1)) .shadow(color: .black, radius: 6, x: 0, y: 3) Color.gray.opacity(0.4) .cornerRadius(10) Text("Content") }