Skip to content

MazCard

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

Basic usage

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.

Advanced 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
    :gallery="{ images: ['https://placedog.net/520/520'], height: 300, zoom: true }"
  >
    <template #content-title>
      <h3>
        Cute Kitten
      </h3>
    </template>
    <template #subtitle>
      <span>
        Cat
      </span>
    </template>
    <template #content-body>
      <p class="maz-text-muted">
        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="destructive"
        class="maz-mr-2"
      >
        <MazIcon name="trash" />
      </MazBtn>
      <MazBtn
        size="md"
        color="contrast"
      >
        <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 :gallery="{ images: ['https://placedog.net/450/450'] }" orientation="row">
  <template #content-title>
    <h3> Cute Kitten </h3>
  </template>
  <template #content-body>
    <p class="maz-text-muted">
      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
  :gallery="{ images: ['https://placedog.net/380/380'] }"
  orientation="row-reverse"
>
  <template #content-title>
    <h3> Cute Kitten </h3>
  </template>
  <template #content-body>
    <p class="maz-text-muted">
      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
  :gallery="{ images: ['https://placedog.net/420/420'], height: 300 }"
  orientation="column-reverse"
>
  <template #content-title>
    <h3> Cute Kitten </h3>
  </template>
  <template #content-body>
    <p class="maz-text-muted">
      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 & v-model: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
vue
<template>
  <MazCard collapsible title="Lorem Ipsum is simply" block style="margin-bottom: 1rem;">
    <p>
      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>
  </MazCard>

  <MazCard collapsible v-model:collapse-open="cardOpen" title="Lorem Ipsum is simply" block>
    <p>
      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>
  </MazCard>
</template>

<script setup>
  import { ref } from 'vue'

  const cardOpen = ref(true)
</script>

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
  :gallery="{ images: ['https://placedog.net/400/400'], height: 300 }"
  href="/components/maz-card#linked-card"
  href-target="_blank"
  block
>
  <span>
    Click on the card to follow the href link
  </span>
</MazCard>

No bordered

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 :bordered="false">
  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.
</MazCard>

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.
View code
html
<MazCard elevation :bordered="false">
  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.
</MazCard>
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
  :gallery="{
    images: ['https://placedog.net/640/640', 'https://placedog.net/560/560', 'https://placedog.net/720/720', 'https://placedog.net/360/360'],
    displayedCount: 3,
    remaining: true,
    zoom: true,
  }"
>
  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.
</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>
  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.

  <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">
  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.

  <template #footer>
    <MazBtn>
      Button
    </MazBtn>
  </template>
</MazCard>

Types

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

Props

NameDescriptionTypeRequired
orientationCard variant: Must be column | row | row-reverse | column-reverse"column" | "row" | "row-reverse" | "column-reverse"No
hrefMake card a link (footer area excluded)stringNo
toMake card a link with a router-link (footer area excluded)Native typeNo
href-targetTarget option of link: Muse be one of _blank | _self | _parent | _top | framename"_blank" | "_self" | "_parent" | "_top" | stringNo
footer-alignFooter text alignment: right | left"right" | "left"No
galleryImages gallery props options (see MazGallery component)MazGalleryPropsNo
scalescale animation on hover (only linked cards)booleanNo
elevationSet elevation to card (box-shadow)booleanNo
radiusSet radius to cardbooleanNo
borderedSet border to card (in dark mode, the card is always bordered)booleanNo
wrapper-classadd classes to wrapperNative typeNo
paddingRemove padding from content wrapperbooleanNo
overflow-hiddenHide overflowbooleanNo
collapsibleMake card collapsiblebooleanNo
collapse-openv-model:collapse-open
Card is open by default if true
booleanNo
titleTitle of the card in headerstringNo
blockThe card will be displayed in full widthbooleanNo

Events

Event namePropertiesDescription
update:collapseOpenUpdate the collapseOpen model

Slots

NameDescriptionBindings
titleThe title of the card
content-titleThe title of the cardcollapse-open mixed - The collapse open state of the card
content-subtitleThe subtitle of the card
content-bodyThe body of the card
defaultThe content of the cardcollapse-open mixed - The collapse open state of the card
footerThe footer of the card
actionsThe actions of the image gallery (only if gallery is displayed)