TaskBoard - Custom Styles

Build app-owned TaskBoard visual systems with density, state classes, CSS variables, and product card styling.

#Usage

import { TaskBoard } from '@primeui/vue-taskboard';
<TaskBoard.Root v-model:tasks="tasks" data-key="id" column-field="columnId" density="compact" class="support-board">
    <!-- TaskBoard parts -->
</TaskBoard.Root>

Use root classes, density values, data attributes, and CSS variables to style the runtime shell. Use slots or UI parts when the visible card, header, menu, or swimlane markup needs to change. These styles live in the app; they are not hidden packaged themes.

#Choose a Styling Layer

LayerUse when
Density propThe same board needs compact, standard, or comfortable spacing.
CSS variablesSpacing, column width, colors, focus rings, and status accents change.
Runtime classesStyling depends on selected, dragging, focused, filtered, or print state.
Data attributesStyling depends on a specific task, column, swimlane, or print target.
Slots and UI partsThe markup, content model, card density, or visible structure also changes.

Prefer variables for broad decisions and data attributes for object-specific decisions. Replace markup only when CSS is fighting the structure.

#Small Override

Scope product tokens to the board wrapper, then feed them into TaskBoard variables.

.support-board {
    color-scheme: light dark;
    --support-surface: light-dark(var(--p-surface-0), var(--p-surface-950));
    --support-column: light-dark(var(--p-surface-50), var(--p-surface-900));
    --support-border: light-dark(var(--p-surface-200), var(--p-surface-800));
    --support-accent: light-dark(var(--p-primary-600), var(--p-primary-300));

    --p-taskboard-background: var(--support-surface);
    --p-taskboard-column-background: var(--support-column);
    --p-taskboard-swimlane-border-color: var(--support-border);
    --p-taskboard-drop-indicator-color: var(--support-accent);
    --p-taskboard-focus-ring-color: var(--support-accent);
}

State classes and data attributes handle targeted styling.

.support-board .p-taskboard-card-selected {
    outline-color: var(--support-accent);
}

.support-board [data-column-id='blocked'] {
    --p-taskboard-column-background: color-mix(in srgb, var(--p-red-500) 8%, var(--support-column));
}

.support-board [data-task-id='escalation-42'] {
    scroll-margin-block: 1rem;
}

#Style System Pattern

Most product boards need a few coordinated decisions rather than one CSS override. Start with a wrapper class, bind the density that matches the product mode, then map app tokens into TaskBoard variables.

DecisionExample product treatment
Densitycompact for an incident queue, comfortable for review.
Column widthNarrow queues for triage, wider columns for rich cards.
Card surfaceFlat rows, campaign cards, or decision cards.
Accent strategySeverity, workflow status, product area, or business value.
State stylingSelected, dragging, focused, filtered, and print states.
<TaskBoard.Root v-model:tasks="tasks" :density="boardDensity" class="launch-board">
    <!-- TaskBoard parts -->
</TaskBoard.Root>

#CSS Variables

Common variables include:

VariableUse
--p-taskboard-background, --p-taskboard-colorBoard surface and text color.
--p-taskboard-column-backgroundColumn body surface.
--p-taskboard-column-gap, --p-taskboard-card-gapColumn and card spacing.
--p-taskboard-column-min-width, --p-taskboard-column-max-widthColumn sizing and horizontal scroll.
--p-taskboard-columns-padding, --p-taskboard-column-body-paddingBoard and column inner padding.
--p-taskboard-column-border-radius, --p-taskboard-border-radiusShell and column radius.
--p-taskboard-drop-indicator-colorInsertion marker color.
--p-taskboard-focus-ring-color, --p-taskboard-focus-ring-widthFocus outline.
--p-taskboard-column-status-* variablesColumn status accents from statusType.
--p-taskboard-scrollbar-thumb, --p-taskboard-scrollbar-trackBoard scrollbar styling.
--p-taskboard-swimlane-header-width, --p-taskboard-swimlane-min-heightSwimlane sizing.

Set variables on a wrapper when the change belongs to one board. Set them in the app theme only when every TaskBoard should inherit the same treatment.

#State and Object Hooks

Runtime classes describe behavior state. Data attributes identify public objects.

HookUse
p-taskboard-card-selected, p-taskboard-card-dragging, p-taskboard-card-focused, p-taskboard-card-disabledCard interaction states.
p-taskboard-column-collapsed, p-taskboard-column-locked, p-taskboard-column-pinnedColumn state.
p-taskboard-drop-indicatorDrag insertion marker.
p-taskboard-rtl, p-taskboard-print-active, p-taskboard-printing, p-taskboard-print-ancestorDirection and print state.
data-column-id, data-task-id, data-swimlane-idColumn, task, and swimlane specific styling.
data-print-targetPrint-only styling for the board root.

Avoid styling private DOM depth. Anchor selectors to a local board class plus a public class or data attribute.

#Visual Style Systems

The style preview switches between three app-owned treatments while the TaskBoard data, drag behavior, selection, and keyboard handling stay the same. The column headers, card surfaces, drag preview, density, and color tokens all change together so the board feels like one product surface rather than a themed card list.

Loading Demo...

#CSS Variable Example

The CSS-variable preview changes TaskBoard shell tokens without replacing runtime parts. Use this route when the structure is already right and the board only needs product colors, borders, and spacing.

Loading Demo...

#Checklist

  • Scope product styles to a board wrapper such as .support-board.
  • Use light-dark(...) or separate mode tokens when the app supports dark mode.
  • Keep selected, focused, dragging, filtered, invalid-drop, and print states visible.
  • Keep the app-owned visual system close to product data: priority, account tier, SLA, campaign stage, or review confidence should drive the visible differences.
  • Tune --p-taskboard-column-min-width with the available container width; too-wide columns can hide useful board context.
  • Use public classes and data attributes for state styling.
  • Move to Card Slots, Column Slots, or UI Parts when custom styling starts requiring extra markup.

#API

Relevant styling APIs include density, root classes, runtime state classes, data-column-id, data-task-id, data-swimlane-id, data-print-target, --p-taskboard-* variables, TaskBoard.ColumnContent, TaskBoard.Card, TaskBoard.ColumnHeader, and copied UI parts. See Theming for the full variable reference and Data Attributes for stable selectors.