Card
The Card component is a flexible and extensible content container. Cards are built with as little markup and styles as possible, but still manage to deliver a ton of control and customization. They are particularly well-suited to use with the Modal component.
Examples
Base
A simple Card is created with a title
and content
property.
Slots
The component provides header
, title
, subtitle
, content
and footer
as named slot templates to customise content.
Image
You can place an image below the header.
Form
A useful purpose for a card is to display forms in it.
Card Component
A flexible and extensible content container.
<o-card></o-card>
Props
Prop name | Description | Type | Values | Default |
---|---|---|---|---|
ariaCloseLabel | Accessibility label for the close button | string | - | From config: card: { |
closeIcon | Close icon name | string | - | From config: card: { |
closeIconSize | Close icon size | string | - | From config: card: { |
closeable | Adds close button to the header | boolean | - | From config: card: { |
component | Component to be injected. Close the component by emitting a 'close' event — $emit('close') | Component | - | |
content | Card body content, unnecessary when content slot is used | string | - | |
events | Events to be binded to the injected component | {} | - | |
iconPack | Icon pack to use for the close icon | string | mdi , fa , fas and any other custom icon pack | From config: card: { |
imageAlt | Card image alt, unnecessary when image slot is used | string | - | |
imageSrc | Card image src, unnecessary when image slot is used | string | - | |
loading | Show a loading spinner in the card | boolean | - | |
loadingLabel | Show label beside the loading icon | string | - | |
override | Override existing theme classes completely | boolean | - | |
props | Props to be binded to the injected component | any | - | |
subtitle | Card header subtitle, unnecessary when subtitle slot is used Class of the header subtitle element | (string & ComponentClass) | - | |
title | Card header title, unnecessary when title slot is used | string | - |
Events
Event name | Properties | Description |
---|---|---|
close | event Event - native event | close button click event |
Slots
Name | Description | Bindings |
---|---|---|
header | Override the header | close (event: Event): void - function to emit a close event |
title | Override the header title, default is title prop | |
subtitle | Override the header subtitle, default is subtitle prop | |
close | Override the close icon | |
image | Override the image | |
default | Override the default card body | close (event: Event): void - function to emit a close event |
content | Override the body content, default is content prop | close (event: Event): void - function to emit a close event |
footer | Override the footer | close (event: Event): void - function to emit a close event |
Class Inspector
Class prop | Description | Props | Suffixes | |
---|---|---|---|---|
rootClass | Class of the root element. | |||
headerClass | Class of the header element. | |||
titleClass | Class of the header title element. | |||
subtitle | Class of the header subtitle element. | |||
closeClass | Class of the header close element. | |||
imageClass | Class of the image container. | |||
figureClass | Class of the image figure element. | |||
bodyClass | Class of the body element. | |||
contentClass | Class of the body content element. | |||
footerClass | Class of the footer element. |
Sass Variables
Current theme ➜ Oruga
The theme does not have any custom variables for this component.
Current theme ➜ Bulma
The theme does not have any custom variables for this component.
Current theme ➜ Bootstrap
The theme does not have any custom variables for this component.