obap-pages

June 12, 2020 ยท View on GitHub

A content switcher.

Usage

import '@obap/obap-elements/obap-pages/obap-pages.js';

<obap-pages selected-index="0">
   <div>Page 1</div>
   <div>Page 2</div>
   <div>Page 3</div>
</obap-pages>

Mixins: ObapSelectorController

Properties

PropertyAttributeTypeDefaultDescription
disableddisabledBoolean"false"If true, the button will be disabled.
enterSelectsenter-selectsbooleanfalseIf true, items are selected on enter.
itemsitemsarray"[]"(readonly) - The list of items from which a selection can be made.
roleroleString"null"The ARIA role of the element.
selectedIndexselected-indexNumber"1"Gets or sets the selected element index.
selectorTypeselector-typestring"single"The type of selection allowed. Can be 'single' (default), 'multi' and 'range'. The last two are provided by the respective mixins.
togglestogglesbooleanfalseIn single select mode, setting this to true deselects the item if you select it a second time.

Methods

MethodTypeDescription
indexOf(item: Object): numberGets the index of an element, if it's a child of the selection list.

item: The item for which to find the index.
select(index: any): void

Slots

NameDescription
-Default slot