The filter option can be used to add a filter on layer names.
It adds an input in the header of the layer switcher
and listen to the drawlist event to show/hide the list items.
For more info see ol/control/LayerSwitcher example.