卡片與清單檢視一樣,是包含和組織資訊的另一種絕佳方式。卡片包含獨特的相關資料,例如,照片、文字和連結,都關於單一主題。卡片通常是進入更複雜和詳細資訊的入口點。
包含以下元件
卡片
名稱 | 類型 | 預設值 | 描述 |
---|---|---|---|
colors | 物件 | 具有 Tailwind CSS 顏色類別的物件 | |
colors.bgIos | 字串 | 'bg-ios-light-surface-1 dark:bg-ios-dark-surface-1' | |
colors.bgMaterial | 字串 | 'bg-md-light-surface-1 dark:bg-md-dark-surface-1' | |
colors.footerTextIos | 字串 | 'text-black text-opacity-55 dark:text-white dark:text-opacity-55' | |
colors.footerTextMaterial | 字串 | 'text-md-light-on-surface-variant dark:text-md-dark-on-surface-variant' | |
colors.outlineIos | 字串 | 'border-black border-opacity-20 dark:border-white dark:border-opacity-20' | |
colors.outlineMaterial | 字串 | 'border-md-light-outline dark:border-md-dark-outline' | |
colors.textIos | 字串 | '' | |
colors.textMaterial | 字串 | 'text-md-light-on-surface dark:text-md-dark-on-surface' | |
component | 字串 | 'div' | 元件的 HTML 元素 |
contentWrap | 布林值 | true | 使用帶有內距的額外元素包裝卡片內容 |
contentWrapPadding | 字串 | 'p-4' | 內容包裝內距(如果啟用 |
footer | 字串 | 卡片頁尾的內容 | |
footerDivider | 布林值 | false | 啟用頁尾和內容之間的分隔線 |
header | 字串 | 卡片頁首的內容 | |
headerDivider | 布林值 | false | 啟用頁首和內容之間的分隔線 |
margin | 字串 | 'm-4' | Tailwind CSS 邊距類別 |
outline | 布林值 | 未定義 | 使卡片具有外框。覆蓋 |
outlineIos | 布林值 | false | 在 iOS 主題中使卡片具有外框 |
outlineMaterial | 布林值 | false | 在 Material 主題中使卡片具有外框 |
raised | 布林值 | 未定義 | 使卡片具有立體感。覆蓋 |
raisedIos | 布林值 | false | 在 iOS 主題中使卡片具有立體感 |
raisedMaterial | 布林值 | false | 在 Material 主題中使卡片具有立體感 |
名稱 | 描述 |
---|---|
footer | 卡片頁尾的內容 |
header | 卡片頁首的內容 |
<template><k-page><k-navbar title="Cards" /><k-block-title :with-block="false">Simple Cards</k-block-title><k-card>This is a simple card with plain text, but cards can also contain theirown header, footer, list view, image, or any other element.</k-card><k-card header="Card header" footer="Card footer">Card with header and footer. Card headers are used to display card titlesand footers for additional information or just for custom actions.</k-card><k-card>Another card. Lorem ipsum dolor sit amet, consectetur adipiscing elit.Suspendisse feugiat sem est, non tincidunt ligula volutpat sit amet.Mauris aliquet magna justo.</k-card><k-block-title :with-block="false">Outline Cards</k-block-title><k-card outline>This is a simple card with plain text, but cards can also contain theirown header, footer, list view, image, or any other element.</k-card><k-card outline header="Card header" footer="Card footer">Card with header and footer. Card headers are used to display card titlesand footers for additional information or just for custom actions.</k-card><k-card outline>Another card. Lorem ipsum dolor sit amet, consectetur adipiscing elit.Suspendisse feugiat sem est, non tincidunt ligula volutpat sit amet.Mauris aliquet magna justo.{' '}</k-card><k-block-title :with-block="false">Outline With Dividers</k-block-title><k-cardoutlineheader="Card header"footer="Card footer"header-dividerfooter-divider>Card with header and footer. Card headers are used to display card titlesand footers for additional information or just for custom actions.</k-card><k-block-title :with-block="false">Raised Cards</k-block-title><k-card raised>This is a simple card with plain text, but cards can also contain theirown header, footer, list view, image, or any other element.</k-card><k-card raised header="Card header" footer="Card footer">Card with header and footer. Card headers are used to display card titlesand footers for additional information or just for custom actions.</k-card><k-card raised>Another card. Lorem ipsum dolor sit amet, consectetur adipiscing elit.Suspendisse feugiat sem est, non tincidunt ligula volutpat sit amet.Mauris aliquet magna justo.{' '}</k-card><k-block-title :with-block="false">Card With List View</k-block-title><k-card><k-list nested class="-m-4"><k-list-item href title="Link 1" /><k-list-item href title="Link 2" /><k-list-item href title="Link 3" /><k-list-item href title="Link 4" /><k-list-item href title="Link 5" /></k-list></k-card><k-block-title :with-block="false">Styled Cards</k-block-title><div class="lg:grid lg:grid-cols-2"><k-card outline><template #footer><div class="flex justify-between material:hidden"><k-link>Like</k-link><k-link>Read more</k-link></div><divclassName="flex justify-start ios:hidden space-x-2 rtl:space-x-reverse"><k-button rounded inline> Like </k-button><k-button rounded inline outline> Read more </k-button></div></template><divclass="ios:-mx-4 ios:-mt-4 h-48 p-4 flex items-end text-white ios:font-bold bg-cover bg-center material:rounded-xl mb-4 material:text-[22px]":style="{'background-image':'url(https://cdn.framework7.io/placeholder/nature-1000x600-3.jpg)',}">Journey To Mountains</div><div class="text-gray-500 mb-3">Posted on January 21, 2021</div><p>Quisque eget vestibulum nulla. Quisque quis dui quis ex ultriciesefficitur vitae non felis. Phasellus quis nibh hendrerit...</p></k-card><k-card><template #footer><div class="flex justify-between material:hidden"><k-link>Like</k-link><k-link>Read more</k-link></div><divclassName="flex justify-start ios:hidden space-x-2 rtl:space-x-reverse"><k-button rounded inline> Like </k-button><k-button rounded inline outline> Read more </k-button></div></template><divclass="ios:-mx-4 ios:-mt-4 h-48 p-4 flex items-end text-white ios:font-bold bg-cover bg-center material:rounded-xl mb-4 material:text-[22px]":style="{'background-image':'url(https://cdn.framework7.io/placeholder/people-1000x600-6.jpg)',}">Lorem Ipsum</div><div class="text-gray-500 mb-3">Posted on January 21, 2021</div><p>Quisque eget vestibulum nulla. Quisque quis dui quis ex ultriciesefficitur vitae non felis. Phasellus quis nibh hendrerit...</p></k-card></div></k-page></template><script>import {kPage,kNavbar,kNavbarBackLink,kCard,kBlockTitle,kList,kListItem,kLink,kButton,} from 'konsta/vue';export default {components: {kPage,kNavbar,kNavbarBackLink,kCard,kBlockTitle,kList,kListItem,kLink,kButton,},};</script>