Learn Vi: build real mobile apps
36 short lessons, from your first screen to timers, sound, several screens and store builds. No experience needed: Vi reads almost like a description of the screen, and turns it into a real React Native app.
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.
Getting started
- Welcome to ViWhat Vi is and how Vi Studio works.
- Vi in five minutesContainers, data, functions and layout in four small apps.
- Your first appA complete counter app, line by line.
- Projects and templatesNew Project, Create blank project, and how a project is laid out.
The language
- Comments and names# comments, <# blocks #> and snake_case names.
- ContainersEverything on screen is a container; children one per line.
- Size and spacesize out of 100, and space_inside / between / around.
- Arrange and placeDirection, spot and spread; floating with place.
- Texttext and text_style.
- Colour, shape and imagesColours and shades, shape, shadow, see_through, outline, @images.
- Buttons, inputs and other kindsbutton, input, search, icon, link and scrolling lists.
- Eventson_tap, on_hold, on_touch, on_swipe, on_change, on_submit, on_hit.
- Data: lists and objectsVariables, lists, objects and the list helpers.
- FunctionsYour own functions and the built-in ones.
- Conditions and loopsif / else, the inline if, and, or, not, for and while.
- Programs without a screenmain functions and print().
Building apps
- Screensgo_to, go_back, transitions, and phone / tablet / desktop.
- Containers that take valuescard(task): one container, many values.
- Repeating thingsrepeat: task in tasks, grids, index, x, y and .at().
- Reaching other containersInside names, parent.name and top-level names.
- Changing the screenA dot for one change, a block for several; wait and animate.
- Timers and gamesevery(), stop(), on_touch, place: x, y and on_hit.
- Sound and videoplay, loop, stop_sounds, audio and video.
- Files and projectssrc/, every file sees every name, one name in one file.
- The config blockApp name, store id, version, icon and splash screen.
- Errors and good habitsThe real error messages and their fixes; how to organise a project.
Vi Studio
- Inspect, move and lay outFind a container’s code, drag it somewhere else, set its layout.
- Build for Android and iOSStore builds and test builds in Expo’s cloud.
- Source Control (Git)Commits, diffs and publishing to GitHub.
- The AssistantA local AI helper that proposes edits you can apply.
Examples
- Example: counterA tally with a goal, split into files.
- Example: to-do appLists, inputs, repeat and an empty state.
- Example: tic-tac-toeA two-player game with a 3×3 grid and a scoreboard.
- Example: Comet GlideA tap-to-fly arcade game with every() and place.
Reference
- Cheat sheetThe whole language on one page.
- ReferenceEvery attribute, event, built-in and keyword.