Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

@leafygreen-ui/empty-state

Package Overview
Dependencies
Maintainers
6
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leafygreen-ui/empty-state

leafyGreen UI Kit Empty State

latest
Source
npmnpm
Version
3.0.6
Version published
Weekly downloads
1.6K
5.16%
Maintainers
6
Weekly downloads
 
Created
Source

Empty State

npm (scoped)

View on MongoDB.design

Installation

PNPM

pnpm add @leafygreen-ui/empty-state

Yarn

yarn add @leafygreen-ui/empty-state

NPM

npm install @leafygreen-ui/empty-state

Example

Output HTML

Properties

BasicEmptyState

import { BasicEmptyState } from '@leafygreen-ui/empty-state';

<BasicEmptyState
  title="No Results Found"
  description="Try adjusting your filters or search terms"
  graphic={<SvgOrImgComponent />}
  badgeProps={{ variant: 'blue', children: 'Optional' }}
  primaryButton={<Button />}
  secondaryButton={<Button />}
  externalLink={<Link />}
/>

A basic empty state component to be used with MongoDB marketing-approved graphics.

PropTypeDescriptionDefault
graphicReactElementGraphic shown left of text content. The component is designed to be used with MongoDB marketing-approved graphics.undefined
badgePropsBadgePropsOptional props to conditionally render a badge.undefined
title*stringHeading text.
description*ReactChildSecondary text.
primaryButtonReactElementOptional primary call-to-action button.undefined
secondaryButtonReactElementOptional secondary call-to-action button. This should only exist when a primaryButton exists.undefined

FeaturesEmptyState

A component to highlight a set of features in an empty state.

import { FeaturesEmptyState } from '@leafygreen-ui/empty-state';

<FeaturesEmptyState
  title="Explore Your Data"
  features={[
    { graphic: <YourIcon1 />, title: "Feature 1", description: "Description of feature 1" },
    { graphic: <YourIcon2 />, title: "Feature 2", description: "Description of feature 2" },
    { graphic: <YourIcon3 />, title: "Feature 3", description: "Description of feature 3" },
  ]}
  primaryButton={<Button />}
  secondaryButton={<Button />}
  externalLink={<Link />}
/>

PropTypeDescriptionDefault
title*stringHeading text.
features*Array<Feature>Array of feature objects (length should be 2 or 3 elements).
primaryButtonReactElementOptional primary call-to-action button.undefined
secondaryButtonReactElementOptional secondary call-to-action button. This should only exist when a primaryButton exists.undefined
externalLinkReactElementOptional link to external page for additional information.undefined

Note: The features prop must contain an array of feature objects, where each object should have the icon, title, and description properties.

Feature

PropertyTypeDescription
graphicReactElementIcon element to display for the feature.
titlestringTitle of the feature.
descriptionReactChildDescription of the feature.

FAQs

Package last updated on 10 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts