React Chakra UI Data Display
Last Updated :
24 Apr, 2025
React Chakra UI Data Display is the component that can be embedded in the React application to display various data components. All these components are for data visualization purposes for an interactive and user-friendly interface. The various data components include Card, Badges, List, Table, Tag, Code, and many more data components.
Pre-requisites:
Approach:
We have created a basic box with data components like a Card having all the sub-components like Card header, Content, Card footer, Badges showing notifications, and Code components using Chakra UI Data Display components. We have taken some of the components as examples. Users can include as per their needs or requirements.
Steps To Create React Application And Installing Module:
Step 1: Create a React application using the following command:
npx create-react-app data-display-app
Step 2: After creating your project folder(i.e. data-display-app), move to it by using the following command:
cd data-display-app
Step 3: After creating the React application, Install the required package using the following command:
npm i @chakra-ui/react @emotion/react@^11 @emotion/styled@^11 framer-motion@^6
Project Structure:

The updated dependencies are in the package.json file.
"dependencies": {
"@chakra-ui/react": "^2.8.2",
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"framer-motion": "^6.5.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.4"
}
Example: Write down the code in respective files.
JavaScript
// App.js
import { ChakraProvider, Text} from "@chakra-ui/react";
import Data from "./Data";
import "./App.css";
function App() {
return (
<ChakraProvider>
<Text color="#2F8D46"
fontSize="2rem"
textAlign="center"
fontWeight="600"
my="1rem">
GeeksforGeeks - ReactJS Chakra UI concepts
</Text>
<Data />
</ChakraProvider>
);
}
export default App;
JavaScript
// Data.js
import {
Flex, Box, Badge,Heading,
Stack,Text,Avatar,Button,
Card, CardHeader, CardBody, CardFooter,
Code,HStack,VStack, List,
ListItem,UnorderedList,
} from "@chakra-ui/react";
const Data = () => {
return (
<Box bg="lightgrey" w="100%" p={4}>
<Text as="h2" fontWeight="bold" mb='4'>
Data Display by Chakra UI
</Text>
<Avatar src='' />
<Text as="i" fontSize='md'>
This is avatar
<Badge ml='2' colorScheme='purple'>New</Badge>
</Text>
<Flex justifyContent="center">
<Flex direction="column"
alignItems="left"
w={{ base: "90%" , md: "70%" , lg: "50%" }}>
<Card mb='4'>
<CardHeader>
<Heading size='sm'>This is card header</Heading>
</CardHeader>
<CardBody>
<Stack spacing='2'>
<Box>
<Text pt='2' fontSize='sm'>
This is the main content part to
be filled by the user.
<UnorderedList>
<ListItem>Solve DSA papers</ListItem>
<ListItem>
what is operations management</ListItem>
<ListItem>Use AI tool</ListItem>
</UnorderedList>
</Text>
</Box>
</Stack>
</CardBody>
<CardFooter>
<Text fontWeight='bold'>
This is card footer
</Text>
</CardFooter>
</Card>
<Stack direction='row' mb='4'>
<Button>
<Text> Notifications
<Badge variant='solid' colorScheme='green'>10</Badge>
</Text>
</Button>
<Button>
<Text> Messages
<Badge variant='outline' colorScheme='red'>
14
</Badge>
</Text>
</Button>
</Stack>
<Stack direction='row'>
<Code children='console.log(welcome to ReactJS)' />
<Code colorScheme='green' children='npm run dev' />
</Stack>
</Flex>
</Flex>
</Box>
);
};
export default Data;
Data.js
JavaScript
import {
Flex, Box, Badge,Heading,
Stack,Text,Avatar,Button,
Card, CardHeader, CardBody, CardFooter,
Code,HStack,VStack, List,
ListItem,UnorderedList,
} from "@chakra-ui/react";
const Data = () => {
return (
<Box bg="lightgrey" w="100%" p={4}>
<Text as="h2" fontWeight="bold" mb='4'>
Data Display by Chakra UI
</Text>
<Avatar src='' />
<Text as="i" fontSize='md'>
This is avatar
<Badge ml='2' colorScheme='purple'>New</Badge>
</Text>
<Flex justifyContent="center" >
<Flex
direction="column"
alignItems="left"
w={{ base: "90%", md: "70%", lg: "50%" }}>
<Card mb='4'>
<CardHeader>
<Heading size='sm'>This is card header</Heading>
</CardHeader>
<CardBody>
<Stack spacing='2'>
<Box>
<Text pt='2' fontSize='sm' >
This is the main content part to
be filled by the user.
<UnorderedList>
<ListItem>Solve DSA papers</ListItem>
<ListItem>what is operations management</ListItem>
<ListItem>Use AI tool</ListItem>
</UnorderedList>
</Text>
</Box>
</Stack>
</CardBody>
<CardFooter>
<Text fontWeight='bold'>
This is card footer
</Text>
</CardFooter>
</Card>
<Stack direction='row' mb='4'>
<Button>
<Text> Notifications <Badge variant='solid'
colorScheme='green'>10</Badge>
</Text>
</Button>
<Button>
<Text> Messages
<Badge variant= 'outline' colorScheme='red'>
14
</Badge>
</Text>
</Button>
</Stack>
<Stack direction='row'>
<Code children='console.log(welcome to ReactJS)' />
<Code colorScheme='green' children='npm run dev' />
</Stack>
</Flex>
</Flex>
</Box>
);
};
export default Data;
Step to run the application: Run the application using the following command:
npm run start
Output: Now go to http://localhost:3000 in your browser:

