Styling
Learn how to style Melt UI components to match your design system.
Melt UI is designed to be completely unopinionated about styling. Components provide the structure and functionality, while you have full control over the appearance. This makes it easy to integrate Melt UI with any design system or CSS framework.
DOM Attributes
Each component exposes specific DOM attributes that you can use to style different states. For example, a Toggle component adds data-melt-toggle-trigger
to identify the trigger element and data-checked
for its state:
Inline Styles
You can use component values directly in inline styles:
Using CSS Variables
Some components provide CSS variables that you can use to control layout and positioning: