メインコンテンツまでスキップ
バージョン: v8

ion-searchbar

scoped

Properties​

animated​

Descriptiontrueの場合、検索バーのアニメーションを有効にします。
Attributeanimated
Typeboolean
Defaultfalse

autocapitalize​

Descriptionテキスト値がユーザーによって入力/編集される際に、自動的に大文字にするかどうか、またどのようにするかについて示します。利用可能なオプション: "off", "none", "on", "sentences", "words", "characters".
Attributeautocapitalize
Typestring
Default'off'

autocomplete​

DescriptionInputのオートコンプリートプロパティを設定します。
Attributeautocomplete
Type"name" | "email" | "tel" | "url" | "on" | "off" | "honorific-prefix" | "given-name" | "additional-name" | "family-name" | "honorific-suffix" | "nickname" | "username" | "new-password" | "current-password" | "one-time-code" | "organization-title" | "organization" | "street-address" | "address-line1" | "address-line2" | "address-line3" | "address-level4" | "address-level3" | "address-level2" | "address-level1" | "country" | "country-name" | "postal-code" | "cc-name" | "cc-given-name" | "cc-additional-name" | "cc-family-name" | "cc-number" | "cc-exp" | "cc-exp-month" | "cc-exp-year" | "cc-csc" | "cc-type" | "transaction-currency" | "transaction-amount" | "language" | "bday" | "bday-day" | "bday-month" | "bday-year" | "sex" | "tel-country-code" | "tel-national" | "tel-area-code" | "tel-local" | "tel-extension" | "impp" | "photo"
Default'off'

autocorrect​

DescriptionInputのオートコレクトプロパティを設定します。
Attributeautocorrect
Type"off" | "on"
Default'off'

cancelButtonIcon​

Descriptionキャンセルボタンのアイコンを設定します。 md modeのみに適用されます。デフォルトは arrow-back-sharp です。
Attributecancel-button-icon
Typestring
Defaultconfig.get('backButtonIcon', arrowBackSharp) as string

cancelButtonText​

DescriptionSet the cancel button text. Only applies to ios mode.
Attributecancel-button-text
Typestring
Default'Cancel'

clearIcon​

Descriptionクリアアイコンを設定します。デフォルトは ios の場合は close-circle 、md の場合は close-sharp です。
Attributeclear-icon
Typestring | undefined
Defaultundefined

color​

Descriptionアプリケーションのカラーパレットから使用する色を指定します。デフォルトのオプションは以下の通りです。 "primary", "secondary", "tertiary", "success", "warning", "danger", "light", "medium", と "dark" です.色に関する詳しい情報は theming を参照してください。
Attributecolor
Type"danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string & Record<never, never> | undefined
Defaultundefined

debounce​

Descriptionキーを押すたびに ionInput イベントが発生するまでの待ち時間をミリ秒単位で設定します。
Attributedebounce
Typenumber | undefined
Defaultundefined

disabled​

Descriptiontrueの場合、ユーザはInputと対話することができません。
Attributedisabled
Typeboolean
Defaultfalse

enterkeyhint​

Descriptionどのエンターキーを表示するかのブラウザへのヒント。指定可能な値。"enter", "done", "go", "next", "previous", "search", and "send".
Attributeenterkeyhint
Type"done" | "enter" | "go" | "next" | "previous" | "search" | "send" | undefined
Defaultundefined

inputmode​

Descriptionどのキーボードを表示するかのブラウザへのヒント。指定可能な値。"none", "text", "tel", "url", "email", "numeric", "decimal", and "search".
Attributeinputmode
Type"decimal" | "email" | "none" | "numeric" | "search" | "tel" | "text" | "url" | undefined
Defaultundefined

maxlength​

Descriptionこの属性は、ユーザが入力できる最大文字数を指定します。
Attributemaxlength
Typenumber | undefined
Defaultundefined

minlength​

Descriptionこの属性は、ユーザーが入力できる最小の文字数を指定します。
Attributeminlength
Typenumber | undefined
Defaultundefined

mode​

Descriptionmodeは、どのプラットフォームのスタイルを使用するかを決定します。
Attributemode
Type"ios" | "md"
Defaultundefined

name​

Descriptionフォームで使用する場合は、フォーム・データと一緒に送信されるコントロールの名前を設定します。
Attributename
Typestring
Defaultthis.inputId

placeholder​

