Problem
Leadtype has static search internals, but app-facing search adoption can be easier. Users should not have to manually import and coordinate both generated JSON files in every framework.
Nuxt Content's useSearchCollection() is a good ergonomics reference, but Leadtype should preserve its own strengths: static JSON artifacts, edge-safe runtime, framework-neutral core, and optional source-grounded answers.
Proposal
Keep searchDocs() as the core primitive, then add idiomatic framework-facing search helpers.
Core:
searchDocs(index, query, { content });
React/Next/TanStack:
const { search, results, status } = useLeadtypeSearch("docs");
Vue/Nuxt:
const { search, results, status } = useLeadtypeSearch("docs");
Svelte/SvelteKit:
const docsSearch = createLeadtypeSearch({
indexUrl: "/docs/search-index.json",
contentUrl: "/docs/search-content.json",
});
Astro:
- Plain browser helper.
- Island examples for React/Svelte/Vue.
- No required framework runtime.
Acceptance Criteria
Problem
Leadtype has static search internals, but app-facing search adoption can be easier. Users should not have to manually import and coordinate both generated JSON files in every framework.
Nuxt Content's
useSearchCollection()is a good ergonomics reference, but Leadtype should preserve its own strengths: static JSON artifacts, edge-safe runtime, framework-neutral core, and optional source-grounded answers.Proposal
Keep
searchDocs()as the core primitive, then add idiomatic framework-facing search helpers.Core:
React/Next/TanStack:
Vue/Nuxt:
Svelte/SvelteKit:
Astro:
Acceptance Criteria
searchDocs()remains stable and framework-neutral.search-index.jsonandsearch-content.json.