Build a Card with Tailwind + Vue [NO COMPONENT LIBRARY 😅]

Опубликовано: 01 Март 2026
на канале: codingoblin
138
12

I use Tailwind component libraries a lot! So I thought I would see how difficult it was to build a card component using Tailwind CSS and no component library. I built the Tailwind card component in Vue.js but the principles are the same for any framework or technology that is capable of using Tailwind!

To get to the same starting point as me, you will need to install a new Vue project. I did this in the standard way, using npm. I then installed Tailwind into my Vue.js project using the instructions for Vite on the Tailwind website. You will then need to create a new component named "Card" and import it into your App.vue file. Once you have done this you are at the exact same starting point as I am in this video!

From the starting point I started building my card component in the Card.vue file. I did this by first adding the HTML markup for the card and then fleshing it out with an image, a title, some content and a button. I then used Tailwind CSS classes to style each part of the card. Next I made the card reusable by defining props on the card. To demonstrate this I created a v-for loop in my App.vue file and looped over an array of cards, creating a grid.

If you can't be bothered to create your own card component using Tailwind, there are plenty of Tailwind component libraries that have pre built cards you can use. I personally like Tailkit (https://tailkit.com/?aff=D67K2) because it has a ridiculous amount of components. Obviously if you think you are better than a professional designer then design your own components 🙂

If anyone is actually reading this description, let me know by leaving a secret code in the comments to confuse other viewers. Thanks.

My Hosting Provider - use code GOBLIN for a discount. Free trial with no card required:
https://platform.cloudways.com/signup...