Lessons · Vi Studio · 27 of 36
Inspect, move and lay out
Find a container’s code, drag it somewhere else, set its layout.
Turn on Inspect with the target icon in the preview's header. Then:
- Hover the phone: the container under the pointer gets an outline and its name.
- Click it: its code opens in the editor, with the container selected.
- Some containers are drawn several times, like each row of a list made with
repeat. Studio then says it is one container shown N times: editing its code changes every copy. Show where it's created jumps to the place that makes the copies.
Turn Inspect off again with the same icon, and the phone works normally.
Move mode
Next to Inspect is Move. With it on:
- Hover to pick a container.
- Press and drag it to its new place: before or after another container, or inside one. A line or a highlight shows where it will land.
- Let go, and Studio changes the
children:lists in your code to match. There are no coordinates: the container simply moves to another place in the list. - Ctrl+Z puts it back.
The Layout menu
While inspecting, right-click a container to open the Layout menu next to the pointer. It writes the attributes for you:
Open code jumps to the container; Where it's used jumps to the
childrenlist that shows it.Children sit: a 3 × 3 grid for the spot in
arrange(where its children sit). Sits in parent: the same forplace(pinned to a spot of its parent). Click a square: top-left, centre, bottom-right…; click it again to clear it.Direction: children in a row or a column (
arrange: row/column).Gap, padding and margin:
space_between,space_insideandspace_around, picked from a fixed scale, so spacing stays even across the app.
Move out and Move in
Right-click a container's name in the editor, or press Ctrl+. on it:
- Move 'x' out turns a container written inside
children:into its own block, right after the one it was in, and leaves its name in the list. Do this when a second place needs it. - Nest 'x' inside 'y' (Move in) does the reverse for a container that only one parent shows.
- Move 'x' to …vi puts it in a file of its own in
src/, named after the container that uses it.
The code changes as you click, and the phone follows.
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 Vi Studio
- 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.
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.