There are following components included:
ListItem
- main list item elementName | Type | Default | Description |
---|---|---|---|
after | string | Content of the list item "after" area | |
chevron | boolean | undefined | Enables chevron icon if list item is link. Overwrites |
chevronIcon | string | Allows to replace default chevron icon with custom one | |
chevronIos | boolean | true | Enables chevron icon if list item is link in iOS theme |
chevronMaterial | boolean | true | Enables chevron icon if list item is link in Material theme |
colors | object | Object with Tailwind CSS colors classes | |
colors.activeBgIos | string | 'active:bg-black active:bg-opacity-10 dark:active:bg-white dark:active:bg-opacity-10' | |
colors.activeBgMaterial | string | '' | |
colors.groupTitleBgIos | string | 'bg-ios-light-surface-variant dark:bg-ios-dark-surface-variant' | |
colors.groupTitleBgMaterial | string | 'bg-md-light-surface-2 dark:bg-md-dark-surface-2' | |
colors.groupTitleContactsBgIos | string | 'dark:bg-[#323234]' | |
colors.groupTitleContactsBgMaterial | string | 'bg-transparent dark:bg-transparent' | |
colors.groupTitleContactsTextMaterial | string | 'text-md-light-primary dark:text-md-dark-primary' | |
colors.groupTitleСontactsTextIos | string | 'text-opacity-90 dark:text-opacity-90' | |
colors.menuListItemActiveBgIos | string | 'bg-primary bg-opacity-15 dark:bg-primary' | |
colors.menuListItemActiveBgMaterial | string | 'bg-md-light-secondary-container dark:bg-md-dark-secondary-container' | |
colors.menuListItemActiveTextIos | string | 'text-primary dark:text-white' | |
colors.menuListItemActiveTextMaterial | string | 'text-md-light-on-secondary-container dark:text-md-dark-on-secondary-container' | |
colors.menuListItemBgIos | string | 'active:bg-black active:bg-opacity-10 dark:active:bg-white dark:active:bg-opacity-10' | |
colors.menuListItemBgMaterial | string | 'bg-md-light-surface-1 dark:bg-md-dark-surface-1' | |
colors.menuListItemTextIos | string | 'text-black dark:text-white' | |
colors.menuListItemTextMaterial | string | 'text-md-light-on-surface-variant dark:text-md-dark-on-surface-variant' | |
colors.primaryTextIos | string | 'text-black dark:text-white' | |
colors.primaryTextMaterial | string | 'text-md-light-on-surface dark:text-md-dark-on-surface' | |
colors.secondaryTextIos | string | 'text-black text-opacity-55 dark:text-white dark:text-opacity-55' | |
colors.secondaryTextMaterial | string | 'text-md-light-on-surface-variant dark:text-md-dark-on-surface-variant' | |
colors.touchRipple | string | 'touch-ripple-black dark:touch-ripple-white' | |
component | string | 'li' | Component's HTML Element |
contacts | boolean | undefined | Enables Contacts List by adding required additional classes for styling |
contentClass | string | Additional class to add on item "content" element | |
dividers | boolean | undefined | Renders dividers (borders) between list items. If not specified then inherits |
footer | string | Content of the list item "footer" area | |
groupTitle | boolean | false | Renders it as a list group title |
header | string | Content of the list item "header" area | |
href | string | boolean | List item link's | |
innerClass | string | Additional class to add on item "inner" element | |
label | boolean | false | Renders item content as |
link | boolean | false | Renders list item as link ( |
linkComponent | string | 'a' | List item link HTML Element |
linkProps | any | Object with additional props (attributes) to pass to the Link/Button | |
mediaClass | string | Additional class to add on item "media" element | |
menuListItem | boolean | Renders list item as menu list item (same as | |
menuListItemActive | boolean | false | Makes menu list item highlighted (active) (same as |
strongTitle | boolean | 'auto' | Makes item title strong (bold). When | |
subtitle | string | Content of the list item "subtitle" area | |
target | string | List item link's | |
text | string | Content of the list item "text" area | |
title | string | Content of the list item "title" area | |
titleFontSizeIos | string | 'text-[17px]' | Tailwind CSS class for item title font size in iOS theme |
titleFontSizeMaterial | string | 'text-[16px]' | Tailwind CSS class for item title font size in Material theme |
titleWrapClass | string | Additional class to add on item "titleWrap" element | |
touchRipple | boolean | true | Enables touch ripple effect in Material theme |
onClick | function(e) |
|
Name | Description |
---|---|
after | Content of the list item "after" area |
content | Content of the item-content |
footer | Content of the list item "footer" area |
header | Content of the list item "header" area |
inner | Content of the item-inner |
media | Content of the list item "media" area |
subtitle | Content of the list item "subtitle" area |
text | Content of the list item "text" area |
title | Content of the list item "title" area |
<script>import {Page,Navbar,NavbarBackLink,Badge,Block,BlockTitle,List,ListGroup,ListItem,} from 'konsta/svelte';import DemoIcon from '../components/DemoIcon.svelte';</script><Page><Navbar title="List" /><BlockTitle>Simple List</BlockTitle><List><ListItem title="Item 1" /><ListItem title="Item 2" /><ListItem title="Item 3" /></List><BlockTitle>Strong List</BlockTitle><List strong><ListItem title="Item 1" /><ListItem title="Item 2" /><ListItem title="Item 3" /></List><BlockTitle>Strong Outline List</BlockTitle><List strong outline><ListItem title="Item 1" /><ListItem title="Item 2" /><ListItem title="Item 3" /></List><BlockTitle>Strong Inset List</BlockTitle><List strong inset><ListItem title="Item 1" /><ListItem title="Item 2" /><ListItem title="Item 3" /></List><BlockTitle>Strong Outline Inset List</BlockTitle><List strong outline inset><ListItem title="Item 1" /><ListItem title="Item 2" /><ListItem title="Item 3" /></List><BlockTitle>Simple Links List</BlockTitle><List strongIos outlineIos><ListItem title="Link 1" link /><ListItem title="Link 2" link /><ListItem title="Link 3" link /></List><BlockTitle>Data list, with icons</BlockTitle><List strongIos outlineIos><ListItem title="Ivan Petrov" after="CEO"><DemoIcon slot="media" /></ListItem><ListItem title="John Doe"><DemoIcon slot="media" /><Badge slot="after">5</Badge></ListItem><ListItem title="Jenna Smith"><DemoIcon slot="media" /></ListItem></List><BlockTitle>Links</BlockTitle><List strongIos outlineIos><ListItem link title="Ivan Petrov" after="CEO"><DemoIcon slot="media" /></ListItem><ListItem link title="John Doe" after="Cleaner"><DemoIcon slot="media" /></ListItem><ListItem link title="Jenna Smith"><DemoIcon slot="media" /></ListItem></List><BlockTitle>Links, Header, Footer</BlockTitle><List strongIos outlineIos><ListItem link header="Name" title="John Doe" after="Edit"><DemoIcon slot="media" /></ListItem><ListItem link header="Phone" title="+7 90 111-22-3344" after="Edit"><DemoIcon slot="media" /></ListItem><ListItem link header="Email" title="john@doe" footer="Home" after="Edit"><DemoIcon slot="media" /></ListItem><ListItemlinkheader="Email"title="john@konsta"footer="Work"after="Edit"><DemoIcon slot="media" /></ListItem></List><BlockTitle>Links, no icons</BlockTitle><List strongIos outlineIos><ListItem link title="Ivan Petrov" /><ListItem link title="John Doe" /><ListItem groupTitle title="Group title Here" /><ListItem link title="Ivan Petrov" /><ListItem link title="Jenna Smith" /></List><BlockTitle>Grouped with sticky titles</BlockTitle><List strongIos outlineIos><ListGroup><ListItemtitle="A"groupTitleclass="ios:top-11-safe material:top-16-safe sticky"/><ListItem title="Aaron " /><ListItem title="Abbie" /><ListItem title="Adam" /></ListGroup><ListGroup><ListItemtitle="B"groupTitleclass="ios:top-11-safe material:top-16-safe sticky"/><ListItem title="Bailey" /><ListItem title="Barclay" /><ListItem title="Bartolo" /></ListGroup><ListGroup><ListItemtitle="C"groupTitleclass="ios:top-11-safe material:top-16-safe sticky"/><ListItem title="Caiden" /><ListItem title="Calvin" /><ListItem title="Candy" /></ListGroup></List><BlockTitle class="text-2xl">Media Lists</BlockTitle><Block><p>Media Lists are almost the same as Data Lists, but with a more flexiblelayout for visualization of more complex data, like products, services,user, etc.</p></Block><BlockTitle>Songs</BlockTitle><List strongIos outlineIos><ListItemchevronMaterial={false}linktitle="Yellow Submarine"after="$15"subtitle="Beatles"text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus."><imgclass="ios:rounded-lg material:rounded-full ios:w-20 material:w-10"slot="media"src="https://cdn.framework7.io/placeholder/people-160x160-1.jpg"width="80"alt="demo"/></ListItem><ListItemchevronMaterial={false}linktitle="Don't Stop Me Now"after="$22"subtitle="Queen"text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus."><imgclass="ios:rounded-lg material:rounded-full ios:w-20 material:w-10"slot="media"src="https://cdn.framework7.io/placeholder/people-160x160-2.jpg"width="80"alt="demo"/></ListItem><ListItemchevronMaterial={false}linktitle="Billie Jean"after="$16"subtitle="Michael Jackson"text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus."><imgclass="ios:rounded-lg material:rounded-full ios:w-20 material:w-10"slot="media"src="https://cdn.framework7.io/placeholder/people-160x160-3.jpg"width="80"alt="demo"/></ListItem></List><BlockTitle>Mail App</BlockTitle><List strongIos outlineIos><ListItemchevronMaterial={false}linktitle="Facebook"after="17:14"subtitle="New messages from John Doe"text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus."/><ListItemchevronMaterial={false}linktitle="John Doe (via Twitter)"after="17:11"subtitle="John Doe (@_johndoe) mentioned you on Twitter!"text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus."/><ListItemchevronMaterial={false}linktitle="Facebook"after="16:48"subtitle="New messages from John Doe"text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus."/><ListItemchevronMaterial={false}linktitle="John Doe (via Twitter)"after="15:32"subtitle="John Doe (@_johndoe) mentioned you on Twitter!"text="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla sagittis tellus ut turpis condimentum, ut dignissim lacus tincidunt. Cras dolor metus, ultrices condimentum sodales sit amet, pharetra sodales eros. Phasellus vel felis tellus. Mauris rutrum ligula nec dapibus feugiat. In vel dui laoreet, commodo augue id, pulvinar lacus."/></List></Page>