Give your Rust app a stage.

Masque is a declarative UI language and embeddable runtime. Add beautiful interfaces to your Rust desktop or embedded application with ease.

todo.masquehot reload
Today1 of 4 done
Drawn by the Masque runtime, compiled to WebAssembly.

Your app holds the state. Masque sets the scene.

Masque is a library, not a framework you move into. It runs inside your frame loop, reads the state you hand it, and gives back events. Your app’s data never leaves Rust.

Your Rust app

Data, logic, I/O and threads. It stays plain Rust, with no UI code mixed in.

  • Owns the state
  • Handles the events
  • Runs the frame loop it already has
Your .masque document

Layout, styling, animation and state that only the UI cares about, in a language made for it.

  • Reads the state it declares
  • Raises the events it declares
  • Changes without touching Rust

The document declares both sides of the contract, and Masque checks them when it loads.

Every screen in its place.

Carte is a state-based router for Rust applications that pairs natively with Masque.

Explore Carte

Everything an interface needs, in the language.

Flexbox layout

Rows, columns, gaps, alignment, and boxes that grow or shrink to fill space, plus grids and scrolling containers.

Components are functions

Give them parameters, pass callbacks as props, put lists and match branches right where the children go, and import across files.

Local state

Declare state inside a component, the way you would with useState. Whether a menu is open never has to round-trip through Rust.

A contract with your Rust app

The document declares the state it reads and the events it sends. A typo or a wrong argument count is an error that says what you meant, not a blank screen.

Springs on any style change

Name the properties that should move, and colour, opacity, padding and transforms spring to their new values, hover states included.

Entry and exit animations

Give a widget a starting style and an exit style. Removed content stays on stage until it has left, and Presence swaps whole pages the same way.

Portals and popovers

Tooltips, menus, modals and toasts sit above the tree, anchored to their parent, with hover-to-open, click-outside dismiss and focus trapping.

Native drag and drop

Give anything a payload and a drag preview, mark the targets that accept it, and get start, move and end events. Built for editors, inventories and reorderable lists.

Raise the curtain.

Add the crate and put your first screen on stage.