Skip to content
Talk to an engineerRequest access

Quickstart

Build and preview your first interactive component locally in 5 minutes.

  • ⏱ 5 minutes
  • No account
  • No API key
Live — click Increment
  1. Create a project folder and a component.

    Terminal window
    mkdir my-ui && cd my-ui
    useval components create counter

    This creates components/counter.xml, plus its settings and sample data.

  2. Write the markup. Replace components/counter.xml with:

    components/counter.xml
    <Card padding="6">
    <State name="count" value="0" />
    <Column gap="4">
    <Text size="xl" weight="bold">My first interactive component</Text>
    <Text>Button presses: {= count }</Text>
    <Button label="Increment" set="count = count + 1" />
    </Column>
    </Card>
  3. Check it.

    Terminal window
    useval analyze
    ✓ You should see no errors.
  4. Preview it.

    Terminal window
    useval serve --port 3000

    Open localhost:3000 and click Increment.

    ✓ You should see the card above. Edit the XML — the preview reloads by itself.