Search
The Search
component provides a powerful, customizable search interface that allows users to search through different categories, such as boilerplates, templates, components, and open-source projects.
Features
🔍 Search Interface: Provides a command palette-style search interface, enabling users to search through multiple categories.
🧩 Category-Based Navigation: Supports searching across different categories, such as boilerplates, templates, components, and open-source projects.
💾 Command Handling: Utilizes the cmdk library to handle commands, key presses, and search interactions.
What's Included
< Search />
This is the main component that handles the search functionality. It uses the cmdk
library to manage command palette interactions, allowing users to search for boilerplates, templates, components, and open-source projects.
< Home />
Displays the main search categories (Boilerplates, Templates, Components, OSS) when the search interface is first opened. Each category leads to a more specific search list when selected.
Home
Props
Name | Type | Default | Description |
---|---|---|---|
searchBoilerplates | function | undefined | A function that navigates to the boilerplates search page. |
searchTemplates | function | undefined | A function that navigates to the templates search page. |
searchComponents | function | undefined | A function that navigates to the components search page. |
searchOSS | function | undefined | A function that navigates to the open-source projects search page. |
< Components />
Lists available components in the project, each linking to its detail page. It includes an icon and title for each component.
< Item />
A reusable component used within the subcomponents to display each item in the list. It handles selection and keyboard shortcuts.
Item
Props
Name | Type | Default | Description |
---|---|---|---|
children | ReactNode | undefined | The content to be displayed inside the item, such as text or icons. |
shortcut | string | undefined | A string representing keyboard shortcuts, displayed in the item if provided. |
onSelect | function | () => {} | A function that gets called when the item is selected. |