导航菜单

CardBook

CardBook is a book card component. It supports a cover image; when not provided, it shows an adaptive gradient background based on the title and centers the title as a placeholder.

Introduction

Suitable for courses, book lists, and reading recommendations.

Cases

Basic

Refactoring: Improving the Design of Existing Code cover

Refactoring: Improving the Design of Existing Code

Martin Fowler

通过重构改善代码设计的经典著作,涵盖常见代码坏味道与重构手法。

Grid

Clean Code cover

Clean Code

Robert C. Martin

通过可读性与整洁性提升代码质量的实践指南。

Design Patterns

Design Patterns

Erich Gamma et al.

GoF 经典设计模式详解与实践。

Refactoring

Refactoring

Martin Fowler

重构改善既有代码设计的系统方法。

You Don't Know JS Yet

You Don't Know JS Yet

Kyle Simpson

The Pragmatic Programmer

The Pragmatic Programmer

Andrew Hunt & David Thomas

务实的程序员实践与思维方式。

Working Effectively with Legacy Code

Working Effectively with Legacy Code

Michael Feathers

author

Author name.

Clean Code cover

Clean Code

Robert C. Martin

Unknown Masterpiece

Unknown Masterpiece

---
import { CardBook, getExampleImage } from '@coffic/cosy-ui';
---

<CardBook
  title="Clean Code"
  author="Robert C. Martin"
  cover={getExampleImage({ width: 240, height: 340 })}
/>
Clean Code cover

Clean Code

Robert C. Martin

Unknown Masterpiece

Unknown Masterpiece

---
import { CardBook } from '@coffic/cosy-ui';
---

<CardBook title="Unknown Masterpiece" author="" />

class

Custom CSS class for overriding default styles.

Custom Class with Cover cover

Custom Class with Cover

Anon

---
import { CardBook, getExampleImage } from '@coffic/cosy-ui';
---

<CardBook
  title="Custom Class with Cover"
  author="Anon"
  cover={getExampleImage({ width: 240, height: 340 })}
  class="cosy:bg-gradient-to-r cosy:from-blue-50 cosy:to-indigo-100 cosy:border-2 cosy:border-blue-200"
/>

cover

Book cover image (local or remote). If omitted, a smart gradient background placeholder will be used.

Refactoring cover

Refactoring

Martin Fowler

Local Cover Example cover

Local Cover Example

Anon

No Cover Example

No Cover Example

Anon

---
import { CardBook, getExampleImage } from '@coffic/cosy-ui';
---

<div>
  <CardBook
    title="Refactoring"
    author="Martin Fowler"
    cover={getExampleImage({ width: 240, height: 340 })}
  />
</div>
Refactoring cover

Refactoring

Martin Fowler

Local Cover Example cover

Local Cover Example

Anon

No Cover Example

No Cover Example

Anon

---
import { CardBook } from '@coffic/cosy-ui';
import bookCover from '@/assets/book.png';
---

<CardBook title="Local Cover Example" author="Anon" cover={bookCover} />
Refactoring cover

Refactoring

Martin Fowler

Local Cover Example cover

Local Cover Example

Anon

No Cover Example

No Cover Example

Anon

---
import { CardBook } from '@coffic/cosy-ui';
---

<CardBook title="No Cover Example" author="Anon" />

description

Brief description of the book.

Domain-Driven Design cover

Domain-Driven Design

Eric Evans

A comprehensive guide to domain-driven design, focusing on complex software projects.

---
import { CardBook, getExampleImage } from '@coffic/cosy-ui';
---

<CardBook
  title="Domain-Driven Design"
  author="Eric Evans"
  cover={getExampleImage({ width: 240, height: 340 })}
  description="A comprehensive guide to domain-driven design, focusing on complex software projects."
/>

href

Link for navigation (shows a “View details” button).

Refactoring cover

Refactoring

Martin Fowler

---
import { CardBook, getExampleImage } from '@coffic/cosy-ui';
---

<CardBook
  title="Refactoring"
  author="Martin Fowler"
  cover={getExampleImage({ width: 240, height: 340 })}
  href="/books/refactoring"
/>

shadow

Card shadow style: none | sm | md | lg | xl.

Shadow None cover

Shadow None

Anon

Shadow SM cover

Shadow SM

Anon

Shadow MD cover

Shadow MD

Anon

Shadow LG cover

Shadow LG

Anon

Shadow XL cover

Shadow XL

Anon

---
import { CardBook, getExampleImage } from '@coffic/cosy-ui';
---

<CardBook
  title="Shadow None"
  author="Anon"
  cover={getExampleImage({ width: 240, height: 340 })}
  shadow="none"
/>
Shadow None cover

Shadow None

Anon

Shadow SM cover

Shadow SM

Anon

Shadow MD cover

Shadow MD

Anon

Shadow LG cover

Shadow LG

Anon

Shadow XL cover

Shadow XL

Anon

---
import { CardBook, getExampleImage } from '@coffic/cosy-ui';
---

<CardBook
  title="Shadow SM"
  author="Anon"
  cover={getExampleImage({ width: 240, height: 340 })}
  shadow="sm"
/>
Shadow None cover

Shadow None

Anon

Shadow SM cover

Shadow SM

Anon

Shadow MD cover

Shadow MD

Anon

Shadow LG cover

Shadow LG

Anon

Shadow XL cover

Shadow XL

Anon

---
import { CardBook, getExampleImage } from '@coffic/cosy-ui';
---

<CardBook
  title="Shadow MD"
  author="Anon"
  cover={getExampleImage({ width: 240, height: 340 })}
  shadow="md"
/>
Shadow None cover

Shadow None

Anon

Shadow SM cover

Shadow SM

Anon

Shadow MD cover

Shadow MD

Anon

Shadow LG cover

Shadow LG

Anon

Shadow XL cover

Shadow XL

Anon

---
import { CardBook, getExampleImage } from '@coffic/cosy-ui';
---

<CardBook
  title="Shadow LG"
  author="Anon"
  cover={getExampleImage({ width: 240, height: 340 })}
  shadow="lg"
/>
Shadow None cover

Shadow None

Anon

Shadow SM cover

Shadow SM

Anon

Shadow MD cover

Shadow MD

Anon

Shadow LG cover

Shadow LG

Anon

Shadow XL cover

Shadow XL

Anon

---
import { CardBook, getExampleImage } from '@coffic/cosy-ui';
---

<CardBook
  title="Shadow XL"
  author="Anon"
  cover={getExampleImage({ width: 240, height: 340 })}
  shadow="xl"
/>

size

Card size: sm | md | lg.

小册子 cover

小册子

Anon

中等读物 cover

中等读物

Anon

巨著 cover

巨著

Anon

---
import { CardBook, getExampleImage } from '@coffic/cosy-ui';
---

<CardBook
  size="sm"
  title="小册子"
  author="Anon"
  cover={getExampleImage({ width: 180, height: 260 })}
/>
小册子 cover

小册子

Anon

中等读物 cover

中等读物

Anon

巨著 cover

巨著

Anon

---
import { CardBook, getExampleImage } from '@coffic/cosy-ui';
---

<CardBook
  size="md"
  title="中等读物"
  author="Anon"
  cover={getExampleImage({ width: 240, height: 340 })}
/>
小册子 cover

小册子

Anon

中等读物 cover

中等读物

Anon

巨著 cover

巨著

Anon

---
import { CardBook, getExampleImage } from '@coffic/cosy-ui';
---

<CardBook
  size="lg"
  title="巨著"
  author="Anon"
  cover={getExampleImage({ width: 300, height: 420 })}
/>


title

Book title (required).

Clean Code cover

Clean Code

Robert C. Martin

Patterns of Enterprise Application Architecture: Catalog of Patterns for Enterprise Software cover

Patterns of Enterprise Application Architecture: Catalog of Patterns for Enterprise Software

Martin Fowler

---
import { CardBook, getExampleImage } from '@coffic/cosy-ui';
---

<CardBook
  title="Clean Code"
  author="Robert C. Martin"
  cover={getExampleImage({ width: 240, height: 340 })}
/>
Clean Code cover

Clean Code

Robert C. Martin

Patterns of Enterprise Application Architecture: Catalog of Patterns for Enterprise Software cover

Patterns of Enterprise Application Architecture: Catalog of Patterns for Enterprise Software

Martin Fowler

---
import { CardBook, getExampleImage } from '@coffic/cosy-ui';
---

<CardBook
  title="Patterns of Enterprise Application Architecture: Catalog of Patterns for Enterprise Software"
  author="Martin Fowler"
  cover={getExampleImage({ width: 240, height: 340 })}
/>

搜索