Search

1
import "@arcgis/map-components/components/arcgis-search";

Search component provides a way to perform search operations

Demo

Properties

PropertyAttributeType
active-menu
"none" | "source" | "suggestion" | "warning"
activeSource
readonly
active-source-index
number
all-placeholder
string
allSources
readonly
auto-destroy-disabled
boolean
auto-select-disabled
boolean
disabled
boolean
icon
string
include-default-sources-disabled
Function | boolean
label
string
location-disabled
boolean
max-results
number
max-suggestions
number
min-suggest-characters
number
popup-disabled
boolean
position
"bottom-leading" | "bottom-left" | "bottom-right" | "bottom-trailing" | "manual" | "top-leading" | "top-left" | "top-right" | "top-trailing"
reference-element
ArcgisLinkChart | ArcgisMap | ArcgisScene | string
result-graphic-disabled
boolean
results
readonly
Array<any>
search-all-disabled
boolean
search-term
string
state
readonly
state
"disabled" | "loading" | "ready" | "searching"
suggestions
readonly
suggestions-disabled
boolean

activeMenu

Property
activeMenu: "none" | "source" | "suggestion" | "warning"

The current active menu of the Search widget.

Read more...

Attribute
active-menu
Default value
"none"

activeSource

readonlyProperty

The source object currently selected.

Read more...

Default value
null

activeSourceIndex

Property
activeSourceIndex: number

The selected source's index.

Read more...

Attribute
active-source-index
Default value
0

allPlaceholder

Property
allPlaceholder: string

String value used as a hint for input text when searching on multiple sources.

Read more...

Attribute
all-placeholder
Default value
"Find address or place"

allSources

readonlyProperty

The combined collection of defaultSources and sources.

Read more...

autoDestroyDisabled

Property
autoDestroyDisabled: boolean

If true, the component will not be destroyed automatically when it is disconnected from the document. This is useful when you want to move the component to a different place on the page, or temporarily hide it. If this is set, make sure to call the `destroy` method when you are done to prevent memory leaks.

Attribute
auto-destroy-disabled
Default value
false

autoSelectDisabled

Property
autoSelectDisabled: boolean

Indicates whether to automatically select and zoom to the first geocoded result.

Read more...

Attribute
auto-select-disabled
Default value
false

defaultSources

readonlyProperty

A read-only property that is a Collection of LayerSearchSource and/or LocatorSearchSource.

Read more...

disabled

Property
disabled: boolean

When true, the widget is visually withdrawn and cannot be interacted with.

Read more...

Attribute
disabled
Default value
false

icon

Property
icon: string

Icon which represents the component. Typically used when the component is controlled by another component (e.g. by the Expand component). Search Calcite Icons for possible values.

Attribute
icon
Default value
"search"

includeDefaultSourcesDisabled

Property
includeDefaultSourcesDisabled: Function | boolean

Indicates whether or not to include defaultSources in the Search UI.

Read more...

Attribute
include-default-sources-disabled
Default value
false

label

Property
label: string

The component's default label.

Attribute
label

locationDisabled

Property
locationDisabled: boolean

Enables location services within the widget.

Read more...

Attribute
location-disabled
Default value
false

maxResults

Property
maxResults: number

The maximum number of results returned by the widget if not specified by the source.

Read more...

Attribute
max-results
Default value
6

maxSuggestions

Property
maxSuggestions: number

The maximum number of suggestions returned by the widget if not specified by the source.

Read more...

Attribute
max-suggestions
Default value
6

minSuggestCharacters

Property
minSuggestCharacters: number

The minimum number of characters needed for the search if not specified by the source.

Read more...

Attribute
min-suggest-characters
Default value
3

popupDisabled

Property
popupDisabled: boolean

Indicates whether to display the Popup on feature click.

Read more...

Attribute
popup-disabled
Default value
false

popupTemplate

Property
popupTemplate: PopupTemplate

A customized PopupTemplate for the selected feature.

Read more...

portal

Property
portal: Portal

It is possible to search a specified portal instance's locator services Use this property to set this ArcGIS Portal instance to search.

Read more...

position

Property
position: "bottom-leading" | "bottom-left" | "bottom-right" | "bottom-trailing" | "manual" | "top-leading" | "top-left" | "top-right" | "top-trailing"
Attribute
position
Default value
"top-right"

