Empty
What to show where there is nothing yet: what is empty, why, and what to do. In the look of the app's style.
Usage
import { Component, ViewEncapsulation } from '@angular/core';import { RouterLink } from '@angular/router';import { ScButton, ScEmpty, ScEmptyBody, ScEmptyDescription, ScEmptyHeader, ScEmptyMedia, ScEmptyTitle, ScLink,} from '@semantic-components/ui';import { SiArrowUpRightIcon, SiFolderCodeIcon,} from '@semantic-icons/lucide-icons';
@Component({ selector: 'app-empty-usage-demo', imports: [ RouterLink, ScButton, ScEmpty, ScEmptyBody, ScEmptyDescription, ScEmptyHeader, ScEmptyMedia, ScEmptyTitle, ScLink, SiFolderCodeIcon, SiArrowUpRightIcon, ], template: ` <div scEmpty> <div scEmptyHeader> <div scEmptyMedia variant="icon"><svg siFolderCodeIcon></svg></div> <h2 scEmptyTitle>No Projects Yet</h2> <div scEmptyDescription> You haven't created any projects yet. Get started by creating your first project. </div> </div> <div scEmptyBody> <div class="flex justify-center gap-2"> <button scButton>Create Project</button> <button scButton variant="outline">Import Project</button> </div> </div> <a scLink variant="link" size="sm" routerLink="." fragment="usage" class="text-muted-foreground" > Learn More <span class="sr-only">about projects</span> <svg siArrowUpRightIcon></svg> </a> </div> `, host: { class: 'flex w-full justify-center' }, encapsulation: ViewEncapsulation.None,})export class EmptyUsageDemo {}Anatomy
Every part is a directive on your element; the icon, the words and the actions are yours.
import { ScEmpty, ScEmptyHeader, ScEmptyMedia, ScEmptyTitle, ScEmptyDescription, ScEmptyBody,} from '@semantic-components/ui';<div scEmpty> <div scEmptyHeader> <div scEmptyMedia variant="icon">…</div> <h2 scEmptyTitle>…</h2> <div scEmptyDescription>…</div> </div> <div scEmptyBody>…</div></div>Accessibility
- Make the title a heading (h2–h6, at the page's level), so it can be found by heading.
- The media is decorative: the title and the description say it.
- The actions are real buttons and links, named by their text.
Examples
Outline
Cloud Storage Empty
Upload files to your cloud storage to access them anywhere.
import { Component, ViewEncapsulation } from '@angular/core';import { ScButton, ScEmpty, ScEmptyBody, ScEmptyDescription, ScEmptyHeader, ScEmptyMedia, ScEmptyTitle,} from '@semantic-components/ui';Background
No Notifications
You're all caught up. New notifications will appear here.
import { Component, ViewEncapsulation } from '@angular/core';import { ScButton, ScEmpty, ScEmptyBody, ScEmptyDescription, ScEmptyHeader, ScEmptyMedia, ScEmptyTitle,} from '@semantic-components/ui';Avatar
LR
User Offline
This user is currently offline. You can leave a message to notify them or try again later.
import { Component, ViewEncapsulation } from '@angular/core';import { ScAvatar, ScAvatarFallback, ScButton, ScEmpty, ScEmptyBody, ScEmptyDescription, ScEmptyHeader, ScEmptyMedia,Avatar group
CNLRER
No Team Members
Invite your team to collaborate on this project.
import { Component, ViewEncapsulation } from '@angular/core';import { ScAvatar, ScAvatarFallback, ScButton, ScEmpty, ScEmptyBody, ScEmptyDescription, ScEmptyHeader, ScEmptyMedia,Input group
404 - Not Found
The page you're looking for doesn't exist. Try searching for what you need below.
Need help? Contact support
import { Component, ViewEncapsulation } from '@angular/core';import { RouterLink } from '@angular/router';import { ScEmpty, ScEmptyBody, ScEmptyDescription, ScEmptyHeader, ScEmptyTitle, ScInput, ScInputGroup,Card
import { Component, ViewEncapsulation } from '@angular/core';import { RouterLink } from '@angular/router';import { ScButton, ScCard, ScCardBody, ScEmpty, ScEmptyBody, ScEmptyDescription, ScEmptyHeader,RTL
لا توجد مشاريع بعد
لم تنشئ أي مشروع بعد. ابدأ بإنشاء مشروعك الأول.
import { Dir } from '@angular/cdk/bidi';import { Component, LOCALE_ID, ViewEncapsulation } from '@angular/core';import { ScButton, ScEmpty, ScEmptyBody, ScEmptyDescription, ScEmptyHeader, ScEmptyMedia, ScEmptyTitle,API reference
Each part takes class, merged over the style (cn: a later class wins).
| Part | Selector | Description |
|---|---|---|
ScEmpty, ScEmptyHeader | div[…] | The empty state, centred (add border for a dashed outline); its header. |
ScEmptyMedia | div[scEmptyMedia] | variant ('default', 'icon' — framed): your icon, avatar or image. |
ScEmptyTitle | div[scEmptyTitle], h2–h6[scEmptyTitle] | What is empty — best a heading. |
ScEmptyDescription, ScEmptyBody | div[…] | Why, and what to do; the actions below. |