DescriptionInputのplaceholderを設定します。 placeholder には、文字列としてプレーンテキストまたはHTMLのいずれかを指定することができます。通常HTML用に予約されている文字を表示するには、エスケープする必要があります。例えば <Ionic> は &lt;Ionic&gt; になります。詳細は セキュリティ・ドキュメンテーション をご覧ください。
Attributeplaceholder
Typestring
Default'Search'

searchIcon​

Description検索アイコンとして使用するアイコンです。デフォルトは ios modeでは search-outline 、md modeでは search-sharp です。
Attributesearch-icon
Typestring | undefined
Defaultundefined

showCancelButton​

Descriptionキャンセルボタンに関する動作を設定します。デフォルトは "never" です。focus" に設定すると、フォーカスが当たったときにキャンセルボタンを表示します。never"に設定すると、キャンセルボタンを非表示にします。always"` に設定すると、フォーカスの状態に関係なくキャンセルボタンを表示します。
Attributeshow-cancel-button
Type"always" | "focus" | "never"
Default'never'

showClearButton​

Descriptionクリアボタンに関する動作を設定します。デフォルトは "focus" です。"focus"に設定すると、Inputが空でない場合、フォーカス時にクリアボタンを表示します。"never"に設定すると、クリアボタンを非表示にします。"always"に設定すると、フォーカスの状態に関係なくクリアボタンを表示するが、Inputが空でない場合にのみクリアボタンを表示します。
Attributeshow-clear-button
Type"always" | "focus" | "never"
Default'always'

spellcheck​

Descriptiontrueの場合、入力値のスペルチェックを有効にします。
Attributespellcheck
Typeboolean
Defaultfalse

type​

DescriptionInputの種類を設定します。
Attributetype
Type"email" | "number" | "password" | "search" | "tel" | "text" | "url"
Default'search'

value​

Description検索バーの値。
Attributevalue
Typenull | string | undefined
Default''

Events​

NameDescription
ionBlurInputのフォーカスが外れたときに発行されます。
ionCancelキャンセルボタンがクリックされたときに発行されます。
ionChangeonChange イベントは、ユーザが要素の値を変更したときに <ion-searchbar> 要素に対して発生する。ionInput イベントとは異なり、要素の値が変更されるたびに ionChange イベントが発生するわけではない。 ionChange イベントは、ユーザによって値が変更されたときに発生する。これは、要素のフォーカスが外れたときや、"Enter" キーが押されたときに発生する。また、クリアボタンやキャンセルボタンをクリックしたときにも ionChange イベントが発生することがある。 プログラムで value プロパティを設定した場合には、このイベントは発生しない。
ionClearClear Inputボタンがクリックされたときに発行されます。
ionFocusInputにフォーカスが当たったときに発行されます。
ionInpution-searchbar要素の value が変更されたときに発行されます。

Methods​

getInputElement​

Description要素の内部で使用されているネイティブの <input> 要素を返します。
SignaturegetInputElement() => Promise<HTMLInputElement>

setFocus​

DescriptionSets focus on the native input in ion-searchbar. Use this method instead of the global input.focus(). Developers who wish to focus an input when a page enters should call setFocus() in the ionViewDidEnter() lifecycle method. Developers who wish to focus an input when an overlay is presented should call setFocus after didPresent has resolved. See managing focus for more information.
SignaturesetFocus() => Promise<void>

CSS Custom Properties​

NameDescription
--background検索バーのInputの背景
--background検索バーのInputの背景
--border-radius検索バーのInputのボーダー半径
--border-radius検索バーのInputのボーダー半径
--box-shadow検索バーのInputのボックスシャドウ
--box-shadow検索バーのInputのボックスシャドウ
--cancel-button-color検索バーのキャンセルボタンの色
--cancel-button-color検索バーのキャンセルボタンの色
--clear-button-color検索バーのクリアボタンの色
--clear-button-color検索バーのクリアボタンの色
--color検索バーのテキストの色
--color検索バーのテキストの色
--icon-color検索バーのアイコンの色
--icon-color検索バーのアイコンの色
--placeholder-color検索バーのPlaceholderの色
--placeholder-color検索バーのPlaceholderの色
--placeholder-font-style検索バーのPlaceholderのFont Style
--placeholder-font-style検索バーのPlaceholderのFont Style
--placeholder-font-weight検索バーのPlaceholderのFont Weight
--placeholder-font-weight検索バーのPlaceholderのFont Weight
--placeholder-opacity検索バーのPlaceholderの不透明度
--placeholder-opacity検索バーのPlaceholderの不透明度
View Source