Skip to content

GhostBoard ​

GhostBoard is a headless issue board. It renders the columns and cards your app supplies and lets people move a card with a named Move to… action that works the same with a keyboard, a pointer, or touch. The board never decides an order: it asks your app to make a move, and your app answers with an outcome after it has saved and applied it, or with a reason it was not made.

Import GhostBoard from @ghostvue/vue. @ghostvue/themes has no board recipe yet, so a themed app pairs the headless board with themed card content and lets the theme recipes style the built-in dialog, as the first example does. The advanced section covers styling it yourself. The full contract is the GhostBoard specification.

Triage board

Themed card content in a headless board. Move to… reorders within a column with the motion tokens, moves a card before another card or into an empty column, and shows a rejected save with its reason while the dialog stays open.

Triage 2 cards

  1. Crash on saveBug
  2. Add CSV exportFeature

To do 5 cards

  1. Update docsDocs
  2. Refactor authChore
  3. Bump dependenciesChore
  4. Write e2e testsChore
  5. Fix loginBug

In progress 1 card

  1. Upgrade VueChore

Done 0 cards

No cards

Press Move to… on a card, choose a column and a position, and press Move. Moving Fix login before Refactor auth slides it up To do with the motion tokens. Teammate ranks Fix login 4th applies another update while that animation runs: the card turns toward its new place from wherever it is on screen, keeps focus on its button, and the page announces the new position. A card moved to another column appears there at once. Moving Crash on save to Done is rejected, and the reason stays in the dialog.

Why the board requests and the app orders ​

Your app owns the records, their order, permissions and persistence. The board reads columns and cards by reference and never sorts, clones or mutates them. Columns render in columns order, and each column's cards in cards array order, filtered by columnId. A card's position is 1-based among the cards supplied for its column.

A move is described in stable IDs, never indexes:

ts
interface BoardMoveRequest {
  cardId: string
  fromColumnId: string
  toColumnId: string
  placement: { kind: 'before'; cardId: string } | { kind: 'end' }
}

The same terms cover a reorder within a column, a move before a card in another column, and a move into an empty column. before never names the moving card.

Wire requestMove to a save ​

Binding requestMove makes the board movable. Without it no card offers Move to…, and movable: false turns it off for one card. The board calls requestMove once per confirmed, changed choice and never for Cancel, Escape, an incomplete choice or the card's current position.

ts
async function requestMove(
  request: BoardMoveRequest,
): Promise<BoardMoveOutcome> {
  const result = await api.moveIssue(request)
  if (!result.ok) return { status: 'rejected', message: result.reason }
  issues.value = applyMove(issues.value, request)
  return { status: 'accepted' }
}

Apply the move before you answer. Update your records before, or in the same tick as, returning { status: 'accepted' }. The board waits for the next DOM update, reads where the card is now, focuses its Move to… button there, and announces "Fix login moved to Done, 1 of 1." If you refetch after saving, resolve only after the refetched records are applied. Development builds warn when an accepted card has not moved.

A synchronous return is handled like a settled promise. A throw, a rejected promise or a value that is not an outcome is treated as a rejection with messages.moveFailed.

While a request is outstanding the Move button shows "Moving to Done…" and the secondary button reads Close. Closing does not cancel the request: the card shows the pending text, and Move to… on it reopens the pending dialog. Requests for different cards are independent and may settle in any order.

Move to… with app-owned order Headless

The headless board renders the application's columns and cards. Move to… requests a placement by stable IDs; the application applies it, rejects it with a reason, or reorders cards on its own.

Triage 2 cards

  1. Crash on saveBug
  2. Add CSV exportFeature

To do 3 cards

  1. Fix loginBug
  2. Update docsDocs
  3. Refactor authChore

In progress 1 card

  1. Upgrade VueChore

Done 0 cards

No cards

Rejections ​

Return { status: 'rejected', message } with a complete, localized sentence. If the dialog is still open, it stays open with the choice kept and the reason in an alert that is announced once. The user can revise and press Move again, or cancel. If the user had already closed the dialog, the reason is announced and stays on the card (moveError in the card slot, data-move-error on the card) until the next request for it.

Optimistic updates and fresh records ​

Optimistic display is app state. You can move the card in your records when the request is made and restore it on rejection; the board renders whatever cards holds. Fresh records can arrive at any time, including changes from other people. The board renders them immediately, keeps focus on the same card by ID, and never treats them as an outcome.

While the dialog is open, records keep its options live. If the card named by a Before placement leaves the chosen column, the Position field is re-created empty with "Update docs is no longer in To do. Choose a new position." and Move does nothing until a new position is chosen.

Filtered views ​

The board knows only the cards it is given. A placement names a supplied card or the end of the supplied cards. When you show a filtered subset, decide what End of column and Before mean in your full order (for example, after the last shown card) and tell your users.

Suggested placement and move notices ​

suggestPlacement({ card, toColumn }) picks the initial position each time a column is chosen, for example before a neighbor your app remembered. An invalid suggestion falls back silently to the card's current position in its own column and to the end of any other column.

describeMove(request, card) returns guidance for the current choice, such as a work-in-progress or capacity warning, shown above the buttons with its tone. It re-runs reactively when the choice or the state it reads changes, is announced when its message appears or changes, and never blocks the move. Keep it synchronous and free of side effects.

Open Move to… from an app menu ​

openMove(id, initial?) on the template ref opens Move to… as the card's button does, so a menu item or shortcut can start a move. The triage example's Return to Triage… item calls openMove(card.id, { toColumnId: 'triage' }). The user still confirms, and closing returns focus to the card's Move to… button.

