Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

1kB-ish JavaScript framework for building hypertext applications

License

NotificationsYou must be signed in to change notification settings

jorgebucaran/hyperapp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The tiny framework for building hypertext applications.

  • Do more with less—We have minimized the concepts you need to learn to get stuff done. Views, actions, effects, and subscriptions are all pretty easy to get to grips with and work together seamlessly.
  • Write what, not how—With a declarative API that's easy to read and fun to write, Hyperapp is the best way to build purely functional, feature-rich, browser-based apps using idiomatic JavaScript.
  • Smaller than a favicon—1 kB, give or take. Hyperapp is an ultra-lightweight Virtual DOM,highly-optimized diff algorithm, and state management library obsessed with minimalism.

Here's the first example to get you started.Try it here—no build step required!

<scripttype="module">import{h,text,app}from"https://unpkg.com/hyperapp"constAddTodo=(state)=>({    ...state,value:"",todos:state.todos.concat(state.value),})constNewValue=(state,event)=>({    ...state,value:event.target.value,})app({init:{todos:[],value:""},view:({ todos, value})=>h("main",{},[h("h1",{},text("To do list")),h("input",{type:"text",oninput:NewValue, value}),h("ul",{},todos.map((todo)=>h("li",{},text(todo)))),h("button",{onclick:AddTodo},text("New!")),]),node:document.getElementById("app"),})</script><mainid="app"></main>

Check out more examples

The app starts by setting the initial state and rendering the view on the page. User input flows into actions, whose function is to update the state, causing Hyperapp to re-render the view.

When describing how a page looks in Hyperapp, we don't write markup. Instead, we useh() andtext() to create a lightweight representation of the DOM (or virtual DOM for short), and Hyperapp takes care of updating the real DOM efficiently.

Installation

npm install hyperapp

Documentation

Learn the basics in theTutorial, check out theExamples, or visit theReference.

Packages

Official packages provide access toWeb Platform APIs in a way that makes sense for Hyperapp. For third-party packages and real-world examples, browse theHyperawesome collection.

PackageStatusAbout
@hyperapp/domnpmInspect the DOM, focus and blur.
@hyperapp/svgnpmDraw SVG with plain functions.
@hyperapp/htmlnpmWrite HTML with plain functions.
@hyperapp/timenpmSubscribe to intervals, get the time now.
@hyperapp/eventsnpmSubscribe to mouse, keyboard, window, and frame events.
@hyperapp/httpnpmTalk to servers, make HTTP requests (#1027).
@hyperapp/randomnpmDeclarative random numbers and values.
@hyperapp/navigationnpmSubscribe and manage the browser URL history.

Need to create your own effects and subscriptions?You can do that too.

Help, I'm stuck!

If you've hit a stumbling block, hop on ourDiscord server to get help, and if you remain stuck,please file an issue, and we'll help you figure it out.

Contributing

Hyperapp is free and open-source software. If you want to support Hyperapp, becoming a contributor orsponsoring is the best way to give back. Thank you to everyone who already contributed to Hyperapp! <3

License

MIT

About

1kB-ish JavaScript framework for building hypertext applications

Topics

Resources

License

Stars

Watchers

Forks

Contributors101


[8]ページ先頭

©2009-2025 Movatter.jp