clarus.js

Clear, compiled views.

Write components in a familiar template language. clarusjs compiles them to plain server HTML and ships JavaScript only for the parts that are interactive. You can always see where each line runs.

Get started GitHub

This page has one island

Everything on this page is static HTML, rendered at build time. The button below is a component with a <script>, so it is the only thing that ships JavaScript. Click it.

@input start: number = 0

<script>
  let count = state(start)
  const double = derived(() => count * 2)
  function add() { count++ }
</script>

<button (click)="add()">Clicked {{ count }} times (double: {{ double }})</button>

Lists

This list is an island too: @for renders it on the server, and in the browser rows are added and removed by key without touching the others.

Your list below has 1 item, shared with this sentence through a store.

1 item

  • Read the islands guide

Why clarusjs