Thanks to this q/a, I've added a URL to an NSTextField. Is it possible to contain the web page in my own view controller?
You can import the WebKit framework and use a WKWebView instance for showing web pages.
Documentation for WKWebView: https://developer.apple.com/documentation/webkit/wkwebview
WKWebView allows to load a url as a usual web browser and it also can read HTML/CSS code that stored as a string. So much powerful tool.
My open source project that highlights swift code for web sites uses WKWebView for previewing generated HTML/CSS output, here is the ViewController: