User Tools

Site Tools


wiki:syntax:card

Card

Mikio Plugin

https://github.com/nomadjimbob/mikioplugin/wiki/Card

Creates a card element

Image cap
Card title
Some quick example text to build on the card title and make up the bulk of the card's content. Go somewhere

<card placeholder-text="Image cap" title="Card title" width=18em>
Some quick example text to build on the card title and make up the bulk of the card's content.

<button>Go somewhere</button>
</card>

Featured
Special title treatment
With supporting text below as a natural lead-in to additional content. Go somewhere

<card header="Featured" footer="2 days ago" title="Special title treatment" text-center>
With supporting text below as a natural lead-in to additional content.

<button>Go somewhere</button>
</card>

Horizontal

Card image
Card title
This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.

<card placeholder-text="Card image" title="Card title" footer="Last updated 3 mins ago" horizontal>This is a wider card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</card>

Attributes

title: Inserts a title element into the cards body
subtitle: Inserts a subtitle element into the cards body
no-body: Removes any padding in the card body

horizontal: Displays the card horizontally

image: Displays an image at the top of the card (contained within the object)
image-cover: True or false to use the image to cover the space instead of contain the entire image
footer-image: Displays an image at the bottom of the card

placeholder-text: Displays a placeholder with the text at the top of the card
footer-placeholder-text: Displays a placeholder with the text at the bottom of the card

overlay: Displays either the image or placeholder-text underneath the card
header: Displays a card header with text
footer: Displays a card footer with text
footer-small: Displays a card footer with small text

Individual Elements

Card elements also support seperate elements instead of using attribute values for advanced designs:

Fancy header
Special title treatment
With supporting text below as a natural lead-in to additional content. Go somewhere

<card width=18em no-body>
<card-header>Fancy header</card-header>
<card-body>
<card-title>Special title treatment</card-title>
With supporting text below as a natural lead-in to additional content.

<button>Go somewhere</button>
</card-body>
<card-footer>Footer text</card-footer>
</card>

Listgroup Card

An example of a card using a listgroup in the body. As the cards body has its own padding, the flush attribute is used on the listgroup to remove its own margins.

Fancy header
Special title treatment
This is my list group
  • Item 1
  • Item 2
  • Item 3

<card width=18em no-body>
<card-header>Fancy header</card-header>
<card-body>
<card-title>Special title treatment</card-title>
This is my list group
</card-body>
<listgroup flush>
<listgroup-item>Item 1</listgroup-item>
<listgroup-item>Item 2</listgroup-item>
<listgroup-item>Item 3</listgroup-item>
</listgroup>
<card-footer>Footer text</card-footer>
</card>

Buttons

All elements inside a card receive a width of 100% as part of the CSS flexbox styling. This means that items such as buttons will be treated as block elements and you will be required to explicitly set their width and alignment.

Featured
Special title treatment
With supporting text below as a natural lead-in to additional content. Go somewhere

<card header="Featured" footer="2 days ago" title="Special title treatment" text-center>
With supporting text below as a natural lead-in to additional content.

<button align-enter width=10rem>Go somewhere</button>
</card>

Multiple Buttons

Even setting the width of an object as above, the element will still block the entire row and force siblings onto the next line as per the image below:

Featured
Special title treatment
With supporting text below as a natural lead-in to additional content. Go somewhere Go somewhere

This can be overcome using columns and rows such as:

Featured
Special title treatment
With supporting text below as a natural lead-in to additional content.

<card header="Featured" footer="2 days ago" title="Special title treatment" text-center>
With supporting text below as a natural lead-in to additional content.

<row>
<button align-right width=10rem>Go somewhere</button>
<button align-left width=10rem>Go somewhere</button>
</row>
</card>
wiki/syntax/card.txt · Last modified: Sunday, July 16, 2023 11:47 PM by Nathan C. McGuire