Skip to content

Card

te-card is a surface with optional header, image, title and footer.

Basic

A card
Cards take their body from the default slot.
vue
<te-card title="A card">
  Cards take their body from the default slot.
</te-card>

Both need their flag as well as their slot.

Header
Full card
Body content.
Footer
vue
<te-card has-header has-footer title="Full card">
  <template #header>Header</template>
  Body content.
  <template #footer>Footer</template>
</te-card>

Width and shadow

width accepts a number of pixels or any CSS length.

Narrow
Body.
Shadowless
Body.
vue
<te-card :width="240" title="Narrow">Body.</te-card>
<te-card width="20rem" shadowless title="Shadowless">Body.</te-card>

Props

PropTypeDefaultDescription
titlestring''Heading above the body. Overridable with the title slot.
imgSrcstring''Image rendered above the body.
widthstring | number'350px'A number is treated as pixels.
hasHeaderbooleanfalseRenders the header slot.
hasFooterbooleanfalseRenders the footer slot.
shadowlessbooleanfalseDrops the shadow and rounding.

Slots

SlotPropsDescription
defaultCard body.
titleReplaces the title prop.
headerHeader area. Requires has-header.
footerFooter area. Requires has-footer.

Released under the MIT License.