By default, cmdk uses its built-inDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/dip/cmdk/llms.txt
Use this file to discover all available pages before exploring further.
command-score algorithm — a fuzzy matching library — to rank items against the current search query. Items with a score above 0 are shown; items are sorted by descending score. Groups are re-ordered by the highest score of any item they contain.
Filtering and sorting run synchronously on every keystroke, so the list updates with no visible delay.
Default behavior
No configuration needed. Items are filtered and sorted automatically:Item values are always trimmed with
.trim() before scoring. If you provide a value prop explicitly, it is trimmed too.Custom filter function
Pass afilter prop to Command to replace the default algorithm. The function receives (value, search, keywords?) and must return a number between 0 and 1:
1— exact match, shown at the top0— no match, hidden- Values in between affect sort order
Keywords
Add akeywords prop to Command.Item to provide aliases that also match during search. Keywords are trimmed and passed to your filter function as the third argument:
Keywords are trimmed with
.trim() before being passed to the filter function.Disabling automatic filtering
SetshouldFilter={false} to disable all built-in filtering and sorting. You are then responsible for rendering only the items that should be visible based on the current query:
Using the default filter directly
cmdk exportsdefaultFilter, the same function used internally. Import it if you want to extend the default behavior rather than replace it entirely:
