Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • NextJS
  • Material UI
  • React Bootstrap
  • React Suite
  • Ant Design
  • Reactstrap
  • BlueprintJS
  • React Desktop
  • React Native
  • React Rebass
  • React Spring
  • React Evergreen
  • ReactJS
  • ReactJS
  • JS Formatter
  • Web Technology
Open In App
Next Article:
ReactJS Reactstrap Collapse Component
Next article icon

ReactJS Reactstrap Card Component

Last Updated : 07 Mar, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

Reactstrap: Reactstrap is a popular front-end library that is easy to use React Bootstrap 4 components. This library contains the stateless React components for Bootstrap 4. The Card components allow the user to display content. We can use the following approach in ReactJS to use the ReactJS Reactstrap Card Component.

Properties of the ReactStrap props:

Card Props:

  • tag: Card Props tag can be a function or a string, and it is used to denote the tag for this component.
  • inverse: The inverse props in reactStrap are used to indicate whether to inverse text color or not.
  • color: The color props are used to change the color of the card. It should be RGB format and the name of the  color.
  • body: The body props are used to indicate whether to apply card-body class or not in the reactStrap component.
  • className: The className props are used to denote the class name for styling the component in reactStrap.

CardBody Props:

  • tag: The CardBody props can be a function or a string, and it is used to denote the tag for this component in reactStrap.
  • className: The className props are used to denote the class name for this component in reactStrap.
 

CardColumns Props:

  • tag: The tag CardColumns Props can be a function or a string, and it is used to denote the tag for this component.
  • className: The className props are used to denote the class name for this component, which is used for styling the CSS.

Card deck Props:

  • tag: The tag props come under the Card deck Props. On the card deck, it can be a function or a string, and it is used to denote the tag for this component.
  • className: The className props come under Card deck Props and are used to denote the class name for this component.

CardFooter Props:

  • tag: The tag Props come under the CardFooter Props. It can be a function or a string, and it is used to denote the tag for this component.
  • className: The className props come under the CardFooter Props. It is used to denote the class name for this component.

CardGroup Props:

  • tag: The tag props in CardGroup can be a function or a string, and it is used to denote the tag for this component.
  • className: className pops comes under the CardGroup Props .It is used to denote the class name for this component.

CardHeader Props:

  • tag: The CardHeader tag prop can be a function or a string, and it is used to denote the tag for this component.
  • className: The className props come under CardHeader props .It is used to denote the class name for this component.

CardImg Props:

  • tag: The tag can be a function or a string, and it is used to denote the tag for this component.
  • className: The className is used to denote the class name for this component.
  • top: The top props are used to position images through card-img-top class.
  • bottom: The bottom props are used to position images through card-img-bottom class.

CardImgOverlay Props:

  • tag: The tag prop can be a function or a string, and it is used to denote the tag for this component.
  • className: The className props are used to denote the class name for this component.
 

CardLink Props:

  • tag: This cardLink prop can be a function or a string, and it is used to denote the tag for this component.
  • className: This className prop is used to denote the class name for this component.
  • innerRef: This innerRef prop is used to denote the inner reference element.

CardSubtitle Props:

  • tag: This prop can be a function or a string, and it is used to denote the tag for this component.
  • className: These props can be used to denote the class name for this component.

CardText Props:

  • tag: This prop can be a function or a string, and it is used to denote the tag for this component.
  • className: This prop is used to denote the class name for this component.

CardTitle Props :

  • tag: This prop can be a function or a string, and it is used to denote the tag for this component.
  • className: These props, className props are used to denote the class name for this component.

The syntax for Creating React Application And Installing Modules:

  • Step 1: Create a React application using the following command.
    npx create-react-app foldername
  • Step 2: After creating your project folder i.e. folder name, move to it using the following command.
    cd foldername
  • Step 3: Install Reactstrap in your given directory.
 npm install --save reactstrap react react-dom

Project Structure: It will look like the following :

Project Structure

Example 1: Now write down the following code in the App.js file. Here, the App is our default component where we have written our code.

App.js
import React from 'react' import 'bootstrap/dist/css/bootstrap.min.css'; import {     Card, CardImg, CardBody,     CardTitle, CardText, Button } from "reactstrap"  function App() {     return (         <div style={{             display: 'block', width: 700, padding: 30         }}>             <h4>ReactJS Reactstrap Card Component</h4>             <Card>                 <CardImg                     width="50px"                     height="50px"                 src="https://media.geeksforgeeks.org/wp-content/                           uploads/20210425000233/test-300x297.png"                     alt="GFG Logo" />                 <CardBody>                     <CardTitle tag="h5">Sample Card title</CardTitle>                     <CardText>Sample Card Text to display!</CardText>                     <Button>Action Button</Button>                 </CardBody>             </Card>         </div>     ); }  export default App; 

 

