Build your first micro-app
In this walkthrough you build a team lunch RSVP: a page where a colleague enters their name and dietary needs, and a thank-you page that repeats what they entered. Along the way you use every basic Mica tool — layout, properties, document state, two-way binding, button events, page navigation, conditional visibility, preview and export. It takes about fifteen minutes.
This is the finished micro-app, running live through mica/runtime. Type a
name, press Count me in, and watch the state panel:
Before you start
Section titled “Before you start”Open the designer in a new tab (contributors can also run it from
the repository; see Run the designer). The screenshots on this page show
the stored copy of the finished document, whose element keys are descriptive —
you will see page-thanks where your own document says page-1.
1. Start a Signal document
Section titled “1. Start a Signal document”-
On the pack picker, choose Start with Signal. Mica opens Signal’s two-page starter template, Northstar Dispatch.
-
Click an empty part of the grey canvas around the page. The inspector on the right now shows the Page stack — the root of every document. Change its Name to
Team lunch RSVP. The top bar picks up the new name. -
The starter content is only there to show what the pack can do. Select the Team page tab and press the × beside it to remove the page.
-
On the Overview page, hover each top-level block (the hero, the metrics grid, the In motion section, the spacer and the closing section) and press the trash icon in its hover toolbar. Deleting a container deletes everything inside it. Every deletion is one undoable step (⌘Z).
-
Click the Overview tab to select the page itself. In the inspector set Title to
RSVPand Background toMist. The title is what the page tab shows; the page keeps its key (page-overview), which is how buttons refer to it.
2. Lay out the form
Section titled “2. Lay out the form”-
Drag a Section from the palette onto the empty page and drop it on the highlighted Drop here area. In the inspector, set Eyebrow to
FRIDAY · 12:30, Title toFriday team lunchand Tone toRaised. -
Drag a Text into the centre of the section to nest it inside. Set its content to
Tell us you're coming so we order enough food.and its Tone toMuted. -
Drag two Input components below the text, then a Button below them. Aim at a component’s top or bottom edge to drop before or after it — a line shows where it will land.
-
Select the first Input and set Label to
Your name, Placeholder toFull name, Input Type toText, and switch Required on. Set the second Input’s label toDietary needsand its placeholder toVegetarian, allergies, …, set its type toText, and give it the help textOptional. -
Select the Button and set Label to
Count me in.

3. Give the app some state
Section titled “3. Give the app some state”A micro-app remembers what the person has entered in document state: named values the app starts with and that buttons and inputs can change.
-
Switch the inspector to the State tab (top right) and keep the Values view.
-
In the new key box type
guest/name, leave the value empty, and press Add. A/in a key nests it, so this creates/guest/nameholding an empty text value. -
Add
guest/dietthe same way, thenguest/attendingwith the valuefalse. The panel now shows one/guestrow holding all three values.

4. Bind the inputs to state
Section titled “4. Bind the inputs to state”-
Switch back to the Component tab and select the Your name Input.
-
Under Value, choose $bindState and pick
/guest/namefrom the suggestions. The Input now reads and writes that path: whatever the person types is stored there while the app runs. -
Bind the Dietary needs Input to
/guest/dietthe same way.

5. Add the thank-you page
Section titled “5. Add the thank-you page”-
Press Add page beside the page tabs. Mica adds Page 2 with the key
page-1and selects it. Set its Title toThanks. -
Drag a Heading, two Text components and a Button onto the page. Set the heading content to
See you on Friday, level1, and switch Accent on to highlight its last word. Set the button label toChange my answerand its variant toOutline. -
Select the first Text. Under Content, choose State and enter
/guest/name, and set Size toLg. The text now shows whatever is stored at that path. -
Bind the second Text’s content to
/guest/dietand set its tone toMuted.
6. Show a line only when it has something to say
Section titled “6. Show a line only when it has something to say”Not everyone has dietary needs, so the second line should only appear when
/guest/diet holds something.
-
With the diet Text selected, find Show when and press Add condition.
-
Enter
/guest/dietas the state path and leave the operator on is truthy. An empty text value is not truthy, so the line stays hidden until the person types something.

