English
FxCard
About 368 wordsAbout 1 min
2025-12-16
Aggregates information in a card container for display.
Attributes
| Parameter | Description | Type | Optional Values | Default |
|---|---|---|---|---|
| header | Sets the header, or pass DOM through slot#header | string | — | — |
| body-style | Sets the style of the body | object | — | |
| shadow | Sets when the shadow is displayed | string | always / hover / never | always |
Basic Usage
Contains a title, content, and actions.
<fx-card class="box-card">
<div slot="header" class="clearfix">
<span>Card Name</span>
<fx-button style="float: right; padding: 3px 0" type="text">Action Button</fx-button>
</div>
<div v-for="o in 4" :key="o" class="text item">
{{'List Item ' + o }}
</div>
</fx-card>
<style>
.text {
font-size: 14px;
}
.item {
margin-bottom: 18px;
}
.clearfix:before,
.clearfix:after {
display: table;
content: "";
}
.clearfix:after {
clear: both
}
.box-card {
width: 480px;
}
</style>Simple Card
Cards can contain only a content area.
<fx-card class="box-card">
<div v-for="o in 4" :key="o" class="text item">
{{'List Item ' + o }}
</div>
</fx-card>With Image
Can be configured to present richer content.
<fx-row>
<fx-col :span="8" v-for="(o, index) in 2" :key="o" :offset="index > 0 ? 2 : 0">
<fx-card :body-style="{ padding: '0px' }">
<img src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png" class="image">
<div style="padding: 14px;">
<span>Tasty Hamburger</span>
<div class="bottom clearfix">
<time class="time">{{ currentDate }}</time>
<fx-button type="text" class="button">Action Button</fx-button>
</div>
</div>
</fx-card>
</fx-col>
</fx-row>Card Shadow
The display behavior of the shadow can be configured.
<fx-row :gutter="12">
<fx-col :span="8">
<fx-card shadow="always">
Always Visible
</fx-card>
</fx-col>
<fx-col :span="8">
<fx-card shadow="hover">
Visible on Hover
</fx-card>
</fx-col>
<fx-col :span="8">
<fx-card shadow="never">
Never Visible
</fx-card>
</fx-col>
</fx-row>