nuxt / nuxt/ui

Proposal to add a loading component

Open
#2,668 0 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
6.9k
Forks
1.1k
Avg merge
1d 7h
Merged PRs (30d)
57

Description

For what version of Nuxt UI are you suggesting this?

v3.0.0-alpha.x

Description

In certain situations, it’s necessary to display a loading indicator, but not all components currently include this feature. It would be helpful to have a composable and directive for such cases.

How it should work

A semi-transparent overlay should be rendered over the target, containing a loading icon.

How to use
Composable useLoading
<script setup lang="ts">
const layout = ref<HTMLDivElement | null>(null)
const { start, stop } = useLoading(layout)

function startLoading() {
  start()
  setTimeout(stop, 2000)
}
</script>

<template>
  <div ref="layout">
    ...
  </div>
  <UButton @click="startLoading">Show loading</UButton>
</template>
Directive v-loading
<script setup lang="ts">
const isLoading = ref(false)
</script>

<template>
  <div v-loading="isLoading">
    ...
  </div>
</template>
Additional context

Here’s how it’s implemented in other libraries:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No repository files or tests are named in the issue. Start by reviewing the existing Nuxt UI component and composable patterns, then compare the referenced Element Plus and Vue Loading implementations. Done means a reusable loading overlay with an icon is available through both the proposed useLoading composable and v-loading directive.

Written by the indexing model from the issue text.

Assessment

Tech stack
nuxt, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.