To-Do app are great exercices to understand how to handle CRUD operations (create, read, update, delete) within an app. And for Dash plotly, it means using pattern matching callbacks.
In this tutorial you’ll find:
An introduction to DMC (Dash Mantine Components) and its components
How to use pattern matching callbacks for dynamic interactions
How to use CSS styling in a Dash context
How to use dcc.Store with localStorage (part 2)
The tutorial is in two parts, and I plan on writing a third part that uses Patch()
Let me know what you think …
and if it was useful to you!
Yes I could have used dmc.TextInput. It makes more sense. But I found a little more complicated to style it (CSS overrides needed for height/padding/text size) while the dcc.Input do not modifies the styles from the parent, it just adds a border. It’s visible when embedding a dmc.TextInput inside a dmc.Title. I admit it’s maybe a bit intricate , but I wanted to show how to “make any element modifable” rather than “adding text inputs everywhere”.
At the end I think you’re right, it makes more sense (thus better for a tutorial).
Unfortunately, dmc.Group do not allow making the middle element (the input) growing. The default size for the input almost fills the container, though.
→ edit: or it requires grow=True on the group and style={"flex-grow": 1} on the input.