Loading...
Loading...
Search input component in Observable Framework — filter tabular data.
npx skill4agent add spqw/skill-observable-framework observable-framework-input-searchObservable Framework documentation: Input: Search Source: https://observablehq.com/framework/input-search
const searchInput = Inputs.search(penguins, {placeholder: "Search penguins…"});
const search = view(searchInput);const search = view(Inputs.search(penguins, {placeholder: "Search penguins…"}));searchInputs.table(search)for (const abbr of document.querySelectorAll("abbr")) {
abbr.title = `Search for “${abbr.textContent}”`;
abbr.style.cursor = "default";
abbr.onclick = () => {
const input = searchInput.querySelector("input");
input.value = abbr.textContent;
input.dispatchEvent(new Event("input", {bubbles: true}));
};
}