Card

354
<script>
  import { Button, Card } from 'twelveui'
</script>

<Card class="max-w-xs">
  <h3 slot="title" 
      class="text-2xl text-gray-900">
      Kittens R Us
  </h3>
  <p slot="subtitle" 
     class="text-sm uppercase text-gray-500">
     Fun & Games
  </p>
  <img slot="media" 
       src="https://placekitten.com/200/200" 
       alt="A cute kitten looking at you."
  >
  <p slot="body" 
     class="text-gray-600">
     We're cuddly and cute all the time. 
     Bring some string and come play with us! 
     We can't wait to see you!
  </p>
  <img slot="avatar" 
       class="rounded-full w-12 h-12" 
       src="https://placekitten.com/200/200" 
       alt="kitten pic">
  <svelte:fragment slot="actions">
    <Button class="text-blue-600">
      Cancel
    </Button>
    <Button class="text-blue-600">
      OK
    </Button>
  </svelte:fragment>
</Card>

Slots

NameTypeUse Case
actionssvelte:fragmentGenerally for buttons or links.
avatarhtml elementSet height, width, and "rounded" look with CSS.
mediahtml elementGenerally for an image or video.
subtitlehtml element
bodyhtml elementDescription/Info for the card.
titlehtml element
topAvatarhtml elementPlace the avatar above the image.
topSubtitlehtml elementPlace the subtitle above the image.
topTitlehtml elementPlace the title above the image.

Props

NameTypeDefaultDescription
classStringemptyCSS class list.