Skip to content

arrayColumn

function arrayColumn<F>(options?): TableColumnSpec<(string | number)[], "array", NoInfer<F>>;

Defined in: filters/tanstack-table.ts:509

A tags-style filter on an array column: the chosen values become arrayOverlaps (has any of them, like TanStack’s arrIncludesSome; the default) or arrayContains (has all of them, like arrIncludesAll).

Type Parameter Default type
F extends string | undefined undefined
Parameter Type
options? FieldOption<F> & object

TableColumnSpec<(string | number)[], "array", NoInfer<F>>

import { arrayColumn } from "@xtandard/lib/filters/tanstack-table";
arrayColumn().toFilter(["a", "b"]); // → { kind: "array", operator: "arrayOverlaps", values: ["a", "b"] }
arrayColumn({ operator: "arrayContains" }).toFilter(["a"]);
// → { kind: "array", operator: "arrayContains", values: ["a"] }