referenceElement

Property
referenceElement: ArcgisLinkChart | ArcgisMap | ArcgisScene | string
Attribute
reference-element

resultGraphic

readonlyProperty
resultGraphic: Graphic

The graphic used to highlight the resulting feature or location.

Read more...

resultGraphicDisabled

Property
resultGraphicDisabled: boolean

Indicates if the resultGraphic will display at the location of the selected feature.

Read more...

Attribute
result-graphic-disabled
Default value
false

results

readonlyProperty
results: Array<any>

An array of objects, each containing a SearchResult from the search.

Read more...

searchAllDisabled

Property
searchAllDisabled: boolean

Indicates whether to display the option to search all sources.

Read more...

Attribute
search-all-disabled
Default value
false

searchTerm

Property
searchTerm: string

The value of the search box input text string.

Read more...

Attribute
search-term

selectedResult

readonlyProperty
selectedResult: SearchResult

The result selected from a search.

Read more...

sources

Property

The Search widget may be used to search features in a map/feature service feature layer(s), SceneLayers with an associated feature layer, BuildingComponentSublayer with an associated feature layer, GeoJSONLayer, CSVLayer or OGCFeatureLayer, or table, or geocode locations with a locator.

Read more...

state

readonly
Property
state: "disabled" | "loading" | "ready" | "searching"

The current state of the widget.

Read more...

Attribute
state
Default value
"ready"

suggestions

readonlyProperty
suggestions: Array<SearchResultsSuggestions>

An array of results from the suggest method.

Read more...

suggestionsDisabled

Property
suggestionsDisabled: boolean

Enable suggestions for the widget.

Read more...

Attribute
suggestions-disabled
Default value
false

Methods

MethodSignature
blurSearch(): Promise<void>
clearSearch(): Promise<void>
componentOnReady(): Promise<void>
destroy(): Promise<void>
focusSearch(): Promise<void>
search(term: __esri.Point | __esri.SuggestResult | nullish | number[] | string): Promise<__esri.SearchResponse | nullish>
suggest(term: string): Promise<__esri.SuggestResponse | nullish>

blurSearch

Method
blurSearch(): Promise<void>
Returns
Promise<void>

clearSearch

Method
clearSearch(): Promise<void>
Returns
Promise<void>

componentOnReady

Method
componentOnReady(): Promise<void>

Create a promise that resolves once component is fully loaded.

Returns
Promise<void>

destroy

Method
destroy(): Promise<void>

Permanently destroy the component

Returns
Promise<void>

focusSearch

Method
focusSearch(): Promise<void>
Returns
Promise<void>
Method
search(term: __esri.Point | __esri.SuggestResult | nullish | number[] | string): Promise<__esri.SearchResponse | nullish>
Parameters
ParameterTypeOptional?
term
Array<number> | Point | SuggestResult | null | string | undefined
Returns
Promise<SearchResponse | null | undefined>

suggest

Method
suggest(term: string): Promise<__esri.SuggestResponse | nullish>
Parameters
ParameterTypeOptional?
term
string
Returns
Promise<SuggestResponse | null | undefined>

Events

EventType
SearchSearchBlurEvent
SearchSearchClearEvent
SearchSearchCompleteEvent
SearchSearchFocusEvent
{ name: "state"; }
undefined
SearchSelectResultEvent
SearchSearchStartEvent
SearchSuggestCompleteEvent
SearchSuggestStartEvent

arcgisBlur

Event
arcgisBlur: SearchSearchBlurEvent

arcgisClear

Event
arcgisClear: SearchSearchClearEvent

arcgisComplete

Event
arcgisComplete: SearchSearchCompleteEvent

arcgisFocus

Event
arcgisFocus: SearchSearchFocusEvent

arcgisPropertyChange

Event
arcgisPropertyChange: { name: "state"; }

Fired when the value of a property is changed. Use this to listen to changes to properties.

arcgisReady

Event
arcgisReady: undefined

arcgisSelectResult

Event
arcgisSelectResult: SearchSelectResultEvent

arcgisStart

Event
arcgisStart: SearchSearchStartEvent

arcgisSuggestComplete

Event
arcgisSuggestComplete: SearchSuggestCompleteEvent

arcgisSuggestStart

Event
arcgisSuggestStart: SearchSuggestStartEvent

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close