public/admin/tool/componentlibrary/content/moodle/components/search-input.md
Single searches allow the user the quickly search a collection of data. A search is input in the search field and the results are shown immediately (using JS) or after the search has been posted to Moodle.
Searches are used in the page navbar, blocks, module pages, settings, the contentbank etc.
Use
Use a default search input when searching is not expected to be the primary action on this page. Use the emphasized search when it is the default action AND the only search input found on the page. (except the navbar search).
Variables
{{< mustache template="core/search_input_auto" >}} { "placeholder": "Search settings", "uniqid": "45" } {{< /mustache >}}
Use
This search option is used when the search imput immediately triggers updating data displayed below the search, for example: a table of usernames. It includes a clear button that clears the input on typeing.
Variables
{{< mustache template="core/search_input_navbar" >}} { "action": "https://moodle.local/admin/search.php", "inputname": "search", "searchstring": "Search", "hiddenfields": [ { "name": "cmid", "value": "11" } ] } {{< /mustache >}}
Use
This search should be used once on the page and triggers a global site search. It uses a minimal amount of space to prevent breakage on mobile use.
Features