Habit Tracker App in Rust egui — Grid, Checkboxes & CRUD | Learn egui Ep29
16views
0012:48
T
Taught by Celeste AI - AI Coding Coach
View on YouTubeDescription
Build a habit tracker app in Rust using egui! In this episode, we create a weekly habit tracker with a striped grid layout, toggle buttons for each
day, streak counting with color-coded highlights, completion stats with percentages, and full CRUD with add/delete functionality.
Student code: https://github.com/GoCelesteAI/egui_habit_tracker
What You'll Learn:
- Grid::new() with .striped(true) for alternating row backgrounds
- Button::new().fill() with Color32 for green/gray toggle buttons
- Streak calculation using .iter().rev().take_while()
- Completion counting with .iter().filter()
- TopBottomPanel::top for header with stats percentage
- TopBottomPanel::bottom for the add-habit input form
- TextEdit::singleline with add_sized for text input
- add_enabled for conditional button activation
- RichText::new().strong() for bold header labels
- Color-coded streak display (gold/green/gray thresholds)
- Option deferred removal pattern for safe deletion
- Vec with default sample data
- Neo-tree file browsing in a Rust project
This is Episode 29 of the "Learn egui in Neovim" series — 36 episodes teaching Rust GUI development with egui, all coded in Neovim with Neo-tree.
Chapters:
0:00 Intro
0:12 What We're Building
0:22 Preview: Key Concepts
0:54 Create Project & Dependencies
1:30 main.rs — Window Setup
2:30 app.rs — Constants & Habit Struct
3:30 Habit::new Constructor
4:00 streak() — Reverse Iterator Count
4:45 completed() — Filter Count
5:15 MyApp Struct & Default
6:00 eframe::App — Header Panel
7:00 Bottom Panel — Add Habit Form
8:00 Central Panel — Empty State
8:30 Grid Header Row
9:00 Habit Rows — Day Toggle Buttons
10:00 Completion & Streak Display
10:45 Delete Button & Deferred Removal
11:15 Save & Review Code
11:45 cargo build
12:15 Neo-tree Browse
12:45 App Demo
13:45 Recap
14:25 Next Episode
Tags: rust, egui, habit tracker, gui, tutorial, neovim, neo-tree, eframe, grid, checkbox, streak, crud, color32, richtext, topbottompanel, textedit,
add_enabled, button, fill, iterator, filter, take_while, vec, coding, programming, learn rust, rust gui, desktop app
Hashtags: #rust #egui #habittracker #gui #neovim #rustlang #coding #tutorial
Tags
rusteguihabit trackerguitutorialneovimneo-treeeframegridcheckboxstreakcrudcolor32richtexttopbottompanel