CloudCannon / pagefind

Static low-bandwidth search at scale
https://pagefind.app
MIT License
3.48k stars 113 forks source link

Allow mounting search field to existing input #54

Open kenmorse opened 2 years ago

kenmorse commented 2 years ago

In some cases a search field may already exist and be very carefully styled to match the site. In this case it would be great to have an option to tell the Pagefind UI to use the existing static input field, rather than the default behavior of dynamically creating a new one. This could work very well in conjunction with the #53 feature request.

Maybe something like:

new PagefindUI({
    element-static: "#search"
});

when you want to mount to an existing static search field.

bglw commented 2 years ago

This makes sense — I'll scope this out when I work on #53 👍

bglw commented 1 year ago

Hi @kenmorse — I've landed on not adding this to the current default UI, and instead offering it as part of a new Modular UI package. A first look at that can be seen in the release notes for v0.11.0 — have a look through that and let me know your thoughts.

bglw commented 1 year ago

Removing this from the 1.0 milestone as the Modular UI is now targeting a later release (see https://github.com/CloudCannon/pagefind/pull/382)

(The modular UI as it exists is still being released and is usable, but it will be reworked in a future non-major release)