Skip to content

CellRenderer

Vue render function or component for cell rendering.

Can be either:

  • A render function receiving CellRenderContext and returning a VNode
  • A Vue component (SFC or defineComponent)
type CellRenderer = (ctx: CellRenderContext<TRow, TValue>) => VNode | Component
import type { CellRenderer, ColumnConfig } from '@toolbox-web/grid-vue';
import StatusBadge from './StatusBadge.vue';
// As render function
const statusRenderer: CellRenderer<Employee, string> = (ctx) =>
h('span', { class: ctx.value }, ctx.value);
// As Vue component
const columns: ColumnConfig<Employee>[] = [
{ field: 'status', renderer: StatusBadge },
];
AI assistants: For complete API documentation, implementation guides, and code examples for this library, see https://raw.githubusercontent.com/OysteinAmundsen/toolbox/main/llms-full.txt