StarForge
Form

Search

Advanced search components with trending searches, recent history, and minimal designs

Note

All presented components are responsive and compatible with Tailwind CSS. Make sure Tailwind is configured in your project to use them.

Props Reference

PropTypeDescriptionDefault
onSearch(query: string) => Promise<SearchOption[]>Async search function that returns resultsmockSearch
trendingSearchesSearchOption[]Array of trending search suggestions[]
onSelect(item: SearchOption) => voidCallback fired when an item is selectedundefined
placeholderstringPlaceholder text for the search input"Search documentation, examples, and more..."
classNamestringAdditional CSS classes for stylingundefined
maxRecentSearchesnumberMaximum number of recent searches to store5
showRecentSearchesbooleanShow/hide recent searches sectiontrue
showTrendingSearchesbooleanShow/hide trending searches sectiontrue

SearchOption Interface:

interface SearchOption {
  id: string;
  title: string;
  description?: string;
  category?: string;
}

Props Reference

PropTypeDescriptionDefault
onSearch(query: string) => Promise<SearchOption[]>Async search function that returns resultsmockSearch
trendingSearchesSearchOption[]Array of trending search suggestions[]
onSelect(item: SearchOption) => voidCallback fired when an item is selectedundefined
placeholderstringPlaceholder text for the search input"Search without recent searches..."
classNamestringAdditional CSS classes for stylingundefined
maxRecentSearchesnumberMaximum number of recent searches to store5
showRecentSearchesbooleanShow/hide recent searches sectionfalse
showTrendingSearchesbooleanShow/hide trending searches sectiontrue

SearchOption Interface:

interface SearchOption {
  id: string;
  title: string;
  description?: string;
  category?: string;
}

Props Reference

PropTypeDescriptionDefault
onSearch(query: string) => Promise<SearchOption[]>Async search function that returns resultsmockSearch
trendingSearchesSearchOption[]Array of trending search suggestions[]
onSelect(item: SearchOption) => voidCallback fired when an item is selectedundefined
placeholderstringPlaceholder text for the search input"Basic search..."
classNamestringAdditional CSS classes for stylingundefined
maxRecentSearchesnumberMaximum number of recent searches to store5
showRecentSearchesbooleanShow/hide recent searches sectionfalse
showTrendingSearchesbooleanShow/hide trending searches sectionfalse

SearchOption Interface:

interface SearchOption {
  id: string;
  title: string;
  description?: string;
  category?: string;
}

Usage:

  • Use search-1 for complete search with both trending and recent searches
  • Use search-2 for search with only trending suggestions
  • Use search-3 for minimal search without suggestion blocks