Use our cards
to provide a flexible and extensible content container based on Tailwind CSS with multiple variants and options.
By its definition, a card is a sheet of material that serves as an entry point to more detailed information. Cards usually include a photo, text, and a link about a single subject. They should be easy to scan for relevant and actionable information. Elements, like text and images, should be placed on them in a way that clearly indicates hierarchy.
See below our beautiful card example that you can use in your React and Astro projects. We've also included some card props that are available.
Preview
Code
The place is close to Barceloneta Beach and bus stop just 2 min by walk and near to "Naviglio" where you can enjoy the main night life in Barcelona.
Use this example if you want to showcase your information in a simple and straightforward way. A basic card comes with a headline, a description, and a CTA button.
Preview
Code
The place is close to Barceloneta Beach and bus stop just 2 min by walk and near to "Naviglio" where you can enjoy the main night life in Barcelona.
Use this card example if you are looking to use a link instead a button.
Preview
Code
Showcase user information in a concise way by using this card example. Use high-quality images for a better effect. This type of card is usually used for team member pages, author bio, and user profiles.
This login card is perfect for sections that require user authentication. It contains the usual information for a smooth authentication process.
Preview
Code
This beautiful pricing card will present the pricing plans for the products. It is perfect if you want the highlight the product's features.
Preview
Code
standard
5 team members
200+ components
40+ built-in pages
1 year free updates
Life time technical support
Showcase blog posts in a visually appealing way with our example of blog card. It contains the basic elements that you will need: a headline, an image, a description, authors, and a date.
Preview
Code
Because it's about motivating the doers. Because I'm here to follow my dreams and inspire others.
January 10
If you are looking for a more sophisticated blog card, use this example which uses an image as a background. Blog cards are usually used on blog pages and home pages.
Preview
Code
If you have a service booking section on your website, this card if what you will need! The tooltips are used to show the most important features in a user friendly way.
Preview
Code
5.0
Enter a freshly updated and thoughtfully furnished peaceful home surrounded by ancient trees, stone walls, and open meadows.
The testimonial section is a necessary component of any website. Use our card example to create a beautiful testimonial section.
Preview
Code
Frontend Lead @ Google
"I found solution to all my design needs from Creative Tim. I use them as a freelancer in my hobby projects for fun! And its really affordable, very humble guys !!!"
Here is an example of a simple horizontal card that you can use to showcase the information.
Preview
Code
This ecommerce card is a must for any E-commerce website! Right?
Preview
Code
Apple AirPods
$95.00
With plenty of talk and listen time, voice-activated Siri access, and an available wireless charging case.
The following props are available for card component. These are the custom props that we've added for the card component and you can use all the other native props as well.
Attribute | Type | Description | Default |
---|---|---|---|
variant | Variant | Change card variant | filled |
color | Color | Change card color | white |
shadow | boolean | Add box-shadow for card | true |
className | string | Add custom className for card | '' |
children | node | Add content for card | No default value it's a required prop. |
import type { CardProps } from "@material-tailwind/react";
The following props are available for card header component. These are the custom props that we've added for the card header component and you can use all the other native props as well.
Attribute | Type | Description | Default |
---|---|---|---|
variant | Variant | Change card header variant | filled |
color | Color | Change card header color | white |
shadow | boolean | Add box-shadow for card header | true |
floated | boolean | Makes card header floated | true |
className | string | Add custom className for card header | '' |
children | node | Add content for card header | No default value it's a required prop. |
import type { CardHeaderProps } from "@material-tailwind/react";
The following props are available for card body component. These are the custom props that we've added for the card body component and you can use all the other native props as well.
Attribute | Type | Description | Default |
---|---|---|---|
className | string | Add custom className for card body | '' |
children | node | Add content for card body | No default value it's a required prop. |
import type { CardBodyProps } from "@material-tailwind/react";
The following props are available for card footer component. These are the custom props that we've added for the card footer component and you can use all the other native props as well.
Attribute | Type | Description | Default |
---|---|---|---|
divider | boolean | Add border-top for card footer | false |
className | string | Add custom className for card footer | '' |
children | node | Add content for card footer | No default value it's a required prop. |
import type { CardFooterProps } from "@material-tailwind/react";
type variant = "filled" | "gradient";
type color =
| "transparent"
| "white"
| "blue-gray"
| "gray"
| "brown"
| "deep-orange"
| "orange"
| "amber"
| "yellow"
| "lime"
| "light-green"
| "green"
| "teal"
| "cyan"
| "light-blue"
| "blue"
| "indigo"
| "deep-purple"
| "purple"
| "pink"
| "red";
Learn how to customize the theme and styles for card components, the theme object for card components has three main objects:
A. The defaultProps
object for setting up the default value for props of card component.
B. The valid
object for customizing the valid values for card component props.
C. The styles
object for customizing the theme and styles of card component.
You can customize the theme and styles of card components by adding Tailwind CSS classes as key paired values for objects.
interface CardStylesType {
defaultProps: {
variant: string;
color: string;
shadow: boolean;
className: string;
};
valid: {
variants: string[];
colors: string[];
};
styles: {
base: {
initial: object;
shadow: object;
};
variants: {
filled: object;
gradient: object;
};
};
}
import type { CardStylesType } from "@material-tailwind/react";
const theme = {
card: {
defaultProps: {
variant: "filled",
color: "white",
shadow: true,
className: "",
},
valid: {
variants: ["filled", "gradient"],
colors: [
"transparent",
"white",
"blue-gray",
"gray",
"brown",
"deep-orange",
"orange",
"amber",
"yellow",
"lime",
"light-green",
"green",
"teal",
"cyan",
"light-blue",
"blue",
"indigo",
"deep-purple",
"purple",
"pink",
"red",
],
},
styles: {
base: {
initial: {
position: "relative",
display: "flex",
flexDirection: "flex-col",
backgroundClip: "bg-clip-border",
borderRadius: "rounded-xl",
},
shadow: {
boxShadow: "shadow-md",
},
},
variants: {
filled: {
transparent: {
backgroud: "bg-transparent",
color: "text-gray-700",
shadow: "shadow-none",
},
white: {
backgroud: "bg-white",
color: "text-gray-700",
},
"blue-gray": {
backgroud: "bg-blue-gray-500",
color: "text-white",
shadow: "shadow-blue-gray-500/40",
},
gray: {
backgroud: "bg-gray-500",
color: "text-white",
shadow: "shadow-gray-500/40",
},
brown: {
backgroud: "bg-brown-500",
color: "text-white",
shadow: "shadow-brown-500/40",
},
"deep-orange": {
backgroud: "bg-deep-orange-500",
color: "text-white",
shadow: "shadow-deep-orange-500/40",
},
orange: {
backgroud: "bg-orange-500",
color: "text-white",
shadow: "shadow-orange-500/40",
},
amber: {
backgroud: "bg-amber-500",
color: "text-gray-700",
shadow: "shadow-amber-500/40",
},
yellow: {
backgroud: "bg-yellow-500",
color: "text-gray-700",
shadow: "shadow-yellow-500/40",
},
lime: {
backgroud: "bg-lime-500",
color: "text-gray-700",
shadow: "shadow-lime-500/40",
},
"light-green": {
backgroud: "bg-light-green-500",
color: "text-white",
shadow: "shadow-light-green-500/40",
},
green: {
backgroud: "bg-green-500",
color: "text-white",
shadow: "shadow-green-500/40",
},
teal: {
backgroud: "bg-teal-500",
color: "text-white",
shadow: "shadow-teal-500/40",
},
cyan: {
backgroud: "bg-cyan-500",
color: "text-white",
shadow: "shadow-cyan-500/40",
},
"light-blue": {
backgroud: "bg-light-blue-500",
color: "text-white",
shadow: "shadow-light-blue-500/40",
},
blue: {
backgroud: "bg-blue-500",
color: "text-white",
shadow: "shadow-blue-500/40",
},
indigo: {
backgroud: "bg-indigo-500",
color: "text-white",
shadow: "shadow-indigo-500/40",
},
"deep-purple": {
backgroud: "bg-deep-purple-500",
color: "text-white",
shadow: "shadow-deep-purple-500/40",
},
purple: {
backgroud: "bg-purple-500",
color: "text-white",
shadow: "shadow-purple-500/40",
},
pink: {
backgroud: "bg-pink-500",
color: "text-white",
shadow: "shadow-pink-500/40",
},
red: {
backgroud: "bg-red-500",
color: "text-white",
shadow: "shadow-red-500/40",
},
},
gradient: {
transparent: {
backgroud: "bg-transparent",
color: "text-gray-700",
shadow: "shadow-none",
},
white: {
backgroud: "bg-white",
color: "text-gray-700",
},
"blue-gray": {
backgroud: "bg-gradient-to-tr from-blue-gray-600 to-blue-gray-400",
color: "text-white",
shadow: "shadow-blue-gray-500/40",
},
gray: {
backgroud: "bg-gradient-to-tr from-gray-600 to-gray-400",
color: "text-white",
shadow: "shadow-gray-500/40",
},
brown: {
backgroud: "bg-gradient-to-tr from-brown-600 to-brown-400",
color: "text-white",
shadow: "shadow-brown-500/40",
},
"deep-orange": {
backgroud: "bg-gradient-to-tr from-deep-orange-600 to-deep-orange-400",
color: "text-white",
shadow: "shadow-deep-orange-500/40",
},
orange: {
backgroud: "bg-gradient-to-tr from-orange-600 to-orange-400",
color: "text-white",
shadow: "shadow-orange-500/40",
},
amber: {
backgroud: "bg-gradient-to-tr from-amber-600 to-amber-400",
color: "text-gray-700",
shadow: "shadow-amber-500/40",
},
yellow: {
backgroud: "bg-gradient-to-tr from-yellow-600 to-yellow-400",
color: "text-gray-700",
shadow: "shadow-yellow-500/40",
},
lime: {
backgroud: "bg-gradient-to-tr from-lime-600 to-lime-400",
color: "text-gray-700",
shadow: "shadow-lime-500/40",
},
"light-green": {
backgroud: "bg-gradient-to-tr from-light-green-600 to-light-green-400",
color: "text-white",
shadow: "shadow-light-green-500/40",
},
green: {
backgroud: "bg-gradient-to-tr from-green-600 to-green-400",
color: "text-white",
shadow: "shadow-green-500/40",
},
teal: {
backgroud: "bg-gradient-to-tr from-teal-600 to-teal-400",
color: "text-white",
shadow: "shadow-teal-500/40",
},
cyan: {
backgroud: "bg-gradient-to-tr from-cyan-600 to-cyan-400",
color: "text-white",
shadow: "shadow-cyan-500/40",
},
"light-blue": {
backgroud: "bg-gradient-to-tr from-light-blue-600 to-light-blue-400",
color: "text-white",
shadow: "shadow-light-blue-500/40",
},
blue: {
backgroud: "bg-gradient-to-tr from-blue-600 to-blue-400",
color: "text-white",
shadow: "shadow-blue-500/40",
},
indigo: {
backgroud: "bg-gradient-to-tr from-indigo-600 to-indigo-400",
color: "text-white",
shadow: "shadow-indigo-500/40",
},
"deep-purple": {
backgroud: "bg-gradient-to-tr from-deep-purple-600 to-deep-purple-400",
color: "text-white",
shadow: "shadow-deep-purple-500/40",
},
purple: {
backgroud: "bg-gradient-to-tr from-purple-600 to-purple-400",
color: "text-white",
shadow: "shadow-purple-500/40",
},
pink: {
backgroud: "bg-gradient-to-tr from-pink-600 to-pink-400",
color: "text-white",
shadow: "shadow-pink-500/40",
},
red: {
backgroud: "bg-gradient-to-tr from-red-600 to-red-400",
color: "text-white",
shadow: "shadow-red-500/40",
},
},
},
},
},
};
interface CardHeaderStylesType {
defaultProps: {
variant: string;
color: string;
shadow: boolean;
floated: boolean;
className: string;
};
valid: {
variants: string[];
colors: string[];
};
styles: {
base: {
initial: object;
shadow: object;
floated: object;
};
variants: {
filled: object;
gradient: object;
};
};
}
import type { CardHeaderStylesType } from "@material-tailwind/react";
const theme = {
cardHeader: {
defaultProps: {
variant: "filled",
color: "white",
shadow: true,
floated: true,
className: "",
},
valid: {
variants: ["filled", "gradient"],
colors: [
"transparent",
"white",
"blue-gray",
"gray",
"brown",
"deep-orange",
"orange",
"amber",
"yellow",
"lime",
"light-green",
"green",
"teal",
"cyan",
"light-blue",
"blue",
"indigo",
"deep-purple",
"purple",
"pink",
"red",
],
},
styles: {
base: {
initial: {
position: "relative",
backgroundClip: "bg-clip-border",
mt: "mt-4",
mx: "mx-4",
borderRadius: "rounded-xl",
overflow: "overflow-hidden",
},
shadow: {
boxShadow: "shadow-lg",
},
floated: {
mt: "-mt-6",
},
},
variants: {
filled: {
transparent: {
backgroud: "bg-transparent",
color: "text-gray-700",
shadow: "shadow-none",
},
white: {
backgroud: "bg-white",
color: "text-gray-700",
},
"blue-gray": {
backgroud: "bg-blue-gray-500",
color: "text-white",
shadow: "shadow-blue-gray-500/40",
},
gray: {
backgroud: "bg-gray-500",
color: "text-white",
shadow: "shadow-gray-500/40",
},
brown: {
backgroud: "bg-brown-500",
color: "text-white",
shadow: "shadow-brown-500/40",
},
"deep-orange": {
backgroud: "bg-deep-orange-500",
color: "text-white",
shadow: "shadow-deep-orange-500/40",
},
orange: {
backgroud: "bg-orange-500",
color: "text-white",
shadow: "shadow-orange-500/40",
},
amber: {
backgroud: "bg-amber-500",
color: "text-gray-700",
shadow: "shadow-amber-500/40",
},
yellow: {
backgroud: "bg-yellow-500",
color: "text-gray-700",
shadow: "shadow-yellow-500/40",
},
lime: {
backgroud: "bg-lime-500",
color: "text-gray-700",
shadow: "shadow-lime-500/40",
},
"light-green": {
backgroud: "bg-light-green-500",
color: "text-white",
shadow: "shadow-light-green-500/40",
},
green: {
backgroud: "bg-green-500",
color: "text-white",
shadow: "shadow-green-500/40",
},
teal: {
backgroud: "bg-teal-500",
color: "text-white",
shadow: "shadow-teal-500/40",
},
cyan: {
backgroud: "bg-cyan-500",
color: "text-white",
shadow: "shadow-cyan-500/40",
},
"light-blue": {
backgroud: "bg-light-blue-500",
color: "text-white",
shadow: "shadow-light-blue-500/40",
},
blue: {
backgroud: "bg-blue-500",
color: "text-white",
shadow: "shadow-blue-500/40",
},
indigo: {
backgroud: "bg-indigo-500",
color: "text-white",
shadow: "shadow-indigo-500/40",
},
"deep-purple": {
backgroud: "bg-deep-purple-500",
color: "text-white",
shadow: "shadow-deep-purple-500/40",
},
purple: {
backgroud: "bg-purple-500",
color: "text-white",
shadow: "shadow-purple-500/40",
},
pink: {
backgroud: "bg-pink-500",
color: "text-white",
shadow: "shadow-pink-500/40",
},
red: {
backgroud: "bg-red-500",
color: "text-white",
shadow: "shadow-red-500/40",
},
},
gradient: {
transparent: {
backgroud: "bg-transparent",
color: "text-gray-700",
shadow: "shadow-none",
},
white: {
backgroud: "bg-white",
color: "text-gray-700",
},
"blue-gray": {
backgroud: "bg-gradient-to-tr from-blue-gray-600 to-blue-gray-400",
color: "text-white",
shadow: "shadow-blue-gray-500/40",
},
gray: {
backgroud: "bg-gradient-to-tr from-gray-600 to-gray-400",
color: "text-white",
shadow: "shadow-gray-500/40",
},
brown: {
backgroud: "bg-gradient-to-tr from-brown-600 to-brown-400",
color: "text-white",
shadow: "shadow-brown-500/40",
},
"deep-orange": {
backgroud: "bg-gradient-to-tr from-deep-orange-600 to-deep-orange-400",
color: "text-white",
shadow: "shadow-deep-orange-500/40",
},
orange: {
backgroud: "bg-gradient-to-tr from-orange-600 to-orange-400",
color: "text-white",
shadow: "shadow-orange-500/40",
},
amber: {
backgroud: "bg-gradient-to-tr from-amber-600 to-amber-400",
color: "text-gray-700",
shadow: "shadow-amber-500/40",
},
yellow: {
backgroud: "bg-gradient-to-tr from-yellow-600 to-yellow-400",
color: "text-gray-700",
shadow: "shadow-yellow-500/40",
},
lime: {
backgroud: "bg-gradient-to-tr from-lime-600 to-lime-400",
color: "text-gray-700",
shadow: "shadow-lime-500/40",
},
"light-green": {
backgroud: "bg-gradient-to-tr from-light-green-600 to-light-green-400",
color: "text-white",
shadow: "shadow-light-green-500/40",
},
green: {
backgroud: "bg-gradient-to-tr from-green-600 to-green-400",
color: "text-white",
shadow: "shadow-green-500/40",
},
teal: {
backgroud: "bg-gradient-to-tr from-teal-600 to-teal-400",
color: "text-white",
shadow: "shadow-teal-500/40",
},
cyan: {
backgroud: "bg-gradient-to-tr from-cyan-600 to-cyan-400",
color: "text-white",
shadow: "shadow-cyan-500/40",
},
"light-blue": {
backgroud: "bg-gradient-to-tr from-light-blue-600 to-light-blue-400",
color: "text-white",
shadow: "shadow-light-blue-500/40",
},
blue: {
backgroud: "bg-gradient-to-tr from-blue-600 to-blue-400",
color: "text-white",
shadow: "shadow-blue-500/40",
},
indigo: {
backgroud: "bg-gradient-to-tr from-indigo-600 to-indigo-400",
color: "text-white",
shadow: "shadow-indigo-500/40",
},
"deep-purple": {
backgroud: "bg-gradient-to-tr from-deep-purple-600 to-deep-purple-400",
color: "text-white",
shadow: "shadow-deep-purple-500/40",
},
purple: {
backgroud: "bg-gradient-to-tr from-purple-600 to-purple-400",
color: "text-white",
shadow: "shadow-purple-500/40",
},
pink: {
backgroud: "bg-gradient-to-tr from-pink-600 to-pink-400",
color: "text-white",
shadow: "shadow-pink-500/40",
},
red: {
backgroud: "bg-gradient-to-tr from-red-600 to-red-400",
color: "text-white",
shadow: "shadow-red-500/40",
},
},
},
},
},
};
interface CardBodyStylesType {
defaultProps: {
className: string;
};
styles: {
base: object;
};
}
import type { CardBodyStylesType } from "@material-tailwind/react";
const theme = {
cardBody: {
defaultProps: {
className: "",
},
styles: {
base: {
p: "p-6",
},
},
},
};
interface CardFooterStylesType {
defaultProps: {
className: string;
divider: boolean;
};
styles: {
base: {
initial: object;
divider: object;
};
};
}
import type { CardFooterStylesType } from "@material-tailwind/react";
const theme = {
cardFooter: {
defaultProps: {
className: "",
},
styles: {
base: {
initial: {
p: "p-6",
},
divider: {
borderWidth: "border-t",
borderColor: "border-blue-gray-50",
},
},
},
},
};
If you want to see more examples and properties please check the official Material Tailwind Documentation.