You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/nuejs.org/blog/introducing-hyper/index.md
+84-72
Original file line number
Diff line number
Diff line change
@@ -1,36 +1,47 @@
1
+
1
2
---
2
-
title: "Hyper: Simple React alternative"
3
-
hero_title: "Introducing Hyper — A simple React alternative _(Developer Preview)_"
3
+
title: "Hyper: Standards first React alternative"
4
+
hero_title: "Introducing Hyper — Standards first React alternative _(Developer Preview)_"
4
5
og: img/hyper-og.png
5
-
date: 2025-05-06
6
+
date: 2025-05-08
6
7
---
7
8
8
-
Today I'm releasing Hyper: a simple markup language for building user interfaces. It enables developers (and AI models) to generate complex UIs with amazingly clean syntax.
9
+
Hyper is a standards first markup language for building user interfaces. It enables developers (and AI models) to generate complex UIs with amazingly clean syntax.
9
10
10
11
[image.bordered]
11
12
large: img/hyper-banner-dark-big.png
12
13
small: img/hyper-banner-dark.png
13
14
size: 1305 × 517
14
15
15
-
### Compare: React vs Hyper
16
-
* Phase 1: [Simple components](#simple)
17
-
* Phase 2: [Complex components](#complexity)
18
-
* Phase 3: [Reusable components](#reusable)
19
-
* Phase 4: [Scalability](#scalability)
20
16
17
+
## Project goals
18
+
1.**Standards first**: User interfaces should be assembled with HTML, styled with CSS, and enhanced with JavaScript.
19
+
20
+
2.**Simplicity**: UI composition should be easy and require as few idioms and abstractions as possible, both on client and server (SSR).
21
+
22
+
3.**Design Systems**: Design should be a separate subsystem, easily accessible for developers who care about and understand design.
23
+
24
+
4.**Scalability**: Complex UIs should retain simplicity as the application grows.
21
25
22
-
## Backstory
23
-
Hyper is the new reactive library for Nue, eventually replacing the current [Nue JS](https://github.com/nuejs/nue/tree/master/packages/nuejs) package. The purpose of this library is to make frontend development simpler. It stands against the complexity and bloat that pervade the current frontend ecosystem, particularly in monolithic React where logic, structure, and styling are mixed together. Hyper, however, is what React 1.0 originally envisioned: just a _headless view layer_ focused on rendering, with clear separation from styling concerns.
26
+
To understand how these goals are met, we use React as a counter-example because it's the opposite of Hyper's architecture and design goals. React embraces a monolithic architecture where logic, structure, and styling are mixed together, while Hyper is what React 1.0 (2013) originally envisioned: just a headless view layer.
24
27
25
-
Let's study the difference.
28
+
Let's study the difference in more detail:
26
29
27
30
28
-
## Phase 1: Simple components { #simple }
29
-
We begin with the fundamentals: how to define basic UI elements. Below is a simple `<table>` component defined in three ways:
31
+
32
+
### Compare: React vs Hyper
33
+
*[Simple components](#simple-components)
34
+
*[Complex components](#complex-components)
35
+
*[Design systems](#design-systems)
36
+
*[Scalability](#scalability)
37
+
38
+
39
+
## Simple components
40
+
Below is a basic `<table>` component defined in three ways:
30
41
31
42
[.row]
32
43
[! img/simple-table-1.png]
33
-
caption: Idiomatic React
44
+
caption: Modern React
34
45
href: simple-table.html
35
46
36
47
[! img/simple-table-2.png]
@@ -42,20 +53,20 @@ We begin with the fundamentals: how to define basic UI elements. Below is a simp
42
53
href: simple-table.html#hyper
43
54
44
55
45
-
1.**Idiomatic React:** ShadCN, Tailwind, and TypeScript. The extra boilerplate comes through React patterns and the custom <Table> syntax. [Source](simple-table.html) • [Demo](/hyper/demo/react/simple-table.html)
56
+
1.**Modern React**Modern React represents a common approach to building user interfaces today using component libraries such as ShadCN/UI, Material UI, Chakra, or Tailwind Catalyst. In this example, we chose ShadCN as it's gained significant popularity in recent years and has strong AI tool support. For example, Claude and ChatGPT offer built-in support for ShadCN in their code previews. [Source](simple-table.html) • [Demo](/hyper/demo/react/simple-table.html)
46
57
47
-
2.**Old school React:**JSX with vanilla CSS. More straightforward markup but still needs JavaScript wiring and JSX transformation. [Source](simple-table.html#oldschool) • [Demo](/hyper/demo/react/simple-table-oldschool.html)
58
+
2.**Old school React**is how React components were built back in the days when styling was decoupled from the component code. [Source](simple-table.html#oldschool) • [Demo](/hyper/demo/react/simple-table-oldschool.html)
48
59
49
-
3.**Hyper:**Clean, standards- compliant HTML. Table is a <table>. [Source](simple-table.html#hyper) • [Demo](/hyper/demo/table/simple-table.html)
60
+
3.**Hyper**demonstrates the standards-first approach. [Source](simple-table.html#hyper) • [Demo](/hyper/demo/table/simple-table.html)
50
61
51
62
While these differences might seem minor, they become apparent when we move to more complex components:
52
63
53
64
54
-
## Phase 2: Complex components { #complexity }
65
+
## Complex components
55
66
Next we examine how these approaches handle increasing complexity. Here's the same table component, but now with sorting and filtering:
@@ -65,47 +76,47 @@ Next we examine how these approaches handle increasing complexity. Here's the sa
65
76
href: complex-table.html#hyper
66
77
67
78
68
-
Idiomatic React ([Source](complex-table.html) • [Demo](/hyper/demo/react/complex-table.html)\) extends the ShadCN table with features from Tanstack Table. The difference to Hyper ([Source](complex-table.html#hyper) • [Demo](/hyper/demo/table/complex-table.html)\) becomes apparent:
69
-
70
-
1.**Excessive boilerplate:** Through Radix UI, Tanstack Table, and TypeScript interfaces. This results in approximately 170 lines of code, versus 40 lines in Hyper. A 75% increase in code and congitive load.
79
+
1.**Modern React** is assembled according to ShadCN's [data table](//ui.shadcn.com/docs/components/data-table) documentation. The bundled JavaScript is **91.3KB**. [Source](complex-table.html) • [Demo](/hyper/demo/react/complex-table.html)
71
80
72
-
1.**Abstraction layers:**Six layers of abstraction are in play: React, ShadCN, Radix, Tanstack, TypeScript, and Tailwind in 160MB Vite stack. The bundled JavaScript is **91.3KB**. Hyper offers the same at **3.9KB** (1.2KB + 2.7KB for hyper.js).
81
+
2.**Vanilla TSX**uses `useState` and `useMemo` to implement the added functionality, and the HTML is tagged with numerous class names.
73
82
74
-
1.**Multiple transpilers:**ShadCN table requires six different transpilers: ESBuild, JSX Transform, Rollup, TypeScript, Tailwind, and PostCSS. AI models like Claude and ChatGPT cannot generate preview for this large dependency tree. Hyper runs in the browser without compilation, or with single compilation step for a production version.
83
+
3.**Hyper**uses semantic HTML with two instance methods for sorting and filtering. The resulting JS is only **3.9KB** minzipped (1.2KB + 2.7KB for hyper.js). [Source](complex-table.html#hyper) • [Demo](/hyper/demo/table/complex-table.html)
Here is the same dashboard, but with "Ramsian" look and feel:
87
98
88
99
[image.large]
89
100
large: img/ramsian-big.png
90
101
small: img/ramsian.png
91
102
href: /hyper/demo/dashboard/ramsian.html
92
103
93
-
This transformation required zero changes to component code. Just a [30-line CSS file](/hyper/demo/dashboard/ramsian.css) extending the base design system.
94
-
95
-
Design system switching is impossible with modern React. Lets see why:
104
+
This transformation required zero changes to component code. Just a [32-line CSS file](//github.com/nuejs/nue/blob/master/packages/hyper/demo/dashboard/ramsian.css) extending the base design system. [Demo](/hyper/demo/dashboard/minimal.html)
96
105
97
106
98
-
### The problem in React: hardcoded design
99
-
Idiomatic React components aren't reusable across projects with varying design requirements because the design is hardcoded in the component. Even trivial typography changes (`h2` and `p`) require edits to multiple files. In ShadCN, you need to modify [alert-dialog.tsx](//github.com/shadcn-ui/ui/blob/main/apps/v4/registry/new-york-v4/ui/alert-dialog.tsx), [alert.tsx](//github.com/shadcn-ui/ui/blob/main/apps/v4/registry/new-york-v4/ui/alert.tsx), [card.tsx](//github.com/shadcn-ui/ui/blob/main/apps/v4/registry/new-york-v4/ui/card.tsx), [dialog.tsx](//github.com/shadcn-ui/ui/blob/main/apps/v4/registry/new-york-v4/ui/dialog.tsx), [drawer.tsx](//github.com/shadcn-ui/ui/blob/main/apps/v4/registry/new-york-v4/ui/drawer.tsx), and [sheet.tsx](//github.com/shadcn-ui/ui/blob/main/apps/v4/registry/new-york-v4/ui/sheet.tsx). Each file requires understanding of several React idioms (`data-slot`, `{...props}`), utility functions (`cn()`, `clsx()`, `twMerge()`), and primitives like `<AlertDialogPrimitive.Title>` and `<DrawerPrimitive.Description>` until these constructs ultimately map to CSS. Here are the title and description elements in the ShadCN .tsx files:
107
+
### Modern React: tightly coupled design
108
+
This kind of design swap becomes a large programming effort when design choices are coupled into components via CSS-in-JS or Tailwind. For example, in ShadCN, to change the typography of your headings, you need to edit [alert-dialog.tsx](//github.com/shadcn-ui/ui/blob/main/apps/v4/registry/new-york-v4/ui/alert-dialog.tsx), [alert.tsx](//github.com/shadcn-ui/ui/blob/main/apps/v4/registry/new-york-v4/ui/alert.tsx), [card.tsx](//github.com/shadcn-ui/ui/blob/main/apps/v4/registry/new-york-v4/ui/card.tsx), [dialog.tsx](//github.com/shadcn-ui/ui/blob/main/apps/v4/registry/new-york-v4/ui/dialog.tsx), [drawer.tsx](//github.com/shadcn-ui/ui/blob/main/apps/v4/registry/new-york-v4/ui/drawer.tsx), and [sheet.tsx](//github.com/shadcn-ui/ui/blob/main/apps/v4/registry/new-york-v4/ui/sheet.tsx). This requires understanding of idioms like `data-slot`, `{...props}`, `cn()`, `clsx()`, and `twMerge()`. Here's the code for the title and description elements:
100
109
101
110
[image]
102
111
large: img/shadcn-typo-big.png
103
112
small: img/shadcn-typo.png
104
113
105
-
This hardcoding creates a scalability issue. For example, ShadCN's "New York" theme duplicates their default theme, resulting in 40,000+ lines of [additional TSX code][new_york]. This is a problem that would have been easily solved with CSS inheritance and cascade.
114
+
Tight coupling can also create a maintenance issue. For example, ShadCN's "New York" theme duplicates their default theme, resulting in 40,000+ lines of [additional TSX code][new_york] to maintain.
115
+
116
+
While you definitely *can* decouple your styling from your React components, this pattern is rarely seen in real-world applications. Instead, the use of vanilla CSS is often discouraged due to concerns about "global namespace pollution" or other reasons.
106
117
107
118
108
-
### Hyper's solution: decoupled design
119
+
### Hyper: decoupled design system
109
120
By contrast, Hyper colocates your typography concerns into a single CSS file, acting as the single source of truth for your `h2` an `p` element styling:
110
121
111
122
```.thin
@@ -125,37 +136,38 @@ By contrast, Hyper colocates your typography concerns into a single CSS file, ac
125
136
}
126
137
```
127
138
128
-
This solves three major issues in modern React:
139
+
This solves three key issues in modern React:
129
140
130
-
1.**Reusable components** across projects and contexts
141
+
1.**Truly reusable components** across projects and styling contexts
131
142
1.**Central design system** easily maintainable from the same place
132
143
1.**Zero boilerplate** due to strict separation of concerns
133
144
134
-
Nue actually _enforces_ you to build simple, reusable components. Tight coupling in any form: CSS-in-JS, class name abuse, component-specific `<style>` elements, inline `style` attributes, or cryptic utility classes like `dark:bg-lime-400/10 size-[max(100%,2.75rem)]`—is systematically eliminated.
145
+
Nue actually _enforces_ you to external design system. Tight coupling in any form: CSS-in-JS, class name abuse, component-specific `<style>` elements, inline `style` attributes, or cryptic utility classes like `size-[max(100%,2.75rem)] are systematically eliminated.
135
146
136
-
These simple units are the secret to truly scalable apps:
137
147
138
-
139
-
## Phase 4: Scalability { #scalability }
140
-
Here's how simplicity scales: a full-scale [app](//mpa.nuejs.org/app/) lighter than a single React button:
148
+
## Scalability
149
+
Here's how simplicity scales: a full-scale [app](//mpa.nuejs.org/app/) lighter than a React button:
141
150
142
151
[bunny-video]
143
152
videoId: 39b76cca-e55b-4e9b-8583-b053f9dbd55d
144
153
poster: thumbnail_70d8de32.jpg
145
154
width: 704
146
155
height: 407
147
156
148
-
Hyper establishes an entirely different paradigm, centered around simplicity:
157
+
Hyper's standard first approach establishes a different paradigm, centered around simplicity:
149
158
150
159
[image]
151
160
small: /img/react-button-vs-nue-spa.png
152
161
large: /img/react-button-vs-nue-spa-big.png
153
162
size: 704 × 394
154
163
class: tall
155
164
165
+
Your application starts simple, and remains simple as the project grows. [Source](//github.com/nuejs/nue/tree/master/packages/examples/simple-mpa) • [Demo](//mpa.nuejs.org/app/)
166
+
167
+
156
168
[.note]
157
169
### Note
158
-
The above app is still written with Nue JS, but when converted to Hyper, the app becomes even smaller with virtually zero boilerplate.
170
+
The above app is written with [Nue JS](//github.com/nuejs/nue/tree/master/packages/nuejs), which Hyper eventually replaces. When converted to Hyper, the app is even smaller due to smaller executable and smaller components.
Hyper uses Bun for its superior web standards support, built-in JavaScript bundler, minifier, and crushing performance. Check details on why we prefer Bun over Node in our [FAQ](/docs/faq.html).
@@ -185,9 +197,13 @@ Check examples, API docs, and language syntax from [Hyper documentation](/hyper/
185
197
186
198
## FAQ
187
199
200
+
### How is this different from Svelte and Vue?
201
+
While Svelte and Vue both offer a more lightweight development environment than React, they still diverge from Hyper's standards-first vision. Though they provide better separation of concerns with their component structure, many popular patterns in these ecosystems still encourage coupling design with components through scoped CSS, CSS-in-JS libraries, or Tailwind integration.
202
+
188
203
189
204
### What is Nue?
190
-
Nue is the "framework" (think Next.js + Astro, but simpler) and Hyper is the "language" (think React, but simpler). Both are developed under the same [monorepo](https://github.com/nuejs/nue/tree/master/packages/). Here's how the product hierarchy will eventually look like:
205
+
Nue is a website/webapp generator based on [Nue JS](//github.com/nuejs/nue/tree/master/packages/nuejs) templating. Hyper is the next evolution of Nue JS, which it will replace. All Nue projects reside under the same [monorepo](//github.com/nuejs/nue/tree/master/packages/). Here's how the product hierarchy will eventually look:
206
+
191
207
192
208
[image]
193
209
large: img/branding-big.png
@@ -196,8 +212,22 @@ Nue is the "framework" (think Next.js + Astro, but simpler) and Hyper is the "la
196
212
width: 400
197
213
198
214
215
+
### Isn't this just another framework?
216
+
Hyper takes a different approach than what this question suggests. Rather than adding to the ecosystem of tools and abstractions, Hyper aims to reduce complexity by returning to web standards. It eliminates the need for many specialized frameworks, libraries, and practices that have emerged to solve challenges within the React ecosystem. Our goal is to offer a simpler path reducing the need for constantly learning new frameworks and tools.
217
+
218
+
219
+
### Why are standards so important?
220
+
Standards offer significant long-term benefits:
221
+
222
+
1.**Timeless skills**: Knowledge of HTML, CSS, and JavaScript fundamentals remains valuable across decades, while framework-specific knowledge can become outdated.
223
+
224
+
2.**Sustainable products**: Applications built primarily with web standards tend to require less frequent and less disruptive rewrites.
225
+
226
+
Consider how React's ecosystem has evolved over time: Class components gave way to hooks, state management shifted from Redux to Context to various alternatives like Zustand and Jotai, and styling approaches continue to evolve from Styled Components to Emotion to CSS Modules and beyond. Each shift requires developers to learn new patterns and often refactor existing code.
227
+
228
+
199
229
### What's next in line?
200
-
We make Hyper more easily accessible to everyone including backend developers, beginners, and AI models in two phases:
230
+
We make Hyper easily accessible to everyone including backend developers, beginners, and AI models in two phases:
201
231
202
232
203
233
#### Full-stack applications
@@ -224,40 +254,22 @@ A way for you and AI's to generate UIs with minimal effort:
224
254
Estimate: 4-5 months.
225
255
226
256
227
-
### Isn't this just another framework?
228
-
Hyper is quite the opposite of what this question suggests. It ditches hundreds of frameworks/tools/languages/idioms/libraries/practises that attempt to solve problems they introduced within the idiomatic React stack. Hyper puts you on a whole new trajectory where the need for endless frameworks (and this question itself) becomes obsolete. The answer is: simplicity scales. Less is More. KISS.
257
+
### How can a small library challenge React's dominance?
258
+
Gradually and strategically. To succeed, we need to address two key challenges:
229
259
260
+
1.**Developer perception**: Many frontend developers have come to view abstraction layers as essential. As Hyper demonstrates how professional UIs can be built without these complexities, this perception will shift.
230
261
231
-
### Why are standards so important?
232
-
Standards offer two invaluable benefits:
233
-
234
-
1. You'll learn skills that last forever
235
-
2. Your products will last forever
262
+
2.**Product completion**: Several critical pieces remain in development, particularly solid starter templates and comprehensive design systems.
236
263
237
-
Think of all React-specific technologies that are no longer "hot" and will eventually turn into technical debt. Class components, Higher Order Components, createClass. Redux/Context/Zustand/Jotai, Webpack, Styled Components/Emotion, Material UI/Chakra... It's an endless cycle to keep your skills and products fresh.
238
-
239
-
Standards are forever.
240
-
241
-
242
-
### What do you mean by "generative"?
243
-
The idea of generative HTML assembly unveils once Hyper, and the core UI primitives are ready. After that, both you and AI models can rapidly generate user interfaces with simple, minimal syntax. No unnecessary junk in your way.
244
-
245
-
246
-
### Can Hyper actually challenge the status quo?
247
-
Absolutely. To succeed, we need to address two things:
248
-
249
-
1.**Developer perception**: Frontend developers view layers of abstraction as essential. As Hyper demonstrates how professional UIs can be generated without them, this perception will shift.
250
-
251
-
2.**Finish the product**: Several critical pieces remain in development, particularly the generative approach and design systems.
252
-
253
-
But once these challenges are addressed, Hyper becomes unstoppable.
264
+
Once these challenges are addressed, Hyper has the potential to gain significant momentum.
254
265
255
266
256
267
### Isn't the name already in use?
257
268
Yes, "Hyper" a Rust HTTP library, an Electron terminal emulator, and now a HTML-based language syntax. Each serving a unique purpose in different contexts.
258
269
259
270
### Can I contribute?
260
-
Yes. Especially ideas that don't interfere with the core architecture. If you have 20+ years of experience with CSS and no wasted years in React, I'd particularly love to connect with you!
271
+
Yes. Especially ideas that don't interfere with the core architecture. If you have deep CSS expertise, especially those with experience in standards-first approaches, I'd particularly love to connect with you!
272
+
261
273
262
274
### Can I give feedback?
263
275
Definitely! Join our mailing list to be notified when Hyper officially launches. You can provide feedback as you join.
0 commit comments