Card
Set up
Import Card in the script tag.
<script>
import { Card } from "flowbite-svelte";
</script>
Examples
Noteworthy technology acquisitions 2021
Here are the biggest enterprise technology acquisitions of 2021 so far, in reverse chronological order.
<Card header="Noteworthy technology acquisitions 2021">
<p class="mb-3 font-normal text-gray-700 dark:text-gray-400" slot="paragraph">
Here are the biggest enterprise technology acquisitions of 2021 so far, in reverse chronological order.
</p>
</Card>
Card with a link
Noteworthy technology acquisitions 2021
Here are the biggest enterprise technology acquisitions of 2021 so far, in reverse chronological order.
Read more<Card header="Noteworthy technology acquisitions 2021" link="/" btnLabel="Read more">
<p class="mb-3 font-normal text-gray-700 dark:text-gray-400" slot="paragraph">
Here are the biggest enterprise technology acquisitions of 2021 so far, in reverse chronological order.
</p>
</Card>
Card with image
Noteworthy technology acquisitions 2021
Here are the biggest enterprise technology acquisitions of 2021 so far, in reverse chronological order.
Read more<Card img="/images/image-1.jpeg" header="Noteworthy technology acquisitions 2021" link="/" btnLabel="Read more">
<p class="mb-3 font-normal text-gray-700 dark:text-gray-400" slot="paragraph">
Here are the biggest enterprise technology acquisitions of 2021 so far, in reverse chronological order.
</p>
</Card>
Card with a Button component
If you need a click handler rather than a link, use a Button component.
Button component
Lorem ipsum dolor sit amet consectetur adipisicing elit.
<script>
const btn1 = () => {
alert('You clicked.')
}
</scipt>
<Card
img="/images/image-1.jpeg"
header="Button component"
btnLabel="Read more"
><span slot="paragraph">
<p class="mb-3 font-normal text-gray-700 dark:text-gray-400" >
Lorem ipsum dolor sit amet consectetur adipisicing elit.
</p>
<div class="w-full pt-4">
<Button on:click={btn1}>Click me</Button>
</div>
</span>
</Card>
Props
The component has the following props, type, and default values. See types page for type information.
Name | Type | Default |
---|---|---|
link | string | '' |
rel | string | '' |
alt | string | '' |
img | string | '' |
btnLabel | string | '' |
btnColor | Colors | 'blue' |
textdivClass | string | 'p-5' |
headerClass | string | 'mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white' |
header | string | '' |
divClass | string | 'max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700' |