As templates get big and complicated, it can help to break them down into smaller pieces. Here we've added a Hide completed checkbox to the to-do list. We've also pulled the main todo list template out into a separate local constant, todos. You can think of this as a partial template.

You'll notice the todos partial is almost identical to the <ul> element in the previous step, except that it's using the new items local constant instead of this._listItems.

Your mission: refactor the template to hide the completed items when Hide completed is checked and show a message when no uncompleted items are displayed.

Try clicking Hide completed and make sure your code worked. Go ahead and cross off Complete Lit tutorial. (If anything's not working, check your work or click Solve to see the finished code.)

Next steps

Permalink to "Next steps"

To keep exploring Lit, try one of these tutorials:

If you'd like to see more interactive samples and keep experimenting with Lit online, you can head over to the Playground. Or if you're ready to try something real, you might want to check out our component Starter kits or add Lit to an existing project.