Loading State

حالة التحميل

GLS-000134

Beginnerui-ux1 min read
loading indicatorspinnerloading uiskeleton screenloading feedback

Definition

UI feedback shown while data is being fetched or an action is in progress.

تغذية راجعة للواجهة تُعرض أثناء جلب البيانات أو تنفيذ إجراء.

Why It Matters

Users expect feedback within 100ms of an action. A 1-second delay without a loading indicator feels like a freeze.

يتوقع المستخدمون تغذية راجعة في غضون 100 مللي ثانية من الإجراء. تأخير ثانية بدون مؤشر تحميل يبدو كتجمّد.

Full Definition

A loading state is the UI shown while waiting for async work to complete. Options: spinner (rotating icon), skeleton loader (placeholder that mimics content shape), progress bar, or simple text like 'Loading...'. In Next.js, loading.tsx creates automatic loading states for route segments using Suspense. Without loading states, users think the app is broken when it's just loading.
حالة التحميل هي الواجهة المُعرَضة أثناء انتظار اكتمال العمل غير المتزامن. الخيارات: محوّل (أيقونة دوّارة) أو هيكل تحميل (عنصر نائب يُحاكي شكل المحتوى) أو شريط تقدم أو نص بسيط مثل 'جارٍ التحميل...'. في Next.js، ينشئ loading.tsx حالات تحميل تلقائية لأجزاء المسار باستخدام Suspense. بدون حالات التحميل، يعتقد المستخدمون أن التطبيق معطوب عندما يكون فقط قيد التحميل.

Example Usage

Visiting /glossary/nextjs shows a skeleton loader for 200ms while the server fetches the term data — then the full page renders.

زيارة /glossary/nextjs تُظهر هيكل تحميل لمدة 200 مللي ثانية أثناء جلب الخادم لبيانات المصطلح — ثم تُصيَّر الصفحة الكاملة.

Knowledge Graph

Avoid these mistakes when using Loading State:

1

Showing spinners for operations that complete in under 100ms (causes spinner flicker)

2

No loading state on form submission (user clicks submit multiple times thinking nothing happened)

Sign in to unlock guided AI explanations from AI Teacher.

Generate a Prompt

Copy this prompt and use it directly with any AI model — no setup needed.

Ready-to-Use Prompt
Help me build a project using Loading State.

Explain:
1. What is Loading State and why it matters
2. The core architecture and required tools
3. Step-by-step implementation plan
4. Common mistakes to avoid: Showing spinners for operations that complete in under 100ms (causes spinner flicker), No loading state on form submission (user clicks submit multiple times thinking nothing happened)
5. Best practices and production tips

Official Resources

No official documentation link on file for Loading State yet.