Component elements

One of the most powerful features of toddle is the ability to create your own components. Components are reusable elements that have their own element tree, styling, and logic.

There is an entire documentation section with a focus on components so we won't cover how to build them here.

Like HTML elements, components can be configured using attributes, CSS-variables and they are able to emit events.

Components contain a tree of any type of element; even other components! When you update your component, any component using that component will be updated to look similar.

Components are a fundamental tool in toddle. You should use them to encapsulate logic, create reusable design components, and sometimes just to split up larger components into smaller more maintainable parts.