Skip to content
API/listParam

listParam

src/params/list-param.tsfunction
listParam(key: string, options: ListParamOptions<T>): ListParam<readonly T[]>

A param holding several strings — the tags or statuses of a multi-select.

Reads every value of the key, each split on the separator, so both ?tag=a,b and ?tag=a&tag=b hold ['a', 'b']. Empty items, duplicates and items outside values are dropped; when none is left, the default applies. Writes the items as one value, joined with the separator. Defaults to []. Clearing the param in a link ([]) leaves the key out, which reads back as the default — give a multi-select an empty default if users must be able to clear it.

Parameter Type Description
key string The page-URL key
options ListParamOptions<T> The accepted items, the default and the separator

Returns — The param