When I built a small AI tools directory, the feature people actually used was not the tool list - it was one question: "what are you trying to do?"
Here is the whole matcher. No framework, no state library, ~40 lines.
const tools = {
writing: { name: "Claude", why: "long-form drafting and editing" },
design: { name: "Canva", why: "social graphics without a designer" },
research: { name: "Perplexity", why: "answers with sources you can check" },
admin: { name: "Zapier", why: "gluing apps together" },
};
const choices = document.querySelectorAll("[data-match]");
const result = document.querySelector("#match-result");
choices.forEach((button) => {
button.addEventListener("click", () => {
const task = button.dataset.match;
const tool = tools[task];
if (!tool) return;
choices.forEach((b) => b.setAttribute("aria-pressed", String(b === button)));
result.hidden = false;
result.innerHTML =
"<strong>" + tool.name + "</strong> - " + tool.why +
' <a href="https://example.com" rel="noopener">Visit site</a>';
});
});
Three things that made it feel good to use:
<button type="button" data-match="writing"> gets keyboard support for free.aria-pressed for state.aria-live="polite" on the result.
The data stays in a plain object, so adding a tool means adding one line. If you later want search, filter Object.entries(tools) - the matcher and the list can share the same source of truth.
I wrapped this into a complete static site (search, guides, 12 tools) - live demo: https://toolroom-ai-tools.netlify.app - and the source is available here: https://payhip.com/b/5j0hC if you want to skip the setup.