A Comparison project evaluating Ark UI and Melt UI for building UI components with Svelte 5, focusing on how well each library integrates with Svelte 5's new runes.
This project was created to evaluate whether Ark UI is a better fit than Melt UI when working with Svelte 5's modern features (runes like $state, $derived, $effect).
During development with Melt UI, something started to feel off: Melt UI relies heavily on Svelte stores (the old state management pattern), which doesn't align well with Svelte 5's event-driven, runes-based approach. This means:
onSelectChange$effect everywhere to react to state changesArk UI, on the other hand, uses a framework-agnostic, event-based approach that feels more natural with Svelte 5.
This demo project includes implementations of common UI patterns:
Each component demonstrates how Ark UI integrates with Svelte 5's reactive system.
<script>
import { createSelect } from '@melt-ui/svelte';
const { elements, states } = createSelect();
// Have to use $effect to react to changes
$effect(() => {
console.log('Selected:', $states.selected);
});
</script>
<script>
import { Select } from '@ark-ui/svelte';
let selectedValue = $state('');
// Clean event handler - no $effect needed!
function handleValueChange(details) {
selectedValue = details.value[0];
}
</script>
<Select.Root onValueChange={handleValueChange}>
<!-- Component structure -->
</Select.Root>
# Install dependencies
pnpm install
# Run the dev server
pnpm dev
# Build for production
pnpm build
ark-ui-test/
โโโ src/
โ โโโ lib/
โ โ โโโ data.ts # Sample data (units with contracts)
โ โ โโโ types.ts # TypeScript type definitions
โ โโโ routes/
โ โโโ +page.svelte # Select demo
โ โโโ checkbox-demo/+page.svelte # Checkbox demo
โ โโโ pagination-demo/+page.svelte # Pagination demo
โ โโโ combobox-demo/+page.svelte # Combobox demo
โ โโโ file-upload-demo/+page.svelte # File upload demo
For Svelte 5 projects, Ark UI provides a more idiomatic, cleaner development experience compared to Melt UI. The event-based API aligns perfectly with Svelte 5's reactive paradigm, resulting in less boilerplate and more maintainable code.
Note: This is an evaluation project. Both libraries have their strengths, but for Svelte 5 specifically, Ark UI feels like the better fit.