Card
Cards are used to group and display content in a way that is easily readable.
<script lang="ts">
import { Card } from 'stwui';
const cog = "svg-path";
const plus_circle = "svg-path";
</script>
<Card bordered={false}>
<Card.Cover slot="cover">
<img
src="image.png"
alt="cover"
class="object-cover object-center w-full h-full aspect-1"
/>
</Card.Cover>
<Card.Actions slot="actions">
<Card.Actions.Action>
<Card.Actions.Action.Icon data={cog} slot="icon" />
</Card.Actions.Action>
<Card.Actions.Action>
<Card.Actions.Action.Icon data={plus_circle} slot="icon" />
</Card.Actions.Action>
</Card.Actions>
</Card>
<script lang="ts">
import { Card, Media } from 'stwui';
</script>
<Card bordered={false} hoverable>
<Card.Cover slot="cover" class="relative rounded-b-md">
<img
src="image.png"
alt="cover"
class="object-cover object-center w-full h-full aspect-1"
/>
<Card.Cover.Overlay class="top-[unset] h-24">
<Media class="absolute bottom-0 left-0 right-0 px-4 py-5">
<Media.Content>
<Media.Content.Title class="text-white">Europe Street beat</Media.Content.Title>
<Media.Content.Description class="text-gray-200">www.instagram.com</Media.Content.Description>
</Media.Content>
</Media>
</Card.Cover.Overlay>
</Card.Cover>
</Card>
Europe Street beat
www.instagram.com
<script lang="ts">
import { Card, Media } from 'stwui';
</script>
<Card bordered={false}>
<Card.Cover slot="cover">
<img
src="https://tailwindui.com/img/ecommerce-images/category-page-01-image-card-12.jpg"
alt="cover"
class="object-cover object-center w-full h-full aspect-1"
/>
</Card.Cover>
<Card.Content slot="content">
<Media>
<Media.Content>
<Media.Content.Title>Europe Street beat</Media.Content.Title>
<Media.Content.Description>www.instagram.com</Media.Content.Description>
</Media.Content>
</Media>
</Card.Content>
</Card>
Card Header
Card Content
Card Footer
<script lang="ts">
import { Card } from 'stwui';
const numeric_1_box = "svg-path";
const numeric_2_box = "svg-path";
</script>
<Card bordered={false}>
<Card.Header slot="header">Card Header</Card.Header>
<Card.Content slot="content">Card Content</Card.Content>
<Card.Footer slot="footer">Card Footer</Card.Footer>
<Card.Actions slot="actions">
<Card.Actions.Action>
<Card.Actions.Action.Icon data={numeric_1_box} slot="icon" />
</Card.Actions.Action>
<Card.Actions.Action>
<Card.Actions.Action.Icon data={numeric_2_box} slot="icon" />
</Card.Actions.Action>
</Card.Actions>
</Card>
Card Props
divided | boolean | true |
bordered | boolean | true |
hoverable | boolean | false |
elevation | 'none' | 'sm' | 'md' | 'lg' | 'xl' | md |
Card Slots
header | <Card.Header slot="header" /> |
cover | <Card.Cover slot="cover" /> |
content | <Card.Content slot="content" /> |
default | |
footer | <Card.Footer slot="footer" /> |
actions | <Card.Actions slot="actions" /> |
Card.Header Slots
default | |
extra |
Card.Cover Slots
default | |
default | <Card.Cover.Overlay /> |
Card.Content Slots
default |
Card.Footer Slots
default |
Card.Actions Slots
default | <Card.Actions.Action /> |
Card.Actions.Action Slots
icon | <Card.Actions.Action.Icon slot="icon" /> |
label | <Card.Actions.Action.Label slot="label" /> |
Card.Actions.Action.Icon Props
data | string (IconData) | |
viewBox | string | 0 0 24 24 |
size | string | 24px |
width | string | 24px |
height | string | 24px |
color | string | currentColor |
stroke | string | undefined | |
fill | string | currentColor |
Card.Actions.Action.Label Slots
default |