v-ons-icon

実例

Icons

Icons are displayed using the VOnsIcon component. In Onsen UI there are three families of icons available:

The icon is selected using the icon prop. To use Material Icons the md- prefix is used, ion- for Ionicons and fa- for Font Awesome.

<v-ons-icon icon="md-menu"></v-ons-icon>

The code above displays a Material Design menu icon.

For quick autostyling, one or more modifiers can be provided in the icon prop with the corresponding icon name:

<v-ons-icon icon="ion-navicon, material:md-menu" size="12px, material: 18px"></v-ons-icon>

関連情報

Prop一覧

名前 型 / デフォルト値 概要
fixed-width Boolean When used in a list, you want the icons to have the same width so that they align vertically by defining this attribute. (翻訳中) Optional.
icon String

The icon name. "md-" prefix for Material Icons, "fa-" for Font Awesome and "ion-" prefix for Ionicons. See all available icons on the component description (at the top). Icons can also be styled based on modifier presence. Add comma-separated icons with "modifierName:" prefix. The code <v-ons-icon icon="ion-edit, material:md-edit"></v-ons-icon> will display "md-edit" for Material Design and "ion-edit" as the default icon. fa- prefix is added automatically if none is provided. Check See also section for more information.

(翻訳中)
Optional.
rotate Number アイコンを回転して表示します。90, 180, 270から指定できます。 Optional.
size String

The sizes of the icon. Valid values are lg, 2x, 3x, 4x, 5x, or in the size in pixels. Icons can also be styled based on modifier presence. Add comma-separated icons with "modifierName:" prefix. The code:

  <v-ons-icon
    icon="ion-edit"
    size="32px, material:24px">
  </v-ons-icon>

will render as a 24px icon if the "material" modifier is present and 32px otherwise.

(翻訳中)
Optional.
spin Boolean アイコンを回転するかどうかを指定します。 Optional.

お困りですか?

Onsen UIに関する質問は、Stack Overflowにてonsen-uiタグを付与してください。Onsen UIチームはあなたの問題解決をお手伝いします。

バグ報告や機能要望については、GitHub Issuesに記載をお願いいたします。

あわせて、下記の情報も参考にしてください。