Description #
Marko is a modern, HTML-based UI templating language and framework designed for fast rendering and optimized performance on both the server and client.
History #
Marko was created by Patrick Steele-Idem at eBay around 2014. It was developed to power eBay’s massive-scale applications with fast server-side rendering, fine-grained reactivity, and compile-time optimizations.
Hello World Code #
<h1>Hello, World!</h1>
To render with data:
<h1>Hello, ${input.name}!</h1>
How to Run #
Option 1: Online
Try the official Marko REPL:
https://try.markojs.com/
Option 2: Local
Install via npm:
npm init marko
npm run dev
Or use in a simple file:
npm install marko
Example:
const template = require('./hello.marko')
template.render({ name: 'World' }, res)
Key Concepts #
- HTML-first templating syntax
- Compiles to highly optimized JS
- Supports server-side rendering (SSR)
- Fine-grained reactivity with no VDOM
- Components with scoped styles and logic
<script>
and<style>
blocks inside templates- Input passed via
input
object - Works in both Node.js and browser
- Zero runtime needed for static rendering
- Built-in support for streaming, hydration, and code splitting
Try It Online #
Fun Facts #
- Marko powers all of eBay’s public-facing web apps, including their search and checkout pages.
- It was one of the first frameworks to adopt out-of-the-box partial hydration and streaming.
- The
.marko
file format is a complete UI component, combining HTML, JS, and CSS.
Resources #
Official site
Docs or tutorial
GitHub or interpreter
Community or learning resources