Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eonist/element
Programmatic UI for macOS
https://github.com/eonist/element
animation components css framework gui interface macos programatic svg
Last synced: 5 days ago
JSON representation
Programmatic UI for macOS
- Host: GitHub
- URL: https://github.com/eonist/element
- Owner: eonist
- Created: 2015-07-16T10:58:39.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-04-17T09:35:58.000Z (over 1 year ago)
- Last Synced: 2024-12-11T11:00:29.284Z (12 days ago)
- Topics: animation, components, css, framework, gui, interface, macos, programatic, svg
- Language: Swift
- Homepage:
- Size: 6.85 MB
- Stars: 857
- Watchers: 24
- Forks: 39
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![MIT Status](https://img.shields.io/badge/License-MIT-lightgrey.svg?maxAge=2592000) ![platform](https://img.shields.io/badge/OS-macOS-blue.svg?maxAge=2592000) ![Lang](https://img.shields.io/badge/Swift-4-orange.svg) [![SPM compatible](https://img.shields.io/badge/SPM-compatible-orange.svg)](https://github.com/apple/swift-package-manager) [![codebeat badge](https://codebeat.co/badges/2de7a2a5-91d5-401e-8913-8f1993affd55)](https://codebeat.co/projects/github-com-eonist-element)
### Description:
Programmatic UI Framework for macOS. Swift handles app logic, CSS/SVG handles design and JSON handles struture.### Installation:
**Step 1:** Add this to your Package.swift [Tutorial](http://stylekit.org/blog/2017/02/05/Xcode-and-spm/)```swift
import PackageDescription
let package = Package(
name: "AwesomeApp",
dependencies: [
.Package(url: "https://github.com/eonist/Element.git", Version(0, 0, 0, prereleaseIdentifiers: ["alpha", "5"]))
]
)
```**Step 2:** In AppDelegate.swift add this to the top ``@testable import Element`` and ``@testable import Utils``and this inside the ``applicationDidFinishLaunching`` method:
```swift
StyleManager.addStyle("Button{fill:blue;}")
let btn = Button(100,20)
let window = NSApp.windows[0]
window.contentView = InteractiveView()/*TopLeft orientation*/
window.contentView?.addSubview(btn)
btn.addHandler(.upInside) = { (event:ButtonEvent) in
Swift.print("hello world")
}
```You can also compile Element as a regular .framework instructions [here](https://github.com/eonist/Element/wiki/framework-instructions)
### Resources:
- Simple example app made with Element: [Stash](https://github.com/stylekit/stash)
- Library of example code for each component in Element: [Explorer](https://github.com/stylekit/explorer)
- Default macOS styles to get you started: [ElCapitan](https://github.com/stylekit/ElCapitan)### iOS:
Element for 📱 is in the works [here](https://github.com/stylekit/Element-iOS)
## More...
More about Element 👉 [wiki](https://github.com/eonist/Element/wiki)## Sponsors:
[
](https://www.jetbrains.com/objc/)