Skip to main content

Playground

Loading frus…
What the playground understands

A subset of Rust, interpreted in your browser with no compiler: one function, usually fn app(cx: &BuildContext) -> Box<dyn Widget>, with let, if, for, while, arithmetic, format!, closures, cx.use_state and cx.theme(). The examples also compile as ordinary Rust. Code without its own Scaffold is centred on the theme’s surface while it fits, and scrolls when it does not; in a real project, write that yourself, as the examples do. Structs, traits, crates and the other hooks are not supported yet.

Widgets: Text, Flex, Row, Column, Container, Padding, Center, SizedBox, Spacer, Expanded, Stack, Positioned, AspectRatio, Opacity, ClipRRect, Visibility, SingleChildScrollView, ListView, GridView, Card, Divider, Button, IconButton, FloatingActionButton, SegmentedButton, Icon, Checkbox, Radio, Switch, Slider, Rating, Stepper, TextField, Chip, CircleAvatar, Badge, Kbd, Tooltip, Alert, Skeleton, Image, ListTile, ExpansionTile, Dismissible, LinearProgressIndicator, CircularProgressIndicator, TabBar, BottomNavigationBar, Scaffold, AppBar, Wrap, MediaQuery, with their most common methods. The editor completes from the same list (Ctrl+Space, or after a dot), and an unknown method’s error names the ones available.