[筆記] 哎呀!不小心刻了一套 React UI 元件庫 14 – Card

近期為了熟悉元件 Component 的客製化,便參照「哎呀!不小心刻了一套 React UI 元件庫」一書進行練習。這篇筆記下 Card。

react logo


[ Repo ]:https://github.com/andy922200/practice-storybook-react


內容

1. 卡片樣式的形態非常多。建議可將卡片的內部的元素分區塊,以小塊積木的概念方便組合
2. 可能會出現的小區塊有:封面媒體(圖片)、卡片內容、卡片底部頁尾
3. 卡片大區塊的排版可以先行定義,像是 vertical, horizontal…等


參數

1. variant
2. cover – 這一塊以 ReactNode 的方式傳入,可以極大客製化的內容
3. footer – 這一塊以 ReactNode 的方式傳入,可以極大客製化的內容
4. children – Card Body 主要顯示的內容,你可以將此抽出一個區塊如 <Meta>,或是直接傳入內容


程式碼

https://github.com/andy922200/practice-storybook-react/commit/c5bb404a0448f0d67dcf1e0706279295272fc355


相關文章

★全文分享★  [筆記] 哎呀!不小心刻了一套 React UI 元件庫 30 – 佈署發佈
[筆記] 哎呀!不小心刻了一套 React UI 元件庫 30 – 佈署發佈
近期為了熟悉元件 Component 的客製化,便
★全文分享★  [筆記] 哎呀!不小心刻了一套 React UI 元件庫 29 – Toast
[筆記] 哎呀!不小心刻了一套 React UI 元件庫 29 – Toast
近期為了熟悉元件 Component 的客製化,便
★全文分享★  [筆記] 哎呀!不小心刻了一套 React UI 元件庫 28 – Modal
[筆記] 哎呀!不小心刻了一套 React UI 元件庫 28 – Modal
近期為了熟悉元件 Component 的客製化,便
★全文分享★  [筆記] 哎呀!不小心刻了一套 React UI 元件庫 27 – Progress Circle
[筆記] 哎呀!不小心刻了一套 React UI 元件庫 27 – Progress Circle
近期為了熟悉元件 Component 的客製化,便
★全文分享★  [筆記] 哎呀!不小心刻了一套 React UI 元件庫 26 – Progress Bar
[筆記] 哎呀!不小心刻了一套 React UI 元件庫 26 – Progress Bar
近期為了熟悉元件 Component 的客製化,便
★全文分享★  [筆記] 哎呀!不小心刻了一套 React UI 元件庫 25 – Skeleton
[筆記] 哎呀!不小心刻了一套 React UI 元件庫 25 – Skeleton
近期為了熟悉元件 Component 的客製化,便
★全文分享★  [筆記] 哎呀!不小心刻了一套 React UI 元件庫 24 – Spin
[筆記] 哎呀!不小心刻了一套 React UI 元件庫 24 – Spin
近期為了熟悉元件 Component 的客製化,便
★全文分享★  [筆記] 哎呀!不小心刻了一套 React UI 元件庫 23 – Pagination
[筆記] 哎呀!不小心刻了一套 React UI 元件庫 23 – Pagination
近期為了熟悉元件 Component 的客製化,便
★全文分享★  [筆記] 哎呀!不小心刻了一套 React UI 元件庫 22 – Tabs
[筆記] 哎呀!不小心刻了一套 React UI 元件庫 22 – Tabs
近期為了熟悉元件 Component 的客製化,便
★全文分享★  [筆記] 哎呀!不小心刻了一套 React UI 元件庫 21 – Drawer
[筆記] 哎呀!不小心刻了一套 React UI 元件庫 21 – Drawer
近期為了熟悉元件 Component 的客製化,便
按讚加入粉絲團

延伸閱讀