Skip to content
← Local Search
Edit Local Search
Name
Also known as (comma separated)
Brief definition
Searches within the current context.
Notes
Tier
Core
Useful
Reference
Deleted
Controls schema (JSON array)
[ { "id": "label", "type": "text", "label": "Label", "default": "Search" }, { "id": "placeholder", "type": "text", "label": "Placeholder", "default": "Filter items…" }, { "id": "scope", "type": "select", "label": "Scope", "default": "page", "options": [ "page", "list", "folder" ] }, { "id": "accent", "type": "color", "label": "Accent colour", "default": "#A8E6C1", "presets": [ "#A8E6C1", "#D9C8F0", "#F5C2E0", "#BFD9F2", "#E8A020", "#241430" ] } ]
Templates (JSON object keyed by format)
{ "html": "<form class=\"lsearch\" role=\"search\" style=\"--accent:{{accent}};\">\n <label class=\"lsearch__label\" for=\"lsearch-input\">{{label}}</label>\n <div class=\"lsearch__box\">\n <svg class=\"lsearch__icon\" width=\"15\" height=\"15\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\"><circle cx=\"11\" cy=\"11\" r=\"7\" stroke=\"currentColor\" stroke-width=\"2\"/><path d=\"M20 20l-3.5-3.5\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"/></svg>\n <input id=\"lsearch-input\" class=\"lsearch__input\" type=\"search\" placeholder=\"{{placeholder}}\">\n </div>\n <p class=\"lsearch__scope\">Searching within: <b>this {{scope}}</b></p>\n</form>\n<style>\n.lsearch { display: block; font: 13px system-ui, sans-serif; color: #241430; max-width: 260px; }\n.lsearch__label { display: block; margin-bottom: 4px; font-weight: 500; }\n.lsearch__box { display: flex; align-items: center; gap: 6px; box-sizing: border-box; padding: 6px 10px; background: #FAF7F2; border: 1.5px solid #24143026; border-radius: 7px; }\n.lsearch__box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }\n.lsearch__icon { flex: none; color: #24143080; }\n.lsearch__input { flex: 1; min-width: 0; border: none; background: transparent; font: inherit; color: #241430; outline: none; }\n.lsearch__input::-webkit-search-cancel-button { display: none; }\n.lsearch__scope { margin: 6px 0 0; font-size: 11.5px; color: #24143090; }\n</style>", "tailwind": "<form role=\"search\" class=\"block font-sans text-[13px] text-[#241430] max-w-[260px]\">\n <label for=\"lsearch-input-tw\" class=\"block mb-1 font-medium\">{{label}}</label>\n <div class=\"flex items-center gap-1.5 box-border px-2.5 py-1.5 bg-[#FAF7F2] border-[1.5px] border-[#24143026] rounded-[7px] focus-within:border-current\" style=\"--tw-accent:{{accent}};\">\n <svg class=\"flex-none text-[#24143080]\" width=\"15\" height=\"15\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\"><circle cx=\"11\" cy=\"11\" r=\"7\" stroke=\"currentColor\" stroke-width=\"2\"></circle><path d=\"M20 20l-3.5-3.5\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"></path></svg>\n <input id=\"lsearch-input-tw\" type=\"search\" placeholder=\"{{placeholder}}\" class=\"flex-1 min-w-0 border-none bg-transparent outline-none [&::-webkit-search-cancel-button]:hidden\">\n </div>\n <p class=\"mt-1.5 text-[11.5px] text-[#24143090]\">Searching within: <b>this {{scope}}</b></p>\n</form>", "react": "export function LocalSearch({\n label = \"{{label}}\",\n placeholder = \"{{placeholder}}\",\n scope = \"{{scope}}\",\n accent = \"{{accent}}\",\n}) {\n const scopeLabel = { page: \"this page\", list: \"this list\", folder: \"this folder\" }[scope] ?? scope;\n return (\n <form role=\"search\" style={{ display: \"block\", fontFamily: \"system-ui, sans-serif\", fontSize: 13, color: \"#241430\", maxWidth: 260 }}>\n <label htmlFor=\"lsearch-input\" style={{ display: \"block\", marginBottom: 4, fontWeight: 500 }}>{label}</label>\n <div style={{\n display: \"flex\", alignItems: \"center\", gap: 6, boxSizing: \"border-box\", padding: \"6px 10px\",\n background: \"#FAF7F2\", border: `1.5px solid ${accent}66`, borderRadius: 7,\n }}>\n <svg width=\"15\" height=\"15\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\" style={{ flex: \"none\", color: \"#24143080\" }}>\n <circle cx=\"11\" cy=\"11\" r=\"7\" stroke=\"currentColor\" strokeWidth=\"2\" />\n <path d=\"M20 20l-3.5-3.5\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" />\n </svg>\n <input id=\"lsearch-input\" type=\"search\" placeholder={placeholder} style={{ flex: 1, minWidth: 0, border: \"none\", background: \"transparent\", font: \"inherit\", color: \"#241430\", outline: \"none\" }} />\n </div>\n <p style={{ margin: \"6px 0 0\", fontSize: 11.5, color: \"#24143090\" }}>Searching within: <b>{scopeLabel}</b></p>\n </form>\n );\n}" }
Save
History