Step to Run Application: Run the application using the following command from the root directory of the project: 

npm start

Output: Now open your browser and go to http://localhost:3000/, you will see the following output:

Card Component

Example 2:This is another example for ReactStrap card component. 

App.js
import React from "react"; import {   Card,CardBody,CardLink,CardTitle,     } from "reactstrap";  const Example = (props) => {   return (     <div>       <Card>         <CardBody>           <CardTitle tag="h5">GFG Practice Portal </CardTitle>           <img           width="50%"           src="https://media.geeksforgeeks.org/wp-content/                uploads/20210728115525/imggggg.png"           alt="Card image cap"         />                               <p>             The Best Data Structures Course Available Online From Skilled              And Experienced Faculty. Learn Data Structures In A Live              Classroom With The Best Of Faculty In The Industry.              Classroom Experience.           </p>          </CardBody>                 <CardBody>                     <CardLink href="https://www.geeksforgeeks.org/html-images/">              To knbow more about us...            </CardLink>           </CardBody>       </Card>     </div>   ); };  export default Example; 
card components 

Next Article
ReactJS Reactstrap Collapse Component
author
gouravhammad
Improve
Article Tags :
  • JavaScript
  • Web Technologies
  • ReactJS
  • Reactstrap

Similar Reads

  • ReactJS Reactstrap Alert Component
    Reactstrap: Reactstrap is a popular front-end library that is easy to use React Bootstrap 4 components. This library contains the stateless React components for Bootstrap 4. The alert Component is used for urgent interruptions, requiring acknowledgment that informs the user about a situation. We can
    2 min read
  • ReactJS Reactstrap Badges Component
    Reactstrap is a bootstrap-based react UI library that is used to make good-looking webpages with its seamless and easy-to-use component. In this article we will know how to use Badges Component in Reactstrap. Badges are used for creating labels. Badges scale to match the size of the immediate parent
    2 min read
  • ReactJS Reactstrap Carousel Component
    Reactstrap is a popular front-end library that is easy to use React Bootstrap 4 components. This library contains the stateless React components for Bootstrap 4. The Carousel component allows the user to show the sliding item, and it is used when there is a group of content on the same level. We can
    6 min read
  • ReactJS Reactstrap Collapse Component
    Reactstrap is a popular front-end library that is easy to use React Bootstrap 4 components. This library contains the stateless React components for Bootstrap 4. The Collapse component is used as a content area that can be collapsed and expanded. We can use the following approach in ReactJS to use t
    3 min read
  • ReactJS Reactstrap Nav Component
    Reactstrap is a popular front-end library that is easy to use React Bootstrap 4 components. This library contains the stateless React components for Bootstrap 4. The Nav component allows the user to provide a list of various forms of navigation menus. We can use the following approach in ReactJS to
    3 min read
  • ReactJS Reactstrap Tab Component
    Reactstrap is a popular front-end library that is easy to use React Bootstrap 4 components. This library contains the stateless React components for Bootstrap 4. The Tab component allows the user to switch between components present in given different tabs. We can use the following approach in React
    3 min read
  • ReactJS Reactstrap Form Component
    Reactstrap is a popular front-end library that is easy to use React Bootstrap 4 components. This library contains the stateless React components for Bootstrap 4. The Form component is used when the user needs to create an instance or collect information. We can use the following approach in ReactJS
    5 min read
  • ReactJS Reactstrap List Component
    Reactstrap is a popular front-end library that is easy to use React Bootstrap 4 components. This library contains the stateless React components for Bootstrap 4. The List component allows the user to display a list. We can use the following approach in ReactJS to use the ReactJS Reactstrap List Comp
    3 min read
  • ReactJS Reactstrap Fade Component
    Reactstrap is a popular front-end library that is easy to use React Bootstrap 4 components. This library contains the stateless React components for Bootstrap 4. The Fade component provides a way to add a fade animation to a child component or an element. We can use the following approach in ReactJS
    4 min read
  • ReactJS Reactstrap Button Component
    Reactstrap is a popular front-end library that is easy to use React Bootstrap 4 components. This library contains the stateless React components for Bootstrap 4. The Button component allows the user to take action, and make choices, with a single tap. We can use the following approach in ReactJS to
    3 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences