Card
Cards provide a flexible and extensible content container with multiple variants and options.
Basic
A basic card containing a title, content and an extra corner content.
Cards assume no specific width to start, so they'll be 100% wide unless otherwise stated.
<div class="flex flex-col bg-white border shadow-sm rounded-xl dark:bg-gray-800 dark:border-gray-700 dark:shadow-slate-700/[.7]">
<img class="w-full h-auto rounded-t-xl" src="/assets/images/design-system/working-group.jpg" alt="Accessibility Working Group">
<div class="p-4 md:p-5">
<h3 class="text-lg font-bold text-gray-800 dark:text-white">
Accessibility Working Group
</h3>
<p class="mt-1 text-gray-800 dark:text-gray-400">
We have a vibrant accessibility working group where we discuss everything we're doing to push Accessibility and inclusivity at HS2
</p>
<a class="mt-3 py-3 px-4 inline-flex justify-center items-center gap-2 rounded-md border border-transparent font-semibold bg-hs2-secondary text-white hover:bg-hs2-secondary-hover focus:outline-none focus:ring-2 focus:ring-hs2-secondary focus:ring-offset-2 transition-all text-sm dark:focus:ring-offset-gray-800" href="#">
Find out how to get involved in our working group
</a>
</div>
</div>
Content types
Cards support a wide variety of content, including images, text, list groups, links, and more. Below are examples of what's supported.
Body
Simple body example with text.
<div class="flex flex-col bg-white border shadow-sm rounded-xl p-4 md:p-5 dark:bg-gray-800 dark:border-gray-700 dark:shadow-slate-700/[.7] dark:text-gray-400">
Some quick example text to build on the card title and make up the bulk of the card's content.
</div>
Simple card
A simple card only containing a content area.
<div class="flex flex-col bg-white border shadow-sm rounded-xl p-4 md:p-5 dark:bg-gray-800 dark:border-gray-700 dark:shadow-slate-700/[.7]">
<h3 class="text-lg font-bold text-gray-800 dark:text-white">
Card title
</h3>
<p class="mt-1 text-xs font-medium uppercase text-gray-500 dark:text-gray-500">
Card subtitle
</p>
<p class="mt-2 text-gray-800 dark:text-gray-400">
Some quick example text to build on the card title and make up the bulk of the card's content.
</p>
<a class="mt-3 inline-flex items-center gap-2 mt-5 text-sm font-medium text-blue-500 hover:text-blue-700" href="#">
Card link
<svg class="w-2.5 h-auto" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5 1L10.6869 7.16086C10.8637 7.35239 10.8637 7.64761 10.6869 7.83914L5 14" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
</svg>
</a>
</div>
Header and footer
Add an optional header and/or footer within a card.
Simple footer within a card.
Sizes
Small card size.
<div class="flex flex-col bg-white border shadow-sm rounded-xl dark:bg-gray-800 dark:border-gray-700 dark:shadow-slate-700/[.7]">
<div class="p-4 md:p-5">
<h3 class="text-lg font-bold text-gray-800 dark:text-white">
Card title
</h3>
<p class="mt-2 text-gray-800 dark:text-gray-400">
With supporting text below as a natural lead-in to additional content.
</p>
<a class="mt-3 inline-flex items-center gap-2 mt-5 text-sm font-medium text-blue-500 hover:text-blue-700" href="#">
Card link
<svg class="w-2.5 h-auto" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5 1L10.6869 7.16086C10.8637 7.35239 10.8637 7.64761 10.6869 7.83914L5 14" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
</svg>
</a>
</div>
</div>
Default card size.
<div class="flex flex-col bg-white border shadow-sm rounded-xl dark:bg-gray-800 dark:border-gray-700 dark:shadow-slate-700/[.7]">
<div class="p-4 md:p-7">
<h3 class="text-lg font-bold text-gray-800 dark:text-white">
Card title
</h3>
<p class="mt-2 text-gray-800 dark:text-gray-400">
With supporting text below as a natural lead-in to additional content.
</p>
<a class="mt-3 inline-flex items-center gap-2 mt-5 text-sm font-medium text-blue-500 hover:text-blue-700" href="#">
Card link
<svg class="w-2.5 h-auto" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5 1L10.6869 7.16086C10.8637 7.35239 10.8637 7.64761 10.6869 7.83914L5 14" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
</svg>
</a>
</div>
</div>
Large card size
<div class="flex flex-col bg-white border shadow-sm rounded-xl dark:bg-gray-800 dark:border-gray-700 dark:shadow-slate-700/[.7]">
<div class="p-4 md:p-10">
<h3 class="text-lg font-bold text-gray-800 dark:text-white">
Card title
</h3>
<p class="mt-2 text-gray-800 dark:text-gray-400">
With supporting text below as a natural lead-in to additional content.
</p>
<a class="mt-3 inline-flex items-center gap-2 mt-5 text-sm font-medium text-blue-500 hover:text-blue-700" href="#">
Card link
<svg class="w-2.5 h-auto" width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M5 1L10.6869 7.16086C10.8637 7.35239 10.8637 7.64761 10.6869 7.83914L5 14" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
</svg>
</a>
</div>
</div>
Navigation
Add some navigation to a card's header (or block).