Output:
Similar Reads
Non-linear Components
In electrical circuits, Non-linear Components are electronic devices that need an external power source to operate actively. Non-Linear Components are those that are changed with respect to the voltage and current. Elements that do not follow ohm's law are called Non-linear Components. Non-linear Co
11 min read
JavaScript Tutorial
JavaScript is a programming language used to create dynamic content for websites. It is a lightweight, cross-platform, and single-threaded programming language. JavaScript is an interpreted language that executes code line by line, providing more flexibility.JavaScript on Client Side : On client sid
11 min read
Web Development
Web development is the process of creating, building, and maintaining websites and web applications. It involves everything from web design to programming and database management. Web development is generally divided into three core areas: Frontend Development, Backend Development, and Full Stack De
5 min read
Class Diagram | Unified Modeling Language (UML)
A UML class diagram is a visual tool that represents the structure of a system by showing its classes, attributes, methods, and the relationships between them. It helps everyone involved in a projectâlike developers and designersâunderstand how the system is organized and how its components interact
12 min read
Spring Boot Tutorial
Spring Boot is a Java framework that makes it easier to create and run Java applications. It simplifies the configuration and setup process, allowing developers to focus more on writing code for their applications. This Spring Boot Tutorial is a comprehensive guide that covers both basic and advance
10 min read
React Interview Questions and Answers
React is an efficient, flexible, and open-source JavaScript library that allows developers to create simple, fast, and scalable web applications. Jordan Walke, a software engineer who was working for Facebook, created React. Developers with a JavaScript background can easily develop web applications
15+ min read
HTML Tutorial
HTML stands for HyperText Markup Language. It is the standard language used to create and structure content on the web. It tells the web browser how to display text, links, images, and other forms of multimedia on a webpage. HTML sets up the basic structure of a website, and then CSS and JavaScript
10 min read
Backpropagation in Neural Network
Backpropagation is also known as "Backward Propagation of Errors" and it is a method used to train neural network . Its goal is to reduce the difference between the modelâs predicted output and the actual output by adjusting the weights and biases in the network. In this article we will explore what
10 min read
JavaScript Interview Questions and Answers
JavaScript (JS) is the most popular lightweight, scripting, and interpreted programming language. JavaScript is well-known as a scripting language for web pages, mobile apps, web servers, and many other platforms. Both front-end and back-end developers need to have a strong command of JavaScript, as
15+ min read
AVL Tree Data Structure
An AVL tree defined as a self-balancing Binary Search Tree (BST) where the difference between heights of left and right subtrees for any node cannot be more than one. The absolute difference between the heights of the left subtree and the right subtree for any node is known as the balance factor of
4 min read