shadcn-templ 2.0 beta. Switch to templUI v1
1.7k

Empty

Use the Empty component to display a empty state.

No Projects Yet
You haven't created any projects yet. Get started by creating your first project.
Learn More
package examples import (

Installation

shadcn-templ add empty

Usage

import "github.com/axadrn/shadcn-templ/v2/components/empty"
@empty.Empty() {	@empty.Header() {		@empty.Media(empty.MediaProps{Variant: empty.MediaVariantIcon}) {			@icon.FolderOpen()		}		@empty.Title() {			No data		}		@empty.Description() {			No data found		}	}	@empty.Content() {		@button.Button() {			Add data		}	}}

Composition

Use the following composition to build an Empty state:

empty.Empty├── empty.Header│   ├── empty.Media│   ├── empty.Title│   └── empty.Description└── empty.Content

Outline

Use the border utility class to create an outline empty state.

Cloud Storage Empty
Upload files to your cloud storage to access them anywhere.
package examples import (

Background

Use the bg-* and bg-gradient-* utilities to add a background to the empty state.

No Notifications
You're all caught up. New notifications will appear here.
package examples import (

Avatar

Use the empty.Media component to display an avatar in the empty state.

AA
User Offline
This user is currently offline. You can leave a message to notify them or try again later.
package examples import (

Avatar Group

Use the empty.Media component to display an avatar group in the empty state.

@axadrn AA
@a-h AH
@joerdav JD
No Team Members
Invite your team to collaborate on this project.
package examples import (

InputGroup

You can add an inputgroup.InputGroup component to the empty.Content component.

404 - Not Found
The page you're looking for doesn't exist. Try searching for what you need below.
/
Need help? Contact support
package examples import (

API Reference

Empty

The main component of the empty state. Wraps the empty.Header and empty.Content components.

Prop Type Default
Class string -
@empty.Empty() {	@empty.Header()	@empty.Content()}

EmptyHeader

The empty.Header component wraps the empty media, title, and description.

Prop Type Default
Class string -
@empty.Header() {	@empty.Media()	@empty.Title()	@empty.Description()}

EmptyMedia

Use the empty.Media component to display the media of the empty state such as an icon or an image. You can also use it to display other components such as an avatar.

Prop Type Default
Variant MediaVariantDefault | MediaVariantIcon MediaVariantDefault
Class string -
@empty.Media(empty.MediaProps{Variant: empty.MediaVariantIcon}) {	@icon.FolderCode()}
@empty.Media() {	@avatar.Avatar() {		@avatar.Image(avatar.ImageProps{Src: "..."})		@avatar.Fallback() {			AA		}	}}

EmptyTitle

Use the empty.Title component to display the title of the empty state.

Prop Type Default
Class string -
@empty.Title() {	No data}

EmptyDescription

Use the empty.Description component to display the description of the empty state.

Prop Type Default
Class string -
@empty.Description() {	You do not have any notifications.}

EmptyContent

Use the empty.Content component to display the content of the empty state such as a button, input or a link.

Prop Type Default
Class string -
@empty.Content() {	@button.Button() {		Add Project	}}