Feature request
Problem
When fetching async data, there's no built-in way to show a loading state that matches the UEmpty component's visual style. The typical pattern is to either:
- Show nothing while pending (causes layout shifts)
- Show the empty state immediately (causes a flash before data arrives)
- Roll a custom spinner that doesn't match the component system
Proposed solution
Two complementary approaches would solve this:
1. A loading prop on UEmpty
<UEmpty
icon="i-lucide-message-circle"
title="Nog geen berichten"
description="Wees de eerste om iets te zeggen!"
:loading="status === 'pending'"
/>
When loading is true, the component could replace (or animate) the icon with a spinner and optionally swap the title/description for a loading message.
2. A dedicated ULoading (or USkeleton variant) component
A standalone empty-state-style loading component with the same layout/spacing as UEmpty, so you can toggle between them without layout shifts:
<ULoading v-if="status === 'pending'" />
<UEmpty v-else-if="!items?.length" ... />
Current workaround
<div v-if="status === 'pending'" class="h-full content-center">
<div class="flex justify-center">
<UIcon name="i-lucide-loader-circle" class="text-muted size-6 animate-spin" />
</div>
</div>
<UEmpty v-else-if="!items?.length" ... />
This works but requires manual layout matching and breaks the component abstraction.
Alternatives considered
- Using
USkeleton directly — doesn't match the centered empty-state layout
- Wrapping in a custom component — adds boilerplate every time this pattern is needed
Feature request
Problem
When fetching async data, there's no built-in way to show a loading state that matches the
UEmptycomponent's visual style. The typical pattern is to either:Proposed solution
Two complementary approaches would solve this:
1. A
loadingprop onUEmptyWhen
loadingistrue, the component could replace (or animate) the icon with a spinner and optionally swap the title/description for a loading message.2. A dedicated
ULoading(orUSkeletonvariant) componentA standalone empty-state-style loading component with the same layout/spacing as
UEmpty, so you can toggle between them without layout shifts:Current workaround
This works but requires manual layout matching and breaks the component abstraction.
Alternatives considered
USkeletondirectly — doesn't match the centered empty-state layout