Kanban
Included in RC.12
Available in Mavis 0.1.0-rc.12 for Vue + Vite, Nuxt and NativeScript. Keep the Mavis packages at the same version.
<MKanban v-model="cards" :columns="columns" label="Studio" :query="query" />| Prop | Type | Default | Contract |
|---|---|---|---|
columns | readonly KanbanColumn[] | required | Unique id, title, optional positive integer limit. |
modelValue | readonly KanbanCard[] | required | Unique id, column, title, optional description/disabled. Consumer metadata is preserved. |
query | string | '' | Filters title/description without removing hidden cards. |
animated / draggable / disabled | boolean | true / true / false | Jolt settling of a released card, drag handle and all editing. |
moveLabel / upLabel / downLabel / emptyLabel / fullLabel | string | English | Localizable control and status labels. |
Columns stack on narrow containers and sit side by side from 760px/DIP. Drag the handle to reorder or transfer; arrow keys on that handle, the move menu and up/down buttons offer alternatives. Full columns reject incoming cards, including while filtering. External model/filter changes cancel an active drag; rejected controlled updates keep the original model. Cards are not virtualized (maximum 500 cards / 12 columns). Dragging runs on Jolt drop zones: only the handle starts it, so the rest of the card keeps its controls and touch scrolling. A gap shows where the card will land, and a card released up to 60px/DIP below a column still drops into it. A release anywhere else, Escape, scrolling, a window that loses focus or a locked board returns the card. Dragging is limited to visible drop targets: use the menu for distant columns. On Web you can pick up a card while responsive columns are moving. The card keeps its grip point through the drag and commits to the column under the pointer on release. For application-owned ancestor transforms, use the arrow keys on the handle, the menu or the move buttons. Each column title sits beside a count pill that bumps when the count changes and shakes while a card hovers a full column. The held card leans into a sideways move; a card that lands, by drag, keyboard or menu, gives a small bump; the drop gap pops open; cards added after mount arrive from above. Reduced motion or :animated="false" keeps all of it still. The card slot receives { card, column }; the app owns persistence, editing and navigation.
update:modelValue → KanbanCard[]; move → { id, from, to, before }.
Chromium, real mouse input: a card reordered by its handle, moved to another column, refused by a column at capacity, released just below a short column, and a drag cancelled with Escape.
The source checkout requires Jolt 0.1.0-rc.22 for this responsive Web drag. Resizing the browser window cancels a drag already in progress. You can grab the card as soon as the resize happens, while the columns are still moving.
Vue Web in Chromium with mouse input. The board narrows to 680 CSS pixels and widens to 1440. The pointer picks up Studio website while Making is moving, then releases it into Published.
WebKit on macOS. The orange marker shows where the mouse caught Studio website. The readout compares the grip immediately before and after Jolt admitted the drag. The pointer then moves the card into Published.
Transfers into a scrolling column
Give a destination a fixed viewport with { id: "press", title: "Press", scrollHeight: 270 }. The height is in CSS pixels on Web and DIPs on native. Hold a card over the upper or lower edge of that column to scroll it. The insertion marker follows the newly revealed rows. The application still owns the arrays, card limits and filtering. An accepted release emits one update:modelValue and one move with the destination key and its following card. Replacing the model, removing the column or cancelling the contact clears the preview.
iPhone 17 Pro simulator, iOS 26.2. An XCTest touch holds the cover at the edge while the destination scrolls. Releasing places it before page 8.
Android API 36 emulator. Android touchscreen events hold the cover in place while later pages enter the viewport. The final counters show one model update and one move.
Chromium with automated mouse input. The dot follows the actual pointer. The destination scrolls beneath the held cover and the release commits before page 7.
<script setup lang="ts">
import { computed, ref } from 'vue'
import { useCatalogLocale } from '../locale'
const props = defineProps<{ lang?: 'en' | 'pt' }>()
const { locale } = useCatalogLocale(() => props.lang)
const t = (en: string, br: string) => ((props.lang ?? locale.value) === 'pt' ? br : en)
import type { KanbanCard } from '@getcortexlabs/mavis-core'
const query = ref(''),
animated = ref(true),
disabled = ref(false)
const columns = computed(() => [
{ id: 'ideas', title: t('Ideas', 'Ideias') },
{ id: 'making', title: t('Making', 'Em criação'), limit: 2 },
{ id: 'done', title: t('Published', 'Publicado') },
])
const cards = ref<KanbanCard[]>([
{
id: 'identity',
column: 'ideas',
title: 'Botanical identity',
description: 'A living visual language for the next chapter.',
},
{
id: 'editorial',
column: 'ideas',
title: 'Field notes',
description: 'Stories collected along the way.',
},
{
id: 'web',
column: 'making',
title: 'Studio website',
description: 'Room for the work to breathe.',
},
{
id: 'print',
column: 'done',
title: 'Spring edition',
description: 'Printed, folded, ready for the world.',
},
])
const lastMove = ref('')
function reverse() {
cards.value = [...cards.value].reverse()
}
</script>
<template>
<MColumn gap="lg">
<MText text="FORMA STUDIO / WORK IN PROGRESS" variant="overline" tone="primary" />
<MText
:text="t('Good ideas deserve room to grow.', 'Boas ideias merecem espaço para crescer.')"
variant="title"
/>
<MInput v-model="query" :label="t('Filter projects', 'Filtrar projetos')" />
<MKanban
id="studio-kanban"
v-model="cards"
:columns="columns"
:query="query"
:animated="animated"
:disabled="disabled"
:label="t('The studio board', 'O quadro do estúdio')"
:moveLabel="t('Move card', 'Mover cartão')"
:upLabel="t('Move up', 'Mover para cima')"
:downLabel="t('Move down', 'Mover para baixo')"
:emptyLabel="t('An open possibility.', 'Uma possibilidade em aberto.')"
:fullLabel="t('At capacity', 'No limite')"
@move="lastMove = $event.id + ':' + $event.to"
/>
<MRow gap="md" wrap
><MSwitch v-model="animated" :label="t('Animate layout', 'Animar layout')" /><MSwitch
v-model="disabled"
:label="t('Lock board', 'Travar quadro')" /><MButton
:text="t('Reverse order', 'Inverter ordem')"
variant="secondary"
@click="reverse"
/></MRow>
<MText
id="kanban-order"
:text="cards.map((c) => c.id + ':' + c.column).join(',')"
variant="caption"
tone="muted"
/>
<MText id="kanban-result" :text="lastMove" variant="caption" />
</MColumn>
</template>On Web, iOS and Android, the surrounding cards move into place when a gap opens, a card changes columns or the app replaces the board data. Keep card IDs stable across updates. A menu move uses the same lane animation as a drag, and reduced motion places the cards immediately.
Desktop
Drag a card or use its move menu or arrow keys. Cards in each affected column slide into place when a gap opens, a move lands or the application changes the order. Setting animated to false or enabling reduced motion places them immediately. Full columns refuse a drop. See Desktop components.