Skip to content

Search Field

Showing a basic search field returning results on pressing on a default debounce

html
<six-search-field placeholder="Search" id="basic-search-field">
  <div id="search-results"></div>
</six-search-field>
<script type="module">
  const basicSearchField = document.getElementById('basic-search-field');
  const searchResultsBox = document.getElementById('search-results');

  basicSearchField.addEventListener('six-search-field-change', (event) => {
    searchResultsBox.innerHTML = event.detail.value;
    searchResultsBox.style.padding = '1em';
  });
</script>

Properties

PropertyAttributeDescriptionTypeDefault
clearableclearableSet to true to add a clear button when the input is populated.booleanfalse
debouncedebounceDebounce time in milliseconds, default is 300 msnumberDEFAULT_DEBOUNCE_FAST
disableddisabledSet to true to disable the input.booleanfalse
placeholderplaceholderThe input's placeholder text.string | undefinedundefined
valuevalueThe input's value attribute.string''

Events

EventDescriptionType
six-search-field-changeEmitted when a search is triggeredCustomEvent<SixSearchFieldChangePayload>

Slots

SlotDescription
Used to define the results below the search component.

Dependencies

Depends on

Graph


Copyright © 2021-present SIX-Group