diff --git a/packages/frontend/@n8n/design-system/src/v2/components/Loading/component-loading.md b/packages/frontend/@n8n/design-system/src/v2/components/Loading/component-loading.md new file mode 100644 index 0000000000000..083dacf161622 --- /dev/null +++ b/packages/frontend/@n8n/design-system/src/v2/components/Loading/component-loading.md @@ -0,0 +1,189 @@ +# Component specification + +Displays loading placeholders (skeleton screens) while content is being fetched or processed. Provides visual feedback to users that content is loading without showing a blank screen. + +- **Component Name:** N8nLoading +- **Figma Component:** TBD +- **Element+ Component:** [ElSkeleton](https://element-plus.org/en-US/component/skeleton.html) +- **Reka UI Component:** [Primitive](https://reka-ui.com/docs/utilities/primitive) (no native Skeleton component) +- **Nuxt UI Component:** [Skeleton](https://ui.nuxt.com/docs/components/skeleton) + + +## Public API Definition + +**Props** + +- `animated?: boolean` - Controls whether the skeleton shows pulsing animation. Default: `true` +- `loading?: boolean` - Controls whether the loading skeleton is displayed. When `false`, the skeleton is hidden. Default: `true` +- `rows?: number` - Number of skeleton rows to display. Default: `1` +- `cols?: number` - Number of skeleton columns to display. When set (non-zero), overrides row-based layout. Default: `0` +- `shrinkLast?: boolean` - Whether to shrink the last row to a shorter width. Only applies to `'h1'` and `'p'` variants when `rows > 1`. Default: `true` +- `variant?: SkeletonVariant` - Visual variant determining the shape and style of skeleton items. Values: `'custom' | 'p' | 'text' | 'h1' | 'h3' | 'caption' | 'button' | 'image' | 'circle' | 'rect'`. Default: `'p'` + +**Events** + +None - This is a purely presentational component. + +**Slots** + +None - Content is generated based on props. + +### Template usage example + +**Basic loading with rows:** +```typescript + + + +``` + +**Variant-specific loading:** +```typescript + + + +``` + +**Without shrinking the last row:** +```typescript + + + +``` + +**Controlling animation:** +```typescript + + + +``` + +**Multiple instances for list items:** +```typescript + + + + + +``` + +**Conditional loading based on data availability:** +```typescript + + + +``` + +**Column-based layout:** +```typescript + + + +``` + +**Custom styling with CSS classes:** +```typescript + + + + + +```