The frus guide
How to build an application with frus, one topic at a time. Every page is made of examples you can paste: each one is a complete piece of Rust, and each is compiled — and the ones with assertions run — by frus's own test suite, so none of them is out of date.
Start with Starting a frus application: the smallest application,
the three ways to keep state, async work, and how to run on a phone. Then:
| Page | What it covers |
|---|---|
| Laying out a screen | Rows and columns, sharing the room, boxes, stacks, wrapping, scrolling, adapting to the screen |
| Text, colour and the theme | Text, the theme's colours and type, light and dark, changing one widget or every widget of a kind |
| Taking input | Text fields, controllers, checkboxes, switches, sliders, dropdowns, checking a form |
| Lists and grids | Long lists, the data behind them, pull to refresh, swipe to remove, grids, scrolling from code |
| Screens, navigation and dialogs | Routes, redirects, the Scaffold, dialogs and sheets |
| Talking to a server | Requests, JSON, loading a screen's data, sending a form |
| Animation | Values that move to their new value, switching widgets, curves, what is animated for you |
| Testing | Testing the state and the logic, and what the screen looks like |
| The system around the application | File dialogs, dropped files, notifications, the tray, the taskbar, global shortcuts, the icon |
| Structuring an application | Where each part of a growing application goes |
Beyond the guide:
- The widget gallery —
frus-examples/widgets— shows every widget with the code that builds it: 173 demos, in a browser at https://frus-rs.github.io/frus/. - The example applications —
frus-examples/— are complete projects: a counter, forms, sign-in, navigation, a client for a REST server, a WebSocket chat. - The API reference — https://docs.rs/frus — has every type and method, most with an example.