Best Practices
Learn the recommended patterns and practices for using Melt UI effectively.
Encapsulation
Melt is a low-level UI library. It provides a powerful API, but with it comes a lot of moving parts.
A common practice is to create a higher-level component that is built from Melt’s primitives. This makes it easier to understand and use the library, and you can re-use your own styles and definitions.
For example, here’s an eample of a styled pin-input.
Controlled Components
For more complex state management, use controlled components: