View code
View code
<script setup lang="ts">
import { Kanban, KanbanBoard, KanbanCard, KanbanColumn, KanbanColumnContent, KanbanHeader, KanbanItem } from '@pharen/ui';
const columns = {
todo: [{ id: 'brief', title: 'Write project brief' }, { id: 'research', title: 'Research competitors' }],
done: [{ id: 'scope', title: 'Confirm scope' }],
};
</script>
<template>
<Kanban :default-value="columns" :get-item-value="item => item.id" class="w-full">
<KanbanBoard class="sm:grid-cols-2">
<KanbanColumn v-for="(_, key) in columns" :key="key" :value="key">
<KanbanHeader class="capitalize">{{ key }}</KanbanHeader>
<KanbanColumnContent :value="key" class="rounded-lg bg-muted/50 p-2">
<template #default="{ item }"><KanbanItem :value="item.id"><KanbanCard>{{ item.title }}</KanbanCard></KanbanItem></template>
</KanbanColumnContent>
</KanbanColumn>
</KanbanBoard>
</Kanban>
</template>
Installation
npm install @pharen/ui
pnpm add @pharen/ui
yarn add @pharen/ui
bun add @pharen/ui
Import
@pharen/ui/styles.css exactly once in your application entrypoint.Usage
import { Kanban, KanbanBoard, KanbanCard, KanbanCards, KanbanHeader, KanbanProvider, KanbanColumn, KanbanColumnContent, KanbanColumnHandle, KanbanItem, KanbanItemHandle, KanbanOverlay } from '@pharen/ui';
Exports
| Export | Purpose |
|---|---|
Kanban | Exported Vue component from this module. |
KanbanBoard | Exported Vue component from this module. |
KanbanCard | Exported Vue component from this module. |
KanbanCards | Exported Vue component from this module. |
KanbanHeader | Structures the header region. |
KanbanProvider | Exported Vue component from this module. |
KanbanColumn | Exported Vue component from this module. |
KanbanColumnContent | Contains the visible content. |
KanbanColumnHandle | Exported Vue component from this module. |
KanbanItem | Represents one item. |
KanbanItemHandle | Exported Vue component from this module. |
KanbanOverlay | Exported Vue component from this module. |