vi studio

Lessons · Building apps · 24 of 36

Files and projects

src/, every file sees every name, one name in one file.

A small example fits in one file. A real app reads better when each file does one job. Every new project is laid out like this:

my-app/
  README.md
  assets/              icon.png, splash.png, your pictures and sounds
  src/
    main.vi            the main screen: puts the pieces together
    config.vi          app name, icon, splash screen, store id
    theme.vi           colours used everywhere
    tasks.vi           the data, and the functions that change it
    components/
      header.vi        one piece of the screen per file
      task_row.vi

Every example here runs in Vi Studio: open it in your browser (phones too) and press Start learning on the welcome page. Each code block there has a Try it button that runs it in the phone preview.

More in Building apps

About Vi. Vi is a free, open-source programming language for building real mobile apps. You describe each screen in plain words, and Vi compiles it to React Native (Expo) for Android, iOS and the web. Its editor, Vi Studio, runs on Windows, in any browser and on your phone, with the app running live as you type. Read more about Vi.