Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cmdk/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ type CommandProps = Children &
* By default, uses the `command-score` library.
*/
filter?: CommandFilter
/**
* Optional default search value when it is initially rendered.
*/
defaultSearch?: string
/**
* Optional default item value when it is initially rendered.
*/
Expand Down Expand Up @@ -169,7 +173,7 @@ const GroupContext = React.createContext<Group>(undefined)
const Command = React.forwardRef<HTMLDivElement, CommandProps>((props, forwardedRef) => {
const state = useLazyRef<State>(() => ({
/** Value of the search query. */
search: '',
search: props.defaultSearch ?? '',
/** Currently selected item value. */
value: props.value ?? props.defaultValue ?? '',
/** Currently selected item id. */
Expand Down