Skip to content

MazCard

MazCard is a standalone component to display some texts and images and also add button actions

INFO

Before you have to import the global css files in your project, follow instructions in Getting Started

Basic usage

Cute Kitten

Cat

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.

View code
vue
<template>
  <MazCard
    :images="['https://loremflickr.com/600/600']"
    :gallery-height="300"
    zoom
  >
    <template #title>
      <h3 style="margin: 0">
        Cute Kitten
      </h3>
    </template>
    <template #subtitle>
      <span>
        Cat
      </span>
    </template>
    <template #content>
      <p class="maz-text-muted" style="margin: 0; margin-top: 20px">
        Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
      </p>
    </template>
    <template #actions>
      <MazBtn
        size="md"
        fab
        color="danger"
        class="maz-mr-2"
      >
        <MazIcon name="trash" />
      </MazBtn>
      <MazBtn
        size="md"
        color="white"
      >
        <MazIcon name="user-plus" />
      </MazBtn>
    </template>
  </MazCard>
</template>

<script lang="ts" setup>
  import MazCard from 'maz-ui/components/MazCard'
</script>

Orientation

When you display images, you can change the orientation of the card, available options include: column row row-reverse column-reverse

Row


Cute Kitten

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.

View code
html
<MazCard :images="['https://loremflickr.com/600/600']" orientation="row">
  <template #title>
    <h3 style="margin: 0; margin-bottom: 20px">
      Cute Kitten
    </h3>
  </template>
  <template #content>
    <p class="maz-text-muted" style="margin: 0">
      Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
    </p>
  </template>
</MazCard>

Row Reverse


Cute Kitten

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.

View code
html
<MazCard
  :images="['https://loremflickr.com/600/600']"
  orientation="row-reverse"
>
  <template #title>
    <h3 style="margin: 0; margin-bottom: 20px">
      Cute Kitten
    </h3>
  </template>
  <template #content>
    <p class="maz-text-muted" style="margin: 0">
      Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
    </p>
  </template>
</MazCard>

Column Reverse


Cute Kitten

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.

View code
html
<MazCard
  :images="['https://loremflickr.com/600/600']"
  orientation="column-reverse"
>
  <template #title>
    <h3 style="margin: 0; margin-bottom: 20px">
      Cute Kitten
    </h3>
  </template>
  <template #content>
    <p class="maz-text-muted" style="margin: 0">
      Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
    </p>
  </template>
</MazCard>

Collapsible

Use props: collapsible & collapse-open

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.

View code
html
<MazCard collapsible style="width: 100%; margin-bottom: 16px;">
  <template #header>
    <h4 style="margin: 0">
      Lorem Ipsum is simply
    </h4>
  </template>
  <template #content>
    <div style="padding: 16px;">
      <p style="margin: 0">
        Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
      </p>
    </div>
  </template>
</MazCard>

<MazCard collapsible collapse-open style="width: 100%;">
  <template #header>
    <h4 style="margin: 0">
      Lorem Ipsum is simply
    </h4>
  </template>
  <template #content>
    <div style="padding: 16px;">
      <p style="margin: 0">
        Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
      </p>
    </div>
  </template>
</MazCard>

Linked card

To access the link, simply click the card.

  • href is the link or to if you use router-link or nuxt-link
  • href-target is the behavior of the link on click
  • You can use :scale="false" to remove the scale animation on hover
View code
html
<MazCard
  :images="['https://loremflickr.com/1000/1000']"
  href="/components/maz-card#linked-card"
  href-target="_blank"
  scale
>
  <span>
    Click on the card to follow the href link
  </span>
</MazCard>

Bordered and has no elevation

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
View code
html
<MazCard
  :images="['https://loremflickr.com/600/600', 'https://loremflickr.com/700/700', 'https://loremflickr.com/400/400', 'https://loremflickr.com/300/300']"
  :images-show-count="3"
  :no-remaining="false"
  zoom
>
  <span>
    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
  </span>
</MazCard>

Basic

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
View code
html
<MazCard>
  <span>
    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
  </span>
  <template #footer>
    <MazBtn>
      Button
    </MazBtn>
  </template>
</MazCard>

Use the prop option footer-align="left"

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
View code
html
<MazCard footer-align="left">
  <span>
    Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s when an unknown printer took a galley of type and scrambled it to make a type specimen book.
  </span>
  <template #footer>
    <MazBtn>
      Button
    </MazBtn>
  </template>
</MazCard>

Types

ts
type MazGalleryImage =
  | {
      thumbnail?: string
      src: string
      alt?: string
    }
  | string

Props & Slots

Props

Prop nameDescriptionTypeValuesDefault
imagesImages displayedArray-undefined
orientationCard variant: Must be column | row | row-reverse | column-reverseunion-'column'
hrefMake card a link (footer area excluded)string-undefined
toMake card a link with a router-link (footer area excluded)TSIndexedAccessType-undefined
hrefTargetTarget option of link: Muse be one of _blank | _self | _parent | _top | framenameunion-'_self'
footerAlignFooter text alignment: right | leftunion-'right'
galleryWidthGallery image widthunion-200
galleryHeightGallery image heightunion-150
zoomEnable "zoom" image on click (can't be used when the card has a link)boolean-
elevationSet elevation to card (box-shadow)boolean-true
radiusSet radius to cardboolean-true
borderedSet border to card (in dark mode, the card is always bordered)boolean-
imagesShowCountNumber of images shown in the gallerynumber-3
noRemainingRemove transparent layer with the remain count (ex: +2)boolean-true
scalescale animation on hover (only linked cards)boolean-true
wrapperClassadd classes to wrapperTSIndexedAccessType-undefined
noPaddingRemove padding from content wrapperboolean-
overflowHiddenHide overflowboolean-
collapsable
@deprecated Use collapsible instead
boolean-
collapsibleCard can be open and closeboolean-
collapseOpenCard is open by default if trueboolean-
headerTitle of the card in headerstring-undefined
blockThe card will be displayed in full widthboolean-

Slots

NameDescriptionBindings
header
default
title
subtitle
content
footer
actionsaction of gallery