The canvas keeps showing every component so you can still select it; conditions take effect in the preview and at runtime.
7. Make the buttons do something
Section titled “7. Make the buttons do something”-
Go back to the RSVP page and select Count me in. The inspector shows an Events section: what happens when the button is pressed.
-
Press Add action. The new row is Set a value: enter
/guest/attendingas the state path andtrueas the value. -
Press Add action again and change the new row to Go to page, then pick Thanks (page-1). Actions run in order, top to bottom.
-
On the Thanks page, select Change my answer, add one action, change it to Go to page, and pick RSVP (page-overview).

8. Try it in the preview
Section titled “8. Try it in the preview”-
Press Preview in the top bar. The document now runs for real in a disposable session seeded from its state.
-
Type a name and a dietary need, then press Count me in. The page switches to Thanks and shows what you typed. The Event log on the right records each action with the state it changed.
-
Press Reset preview to start the session again from the document’s state, or Exit preview (or Esc) to go back to editing. Nothing you did in the preview is saved into the document or its undo history.

9. Export and import
Section titled “9. Export and import”-
Press Export JSON. Mica downloads
team-lunch-rsvp.json— the whole micro-app as one versioned document. -
Press Import, paste a document into the dialog and press Replace document to open it. Import validates everything: a document with an unknown component, a misspelled prop or a button pointing at a missing page is refused with a message naming the problem, and nothing is lost quietly.
The finished document
Section titled “The finished document”The document you built matches the one below, which is stored in the
repository. The only difference is the element keys: the designer names new
elements after their type (section-1, input-2, …), while the stored copy
uses descriptive keys such as rsvp-name so it is easier to read.
Complete document — examples/documents/first-app.json
{ "envelopeVersion": 1, "ui": { "root": "app", "elements": { "app": { "type": "PageStack", "props": { "name": "Team lunch RSVP" }, "children": [ "page-rsvp", "page-thanks" ] }, "page-rsvp": { "type": "Page", "props": { "title": "RSVP", "background": "mist" }, "children": [ "rsvp-card" ] }, "rsvp-card": { "type": "Section", "props": { "eyebrow": "FRIDAY · 12:30", "title": "Friday team lunch", "tone": "raised", "padding": "lg" }, "children": [ "rsvp-intro", "rsvp-name", "rsvp-diet", "rsvp-submit" ] }, "rsvp-intro": { "type": "Text", "props": { "content": "Tell us you're coming so we order enough food.", "size": "md", "tone": "muted", "align": "left", "italic": false }, "children": [] }, "rsvp-name": { "type": "Input", "props": { "label": "Your name", "placeholder": "Full name", "inputType": "text", "required": true, "helpText": null, "value": { "$bindState": "/guest/name" } }, "children": [] }, "rsvp-diet": { "type": "Input", "props": { "label": "Dietary needs", "placeholder": "Vegetarian, allergies, …", "inputType": "text", "required": false, "helpText": "Optional", "value": { "$bindState": "/guest/diet" } }, "children": [] }, "rsvp-submit": { "type": "Button", "props": { "label": "Count me in", "variant": "solid", "size": "md", "disabled": false, "fullWidth": false }, "children": [], "on": { "press": [ { "action": "setState", "params": { "statePath": "/guest/attending", "value": true } }, { "action": "goToPage", "params": { "page": "page-thanks" } } ] } }, "page-thanks": { "type": "Page", "props": { "title": "Thanks", "background": "paper" }, "children": [ "thanks-heading", "thanks-name", "thanks-diet", "thanks-back" ] }, "thanks-heading": { "type": "Heading", "props": { "content": "See you on Friday", "level": "1", "align": "left", "accent": true }, "children": [] }, "thanks-name": { "type": "Text", "props": { "content": { "$state": "/guest/name" }, "size": "lg", "tone": "default", "align": "left", "italic": false }, "children": [] }, "thanks-diet": { "type": "Text", "props": { "content": { "$state": "/guest/diet" }, "size": "md", "tone": "muted", "align": "left", "italic": false }, "children": [], "visible": { "$state": "/guest/diet" } }, "thanks-back": { "type": "Button", "props": { "label": "Change my answer", "variant": "outline", "size": "md", "disabled": false, "fullWidth": false }, "children": [], "on": { "press": { "action": "goToPage", "params": { "page": "page-rsvp" } } } } }, "state": { "guest": { "name": "", "diet": "", "attending": false } } }, "meta": { "pack": { "id": "mica.core", "version": "1.0.0" } }}Where next
Section titled “Where next”- Core concepts explains the model behind what you just did.
- Build forms with two-way binding goes deeper on inputs.
- Declare a business object connects a micro-app to real host data.