Skip to content

Preview screens with sample data and personas

Preview shows your screens working, before anything is built. You see the Basket with items in it, press its buttons, move between screens and find out what a Shopper can and cannot do. Nothing is saved and nothing is started: it is safe to try anything.

You need screens on your slices. See Add a screen to a slice. The look comes from the application’s UI profile, not from Studio’s own dark theme.

Preview starts from the place you are working:

  • On the board, select the eye icon, Preview, in the header of a module, a feature or a slice. A module or a feature previews inside the application. A slice previews only itself: its dialog on its own, or its page.
  • In the screen editor, select Preview this screen with the changes not yet saved. The screens you have open and have not saved are used, so you see your edit straight away.
  • On the design canvas, select Preview in the top bar, or the preview button on an artboard.

The board stays where it was under the preview. When you leave with Exit preview · Esc, you are back at the same selection, and the screen editor, if it was open, is still open.

A strip across the top says what you are previewing, for example Previewing Storefront › Basket › Add to basket. Use it to change what the preview shows.

  1. Under Sample data:, choose the data the screens show. Generated makes up rows from each field’s type. My data sets are the ones you added, and Blueprints are packs that blueprints come with.

  2. Under As persona:, choose who is looking. Nobody in particular shows everything. Choose a persona, such as the Shopper or the Merchandiser, to see the application as that person. What the persona’s policies do not allow is hidden or disabled, with the reason.

  3. Turn on Bindings lens to see what each element is connected to: the slice it opens, the query it reads and the filter it feeds. Sample text that is bound to nothing is flagged, so you can make it a real field before building.

  4. Click a menu entry or a button to move between screens.

Your choice of sample data in the strip is for this preview only. The application’s own choice is made once, in the UI profile, under Sample data. That is also where you add your own data sets: paste rows as JSON or CSV, or load a file, and map each set to the read model it stands in for. Production builds never include sample data.

If the model cannot be drawn, for example because a feature has no screen or a slice has no command, the strip says This cannot be previewed and why, with a link to the part of the model it is about. You are never left with a blank screen.

Preview draws screens with sample data in place. It is quick, and you can start it from any slice. Play runs the whole modeled application, with its commands and events working for real. Use Preview while you design, and Play when you want to try the behavior.

The preview shows your screens with rows of sample data. Switching As persona: changes what is shown or disabled, and each disabled thing says why.