Skeleton loaders provide a placeholder preview of content while data is being loaded. They reduce perceived wait time and improve the user experience during loading states. Use them as the @placeholder for deferred charts and tables — see the @defer cookbook.
Playground
<base-skeleton variant="text" [count]="3">Skeleton</base-skeleton>
Use variant to control the shape of the skeleton. Options are text, circular, rectangular, card, and table-row.
Text
Circular
Rectangular
Card
Table Row
<base-skeleton variant="text" [count]="3"></base-skeleton> <base-skeleton variant="circular" width="64px" height="64px"></base-skeleton> <base-skeleton variant="card" [count]="2"></base-skeleton>
TypeScript
import { Component } from '@angular/core';
// Install: npx base-ui-cli add skeleton
// Paths are relative to aliases.components (default: src/app/components)
import { SkeletonComponent } from './skeleton/skeleton.component';
@Component({
selector: 'app-skeleton-example',
imports: [
SkeletonComponent
],
template: `...`
})
export class SkeletonExampleComponent {}Install
npx base-ui-cli add skeleton
Set [animated]="false" to disable the pulse animation.
<base-skeleton variant="text" [count]="3" [animated]="false"></base-skeleton>
TypeScript
import { Component } from '@angular/core';
// Install: npx base-ui-cli add skeleton
// Paths are relative to aliases.components (default: src/app/components)
import { SkeletonComponent } from './skeleton/skeleton.component';
@Component({
selector: 'app-skeleton-example',
imports: [
SkeletonComponent
],
template: `...`
})
export class SkeletonExampleComponent {}Install
npx base-ui-cli add skeleton
Run the following command to add this component to your project:
npx base-ui-cli add skeleton
For AI agents
Copy a prompt with the registry name, CLI install, and import — or add the Base UI MCP server.
npx -y base-ui-ng-mcp
Base UI provides standalone components. Import the exact elements you want to use into your component.
// Install: npx base-ui-cli add skeleton
// Paths are relative to aliases.components (default: src/app/components)
import { SkeletonComponent } from './skeleton/skeleton.component';
@Component({
selector: 'app-your-component',
imports: [
SkeletonComponent
],
template: `...`
})
export class YourComponent {} API for skeleton — generated from JSDoc in the library source.
| API | Member | Type | Default | Description |
|---|---|---|---|---|
base-skeleton | class | string | '' | Additional host CSS classes (merged via cn()). |
base-skeleton | variant | SkeletonVariant | 'text' | — |
base-skeleton | count | number | 1 | — |
base-skeleton | width | string | undefined | undefined | — |
base-skeleton | height | string | undefined | undefined | — |
base-skeleton | animated | boolean | true | — |
Content