Unflow
unflow 是一个低代码、无代码设计语言。unFlow is a Design as Code implementation, a DSL for UX & backend modeling. DSL to Sketch file, Sketch to DSL, DSL to code.
Install / Use
/learn @inherd/UnflowREADME
unflow
Design as code
Todos:
- [ ] LSP: https://github.com/silvanshade/lspower/
- [ ] feat: support for components [props, config, action]
- [ ] to sketch spike
Flow
DSL -> DSL Parser -> DSL Json ---pipe---> Node.js -> Sketch
Setup
- install nightly
- download antlr-4.8 rust version from: https://github.com/rrevenantt/antlr4rust
DSL
Task Flows / User Flows Example
flow login {
SEE HomePage
DO [Click] "Login".Button
REACT Success: SHOW "Login Success".Toast with ANIMATE(bounce)
REACT Failure: SHOW "Login Failure".Dialog
SEE "Login Failure".Dialog
DO [Click] "ForgotPassword".Button
REACT: GOTO ForgotPasswordPage
SEE ForgotPasswordPage
DO [Click] "RESET PASSWORD".Button
REACT: SHOW "Please Check Email".Message
}
Elements
page HomePage {
LayoutGrid: 12x
LayoutId: HomePage
Router: "/home"
}
component Navigation {
LayoutId: Navigation
}
component TitleComponent {}
component ImageComponent {
Size: 1080px
}
component BlogList {
BlogDetail, Space8
BlogDetail, Space8
BlogDetail, Space8
BlogDetail, Space8
BlogDetail, Space8
BlogDetail, Space8
}
Layout Examples:
Layout HomePage {
--------------------------
| Navigation(RIGHT) |
--------------------------
| Empty(2x) | TitleComponent | Empty(2x) |
--------------------------
| ImageComponent |
--------------------------
| BlogList(8x) | Archives(2x) |
--------------------------
| Footer |
--------------------------
}
Layout Navigation {
--------------------------------------
| "home" |"detail" | Button("Login") |
--------------------------------------
}
Library Define Examples
library FontSize {
H1 = 18px
H2 = 16px
H3 = 14px
H4 = 12px
H5 = 10px
}
library Color {
Primary {
label = "Primary"
value = "#E53935"
}
Secondary {
label = "Blue"
value = "#1E88E5"
}
}
library Button {
Default [
FontSize.H2, Color.Primary
]
Primary [
FontSize.H2, Color.Primary
]
}
Refs: AutoLayout.js, Apple's Auto Layout, Visual Format Language
License
code based on: https://github.com/phodal/design
This code is distributed under the MIT license. See LICENSE in this directory.
Related Skills
clearshot
Structured screenshot analysis for UI implementation and critique. Analyzes every UI screenshot with a 5×5 spatial grid, full element inventory, and design system extraction — facts and taste together, every time. Escalates to full implementation blueprint when building. Trigger on any digital interface image file (png, jpg, gif, webp — websites, apps, dashboards, mockups, wireframes) or commands like 'analyse this screenshot,' 'rebuild this,' 'match this design,' 'clone this.' Skip for non-UI images (photos, memes, charts) unless the user explicitly wants to build a UI from them. Does NOT trigger on HTML source code, CSS, SVGs, or any code pasted as text.
ui-ux-pro-max-skill
61.7kAn AI SKILL that provide design intelligence for building professional UI/UX multiple platforms
ui-ux-pro-max-skill
61.7kAn AI SKILL that provide design intelligence for building professional UI/UX multiple platforms
onlook
25.1kThe Cursor for Designers • An Open-Source AI-First Design tool • Visually build, style, and edit your React App with AI