MethodDescription
focusCard(id)Focuses the card's Move to… button, or the card when it has none, and scrolls it into view. false when not shown.
openMove(id, init)Opens Move to… with an optional destination. false when the card is not shown or movable, or a dialog is open.
announce(text)Sends a polite message through the board's status element, or the dialog's while it is open.

Keyboard ​

The board adds no keys of its own. Every control is in the normal Tab order: the scroll region, then for each column, each card's own content followed by its Move to… button.

ContextKeyBehavior
Scroll regionArrow keys, PageUp/PageDown, Home/EndNative scrolling.
Move to… buttonEnter, SpaceOpens the dialog with focus on Column.
DialogTab / Shift+TabMoves within the dialog.
DialogEscapeAn open list closes first; then Cancel, or Close while a move is pending.
Column, PositionSelect keys and type-aheadAs in GhostSelect. Position type-ahead uses card titles.
Move, Cancel, CloseEnter, SpaceActivate.

Accessibility ​

  • Move to… is the one path for every input: a single tap or click, the same dialog, no drag, hold or precise gesture.
  • Name the board with aria-label or aria-labelledby; it goes to the scroll region, which is focusable so keyboard users can scroll it. Columns are sections named by their headings, and cards are list items, so screen readers can move by heading and read positions from the list.
  • Each Move to… button reads "Move to… Fix login" and is described by the card's pending text or late rejection.
  • Outcomes are announced, requests are not. While the dialog is open, announcements go through a status element inside it, because a modal dialog hides the page from some screen readers.
  • On large boards, add your own links that jump between columns and call focusCard, because columns are reached in linear Tab order.
  • Give the scroll region position: relative in your CSS. The visually hidden text inside cards is absolutely positioned, and the region must contain it so the page never scrolls sideways.

Advanced: styling ​

For teams that bring their own design system. The board sets no layout styles: lay out columns with CSS on the region and column parts, as the board/move-to example does with plain semantic tokens.

  • Parts: root, region, column, column-heading, column-count, cards, card, card-content, move-button, move-status, column-empty, status.
  • State on cards: data-card-id, data-pending, data-move-error, data-movable. On columns: data-column-id, data-empty.
  • Reused parts: the dialog, fields, alerts and buttons keep their own data-part, so the board marks them with data-board-part: dialog, column-field, position-field, move-notice (with data-tone), move-error, move-confirm and move-cancel. The select lists carry data-board-list="column" or "position".

Theming the built-in dialog ​

The dialog's parts carry their usual classes, so the theme recipes style them inside a theme scope. The dialog and lists teleport out of the board, so the recipes apply when the theme host is on <html> or <body>, or when portalTo points at an element inside the theme scope, as in the triage example. Headless parts have no data-variant, so give the secondary button its look through [data-board-part='move-cancel'].

Motion ​

moveTransition="triage-move" adds triage-move-move to cards that change position within a column and slides them from where they were on screen. A second update during the slide starts from the card's current position. Cards that change column are not animated, and a card ID is never rendered twice. Honor reduced motion in your CSS:

css
.triage-move-move {
  transition: transform var(--ghost-motion-duration-slow)
    var(--ghost-motion-easing-standard);
}

@media (prefers-reduced-motion: reduce) {
  .triage-move-move {
    transition: none;
  }
}

API ​

PropTypeDefaultDescription
cardsreadonly TCard[]RequiredApp-owned cards. Order within a column is array order. Never sorted, filtered, cloned or mutated.
columnsreadonly BoardColumn[]RequiredApp-owned columns. Column order is array order. Never sorted, cloned or mutated.
describeMove((request: BoardMoveRequest, card: TCard) => BoardMoveNotice | undefined)—Guidance shown for the current complete, changed choice before confirmation. Synchronous and free of side effects; re-evaluated reactively.
headingLevelBoardHeadingLevel3Level of each column heading.
messagesPartial<BoardMessages>—Overrides for labels, descriptions and announcements.
moveTransitionstring—Class prefix for animating reorders within a column: <prefix>-move is applied while a card slides from its previous on-screen position.
portalToGhostPortalTarget"body"Teleport target for the dialog and its select lists, so they can render inside a theme scope.
requestMove((request: BoardMoveRequest) => BoardMoveOutcome | PromiseLike<BoardMoveOutcome>)—Makes the board movable: called once per confirmed, changed move and answered with an outcome or a promise of one. Without it no card offers Move to….
suggestPlacement((context: BoardPlacementContext<TCard>) => BoardPlacement | undefined)—Initial placement each time a destination column is chosen. An invalid or missing suggestion falls back to the current position in the card's own column and to the end of any other column.
SlotSlot propsDescription
card—Card content. May hold the app's own links and buttons. Bindings: BoardCardSlotProps<TCard> (card, position, pending, moveError). Default: card.title.
columnEmptycolumn: BoardColumn, count: numberContent of a column with no cards. Default: messages.emptyColumn.
columnHeadingcolumn: BoardColumn, count: numberColumn heading content. Must render text; it names the column. Default: the title and count.
empty—Content of the scroll region when columns is empty.

Not in this release ​

  • Dragging cards with a pointer or touch, drop indicators and edge auto-scroll. Move to… is the way to move a card.
  • Column management, swimlanes, multi-card moves, and per-column scrolling.
  • A themed GhostBoard in @ghostvue/themes.