<ons-splitter />

実例

Side menu

The Splitter is used to display a menu next to the main content. It can be configured to either display in column layout or as a swipeable menu. It is also possible to automatically switch between column layout and a layout with a swipeable menu based on the screen size or any arbitrary condition. In some situations it can be useful to display a column layout on large devices and hide the menu on smaller screens.

The menu is defined using the SplitterSide component. This component can either be displayed as a column next to the main content or as a swipeable menu. This behavior is controlled using the collapse property.

To enable opening and closing the menu by swiping the isSwipeable property must be defined. The side property is used to specify on which side of the screen the menu is displayed.

Opening and closing the menu

The menu can be opened and closed using the isOpen property. This property only works when the menu is collapsed, since in column layout it is always visible.

In the following example the menu is opened, when the user presses a button. The onClose property is called when the menu is closed and is used to control the state.

Main content

The main content of the screen is put inside the SplitterContent component. A Page component should be put as a child of this component.

<Splitter>
  <SplitterContent>
    <Page>
      Main content
    </Page>
  </SplitterContent
</Splitter>

関連情報

名前 概要
left Left <ons-splitter-side> element. (翻訳中)
right Right <ons-splitter-side> element. (翻訳中)
side First <ons-splitter-side> element regardless the actual side. (翻訳中)
content The <ons-splitter-content> element. (翻訳中)
onDeviceBackButton バックボタンハンドラ。

お困りですか?

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

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

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