Skip to content

Filters (built-in types)

  • TextTableFilter: contains/starts/ends/equals/is_null/is_not_null.
  • NumberTableFilter(Int/Double): gt/gte/lt/lte/equals/not_equals/between/is_null/is_not_null + optional range slider via rangeOptions.
  • BooleanTableFilter: equals; optional getTitle(BooleanType).
  • DateTableFilter: gt/gte/lt/lte/equals/between/is_null/is_not_null (uses kotlinx.datetime.LocalDate).
  • EnumTableFilter<T: Enum>: in/not_in/equals with options: List<T> and getTitle(T). An optional getHint(T) adds a one-line explanation under an option's title in the options list (null for no hint); the selected value, the search and the chips use the title only.
  • CustomTableFilter: fully custom filter UI and state with access to table data. Implement CustomFilterRenderer<T, E> for main panel and optional fast filter (both receive tableData: E parameter), and CustomFilterStateProvider<T> for chip text. Supports data visualizations of any complexity, including dynamic histograms and statistics based on current table data. For a reference column with a group hierarchy, a custom filter can use FilterConstraint.IN_HIERARCHY: the value is one of the listed node ids or any of their descendants. The table knows no hierarchy and no built-in type offers it; the app's panel draws the node picker and its chip text names the nodes (prefix them with UiString.FilterConstraintInHierarchy). The table never evaluates it, so filter such columns on the server or in your own matcher.
  • DisabledTableFilter: special marker filter type that completely disables filtering for a column while keeping the API contract (no filter UI is rendered for such columns in filter panels and conditional formatting dialogs).

Applying filters to data is app‑specific. Example:

val filtered = remember(items, state.filters) {
    items.filter { item ->
        // Evaluate your domain against active state.filters
        // See `table-sample` for a full example
        true
    }
}

Empty state

While itemsCount is 0 the body shows emptyContent; the header, fast filters and footer stay visible. The default (TableDefaults.EmptyContent) says "No data", or — while a filter is active — "No results match the current filters" with a Clear filters button. Replace it through TableEmptyScope, which exposes isFiltered and clearFilters() (removes every entry from state.filters):

Table(
    itemsCount = filtered.size,
    itemAt = { filtered.getOrNull(it) },
    state = state,
    columns = columns,
    emptyContent = {
        if (isFiltered) {
            TextButton(onClick = ::clearFilters) { Text("Nothing found — reset filters") }
        } else {
            Text("No orders yet")
        }
    },
)

An empty count cannot tell "no data" from "still loading": pass emptyContent = {} while your data loads. The paging Table does this for you while items is null. Texts come from the UiString.EmptyNoData, EmptyNoResults and EmptyClearFilters keys.