Skip to content
API/stringParam

stringParam

src/params/string-param.tsfunction
stringParam(key: string, options: StringParamOptions & object): ListParam<string>

A param holding free text — a search term.

Reads one value; an empty value, or a key given twice, falls back to the default. Writes nothing for an empty string, so clearing a search box removes the key. Surrounding spaces are kept unless trim is set.

Parameter Type Description
key string The page-URL key
options StringParamOptions & object The default, and whether to trim

Returns — The param