Examples
Runnable example programs in the bloom repository, what each one shows, and how to run them.
The repository's _examples directory has complete
programs, in rough order of complexity. To run one, clone the repository and run it from that directory:
git clone https://github.com/lrstanley/bloom
cd bloom/_examples
go run ./forms| Example | Shows | Related pages |
|---|---|---|
| basics | Layouts printed with Render, without a program: every slot, Min and Max, Collapsible, gaps, Justify, Align, Space, Box, wrapping text, Centered, and a layout inside Lip Gloss | Sizing with slots, Text, boxes, and alignment |
| standard | The usual shape of a program: a sidebar that's a Layouter, a plain component as the reader, a Measurer status bar, and clicks | Build your first layout |
| responsive | Panels collapsing by priority, Percent, a toolbar that rebuilds for its width, wrapping tags, paging with Solve in Update, and wheel scrolling | Responsive layouts, Scrolling |
| mouse | Mouse handlers with no IDs: hover styles, click and double click, wheel scrolling, a divider that keeps its drag, and ThrottleMouse | Mouse events |
| forms | Focusable inputs with the cursor, an anchored autocomplete dropdown, stacked modal dialogs as focus scopes, recolored backdrops, shadows, a spring entrance, and a toast | Dialogs and modals, Focus, Dropdowns |
| effects | Every effect as a looping transition, two custom effects, a Drawable, and each backdrop | Effects reference, Custom effects |
| transitions | Unfold, Iris, Shade, Blinds, Wave, the Stagger, Delay, Reverse, and Ease combinators, and dialogs opening from their button | Transitions |
| launch | A deploy console: shimmering placeholders, rolling numbers, a shake on wrong input, a spotlight tour with Decode, confetti, and a glitching badge | Feedback effects |
| ticker | Marquee headlines and list items, and anim.Sequence for a banner and a pulse | Feedback effects, Animating values |
| reflow | Layout animation with Animate: a sidebar, a re-sorting list, a changing split, a panel coming and going, and a layer following the selection | Layout animation |
| dashboard | Everything together at 120 frames a second, with the time each frame takes | Rendering and performance |
| showcase | A bit of everything, themed with bubbletint: tints that wave in with a decoding toast, panes that float under the pointer as they're dragged by their titles, and zoom with a double click, collapsing panes, and a spotlight tour | Related libraries, Layout animation, Mouse events |
Each example's comment at the top of main.go lists its keys. Most quit with q or ctrl+c.
The examples' tests drive each program end to end with steep, and record
the animations shown throughout these docs, as animated WebP. Run this from the repository root to record them
again, into docs/public/demos. It needs ffmpeg on your PATH:
make demosTo record them somewhere else, set STEEP_EXPORT_DIR:
STEEP_EXPORT_DIR=/tmp/demos make demosLast updated on