# SiSearchBarComponent documentation

**Kind:** component

**Selector:** `si-search-bar`

```
import { SiSearchBarComponent } from '@siemens/element-ng/search-bar';
```

```
component SiSearchBarComponent implements OnInit, OnDestroy, ControlValueAccessor, OnChanges
```

#### Input Properties

<table><thead><tr><th>Name</th><th>Type</th><th>Default</th><th>Description</th></tr></thead> <tbody><tr id="SiSearchBarComponent.clearButtonAriaLabel"> <td class="api-column-name"><span data-api-type-target-for="SiSearchBarComponent.clearButtonAriaLabel" id="t:SiSearchBarComponent.clearButtonAriaLabel"></span><a href="https://github.com/siemens/element/blob/main/projects/element-ng/search-bar/si-search-bar.component.ts#L177-L177">clearButtonAriaLabel</a></td> <td class="api-column-type"><code><a href="index.html#t:TranslatableString">TranslatableString</a></code></td> <td class="api-column-default"><code>$localize`:@@SI_SEARCH_BAR.CLEAR_BUTTON:Clear`</code></td><td class="api-column-description"><p>Aria label for the clear button.</p></td></tr><tr id="SiSearchBarComponent.colorVariant"> <td class="api-column-name"><span data-api-type-target-for="SiSearchBarComponent.colorVariant" id="t:SiSearchBarComponent.colorVariant"></span><a href="https://github.com/siemens/element/blob/main/projects/element-ng/search-bar/si-search-bar.component.ts#L138-L138">colorVariant</a></td> <td class="api-column-type"><code><a href="index.html#t:BackgroundColorVariant">BackgroundColorVariant</a></code></td> <td class="api-column-default"><code>'base-1'</code></td><td class="api-column-description"><p>Color to use for component background</p></td></tr><tr id="SiSearchBarComponent.debounceTime"> <td class="api-column-name"><span data-api-type-target-for="SiSearchBarComponent.debounceTime" id="t:SiSearchBarComponent.debounceTime"></span><a href="https://github.com/siemens/element/blob/main/projects/element-ng/search-bar/si-search-bar.component.ts#L69-L69">debounceTime</a> (deprecated)</td> <td class="api-column-type"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></td> <td class="api-column-default"><code>400</code></td><td class="api-column-description"><p>Time unit change of search input takes effect.</p><p>Deprecated: Use a content-projected input and debounce its form value changes in application code, for example with RxJS <code>debounceTime</code> on <code>FormControl.valueChanges</code>:</p><pre><code class="language-html">&lt;si-search-bar&gt;&#10;  &lt;input siSearchBarInput [formControl]=&quot;searchControl&quot;&gt;&#10;&lt;/si-search-bar&gt;</code></pre><pre><code class="language-typescript">searchControl.valueChanges.pipe(debounceTime(400));</code></pre></td></tr><tr id="SiSearchBarComponent.disabled"> <td class="api-column-name"><span data-api-type-target-for="SiSearchBarComponent.disabled" id="t:SiSearchBarComponent.disabled"></span><a href="https://github.com/siemens/element/blob/main/projects/element-ng/search-bar/si-search-bar.component.ts#L153-L153">disabled</a> (deprecated)</td> <td class="api-column-type"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></td> <td class="api-column-default"><code>false</code></td><td class="api-column-description"><p>Whether the input is disabled.</p><p>Deprecated: Use a content-projected input with <code>disabled</code> applied directly to it:</p><pre><code class="language-html">&lt;si-search-bar&gt;&#10;  &lt;input siSearchBarInput disabled&gt;&#10;&lt;/si-search-bar&gt;</code></pre></td></tr><tr id="SiSearchBarComponent.maxlength"> <td class="api-column-name"><span data-api-type-target-for="SiSearchBarComponent.maxlength" id="t:SiSearchBarComponent.maxlength"></span><a href="https://github.com/siemens/element/blob/main/projects/element-ng/search-bar/si-search-bar.component.ts#L167-L167">maxlength</a> (deprecated)</td> <td class="api-column-type"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number">number</a></code></td> <td class="api-column-default"><code>undefined</code></td><td class="api-column-description"><p>Defines the maximum length of the search input.</p><p>Deprecated: Use a content-projected input with <code>maxlength</code> applied directly to it:</p><pre><code class="language-html">&lt;si-search-bar&gt;&#10;  &lt;input siSearchBarInput maxlength=&quot;100&quot;&gt;&#10;&lt;/si-search-bar&gt;</code></pre></td></tr><tr id="SiSearchBarComponent.placeholder"> <td class="api-column-name"><span data-api-type-target-for="SiSearchBarComponent.placeholder" id="t:SiSearchBarComponent.placeholder"></span><a href="https://github.com/siemens/element/blob/main/projects/element-ng/search-bar/si-search-bar.component.ts#L100-L100">placeholder</a> (deprecated)</td> <td class="api-column-type"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></td> <td class="api-column-default"><code>''</code></td><td class="api-column-description"><p>Define search input placeholder.</p><p>Deprecated: Use a content-projected input with <code>placeholder</code> applied directly to it:</p><pre><code class="language-html">&lt;si-search-bar&gt;&#10;  &lt;input siSearchBarInput placeholder=&quot;Search&quot;&gt;&#10;&lt;/si-search-bar&gt;</code></pre></td></tr><tr id="SiSearchBarComponent.prohibitedCharacters"> <td class="api-column-name"><span data-api-type-target-for="SiSearchBarComponent.prohibitedCharacters" id="t:SiSearchBarComponent.prohibitedCharacters"></span><a href="https://github.com/siemens/element/blob/main/projects/element-ng/search-bar/si-search-bar.component.ts#L87-L87">prohibitedCharacters</a> (deprecated)</td> <td class="api-column-type"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined">undefined</a></code></td> <td class="api-column-default"></td><td class="api-column-description"><p>Prohibited characters restricting search.</p><p>Deprecated: Use a reactive <code>FormControl</code> or Signal Forms on a content-projected input to validate prohibited characters:</p><pre><code class="language-html">&lt;si-search-bar&gt;&#10;  &lt;input siSearchBarInput [formControl]=&quot;searchControl&quot;&gt;&#10;&lt;/si-search-bar&gt;</code></pre><p>Or with Signal Forms:</p><pre><code class="language-html">&lt;si-search-bar&gt;&#10;  &lt;input siSearchBarInput [formField]=&quot;searchForm.search&quot;&gt;&#10;&lt;/si-search-bar&gt;</code></pre></td></tr><tr id="SiSearchBarComponent.readonly"> <td class="api-column-name"><span data-api-type-target-for="SiSearchBarComponent.readonly" id="t:SiSearchBarComponent.readonly"></span><a href="https://github.com/siemens/element/blob/main/projects/element-ng/search-bar/si-search-bar.component.ts#L132-L132">readonly</a> (deprecated)</td> <td class="api-column-type"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></td> <td class="api-column-default"><code>false</code></td><td class="api-column-description"><p>Whether the input can be focused but not edited.</p><p>Deprecated: Use a content-projected input with <code>readonly</code> applied directly to it:</p><pre><code class="language-html">&lt;si-search-bar&gt;&#10;  &lt;input siSearchBarInput readonly&gt;&#10;&lt;/si-search-bar&gt;</code></pre></td></tr><tr id="SiSearchBarComponent.showIcon"> <td class="api-column-name"><span data-api-type-target-for="SiSearchBarComponent.showIcon" id="t:SiSearchBarComponent.showIcon"></span><a href="https://github.com/siemens/element/blob/main/projects/element-ng/search-bar/si-search-bar.component.ts#L106-L106">showIcon</a></td> <td class="api-column-type"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">boolean</a></code></td> <td class="api-column-default"><code>false</code></td><td class="api-column-description"><p>Display search icon before search input.</p></td></tr><tr id="SiSearchBarComponent.value"> <td class="api-column-name"><span data-api-type-target-for="SiSearchBarComponent.value" id="t:SiSearchBarComponent.value"></span><a href="https://github.com/siemens/element/blob/main/projects/element-ng/search-bar/si-search-bar.component.ts#L118-L118">value</a> (deprecated)</td> <td class="api-column-type"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a> | <a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined">undefined</a></code></td> <td class="api-column-default"></td><td class="api-column-description"><p>Define search input content.</p><p>Deprecated: Use a content-projected input with <code>value</code> applied directly to it:</p><pre><code class="language-html">&lt;si-search-bar&gt;&#10;  &lt;input siSearchBarInput value=&quot;Search term&quot;&gt;&#10;&lt;/si-search-bar&gt;</code></pre></td></tr></tbody></table>

#### Output Properties

<table><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr id="SiSearchBarComponent.searchChange"> <td class="api-column-name"><span data-api-type-target-for="SiSearchBarComponent.searchChange" id="t:SiSearchBarComponent.searchChange"></span><a href="https://github.com/siemens/element/blob/main/projects/element-ng/search-bar/si-search-bar.component.ts#L196-L196">searchChange</a> (deprecated)</td> <td class="api-column-type"><code><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String">string</a></code></td> <td class="api-column-description"><p>Output callback event will provide you with search term if search input changes.</p><p>Deprecated: Use a content-projected input and observe <code>FormControl.valueChanges</code> or the field value signal with Signal Forms:</p><pre><code class="language-html">&lt;si-search-bar&gt;&#10;  &lt;input siSearchBarInput [formControl]=&quot;searchControl&quot;&gt;&#10;&lt;/si-search-bar&gt;</code></pre><p>Or with Signal Forms:</p><pre><code class="language-html">&lt;si-search-bar&gt;&#10;  &lt;input siSearchBarInput [formField]=&quot;searchForm.search&quot;&gt;&#10;&lt;/si-search-bar&gt;</code></pre></td></tr></tbody></table>

### Types Documentation

### [BackgroundColorVariant](<https://github.com/siemens/element/blob/main/projects/element-ng/common/models/color-variant.model.ts#L8-L8>)

**Kind:** type alias

```
import type { BackgroundColorVariant } from '@siemens/element-ng/common';
```

Use this type with filter components `colorVariant` to render component variants based on background of container

```
type BackgroundColorVariant = 'base-1' | 'base-0'
```

### [TranslatableString](<https://github.com/siemens/element/blob/main/projects/element-translate-ng/translate-types/global.types.ts#L18-L18>)

**Kind:** type alias

```
import type { TranslatableString } from '@siemens/element-translate-ng/translate-types';
```

Represents a translatable string. This can either be a translation key, e.g. `ACTIONS.EDIT` that will be automatically translated when displayed on the UI or a pre-translated string, e.g. `Edit`. Equivalent to a normal string in usage and functionality.

```
type TranslatableString = string & Translatable
```
