Item dividers are block elements that can be used to separate items in a list. They are similar to list headers, but instead of only being placed at the top of a list, they should go in between groups of items.
Basic Usage html src/app/example.component.html example.component.html ts src/app/example.component.ts example.component.ts
< ion-list >
< ion-item-group >
< ion-item-divider >
< ion-label > Section A </ ion-label >
</ ion-item-divider >
< ion-item >
< ion-label > A1 </ ion-label >
</ ion-item >
< ion-item >
< ion-label > A2 </ ion-label >
</ ion-item >
< ion-item lines = " none " >
< ion-label > A3 </ ion-label >
</ ion-item >
</ ion-item-group >
< ion-item-group >
< ion-item-divider >
< ion-label > Section B </ ion-label >
</ ion-item-divider >
< ion-item >
< ion-label > B1 </ ion-label >
</ ion-item >
< ion-item >
< ion-label > B2 </ ion-label >
</ ion-item >
< ion-item lines = " none " >
< ion-label > B3 </ ion-label >
</ ion-item >
</ ion-item-group >
</ ion-list > Theming Colors html src/app/example.component.html example.component.html ts src/app/example.component.ts example.component.ts
< ion-item-divider >
< ion-label > Default </ ion-label >
</ ion-item-divider >
< ion-item-divider color = " primary " >
< ion-label > Primary </ ion-label >
</ ion-item-divider >
< ion-item-divider color = " secondary " >
< ion-label > Secondary </ ion-label >
</ ion-item-divider >
< ion-item-divider color = " tertiary " >
< ion-label > Tertiary </ ion-label >
</ ion-item-divider >
< ion-item-divider color = " success " >
< ion-label > Success </ ion-label >
</ ion-item-divider >
< ion-item-divider color = " warning " >
< ion-label > Warning </ ion-label >
</ ion-item-divider >
< ion-item-divider color = " danger " >
< ion-label > Danger </ ion-label >
</ ion-item-divider >
< ion-item-divider color = " light " >
< ion-label > Light </ ion-label >
</ ion-item-divider >
< ion-item-divider color = " medium " >
< ion-label > Medium </ ion-label >
</ ion-item-divider >
< ion-item-divider color = " dark " >
< ion-label > Dark </ ion-label >
</ ion-item-divider > CSS Custom Properties html src/app/example.component.html example.component.html css src/app/example.component.css example.component.css ts src/app/example.component.ts example.component.ts
< ion-item-divider >
< ion-label > Item Divider </ ion-label >
</ ion-item-divider > Properties color Description The color to use from your application's color palette. Default options are: "primary", "secondary", "tertiary", "success", "warning", "danger", "light", "medium", and "dark". For more information on colors, see theming . Attribute colorType "danger" | "dark" | "light" | "medium" | "primary" | "secondary" | "success" | "tertiary" | "warning" | string | undefinedDefault undefined
mode Description The mode determines which platform styles to use. This is a virtual property that is set once during initialization and will not update if you change its value after the initial render. Attribute modeType "ios" | "md"Default undefined
sticky Description When it's set to true, the item-divider will stay visible when it reaches the top of the viewport until the next ion-item-divider replaces it. This feature relies in position:sticky: https://caniuse.com/#feat=css-sticky Attribute stickyType booleanDefault false
Events No events available for this component.
Methods No public methods available for this component.
CSS Shadow Parts Name Description containerThe wrapper element that contains the default slot. innerThe inner wrapper element that arranges the divider content.
CSS Custom Properties iOS MD
Name Description --backgroundBackground of the item divider --colorColor of the item divider --inner-padding-bottomBottom inner padding of the item divider --inner-padding-endEnd inner padding of the item divider --inner-padding-startStart inner padding of the item divider --inner-padding-topTop inner padding of the item divider --padding-bottomBottom padding of the item divider --padding-endRight padding if direction is left-to-right, and left padding if direction is right-to-left of the item divider --padding-startLeft padding if direction is left-to-right, and right padding if direction is right-to-left of the item divider --padding-topTop padding of the item divider
Slots Name Description Content is placed between the named slots if provided without a slot. endContent is placed to the right of the divider text in LTR, and to the left in RTL. startContent is placed to the left of the divider text in LTR, and to the right in RTL.