The easiest way to create Neumorphic Style UI with SwiftUI

Hi, I’m Costa. It is simple to create outer shadow in SwiftUI by writing two lines of code. However, we can’t easily create inner shadow in SwiftUI. That’s the reason why I build this tool to make it simple and reusable.

Neumorphic is a SwiftUI utility to build Neumorphism Soft UI easily using custom view modifier and custom button style. It supports all shapes. It’s open source and it’s on GitHub!
https://github.com/costachung/neumorphic

Import Neumorphic package to your view.

Simply use .softOuterShadow and .softInnerShadow methods to create outer shadow and inner shadow respectively.

Create Rounded Rectangle with Outer Shadow

Create Rounded Rectangle with Inner Shadow

Create Circles

Create Soft Button

Create Soft Button with custom style

Customization

softInnerShadow

You can change the color, spread of the shadow, and the shadow radius of the inner shadow.

softOuterShadow

You can change the color, offset of the shadow, and the shadow radius of the outer shadow.

Example of using background method to add it under TextField:

Or, something like this:

Example Project

Check out the neumorphic-ios-example XCode project to see how to build neumorphic UI and buttons. If you use the default shadow colors of Neumorphic, you can also get dark mode support for free.

Soft Button Style Customization

Soft Button — Pressed Effects

Contacts

https://twitter.com/costachung

App Design, Simplicity, Innovation, Learning, Thinking, Creating  - Inspired by Steve Jobs, Bruce Lee, MJ

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store