Skip to main content
4.0.7Next5.1.05.0.35.0.25.0.15.0.04.0.94.0.84.0.73.2.03.1.03.0.13.0.02.1.12.0.101.0.0
Version: 4.0.7

List

TODO: Add description

Basic Usage

<triton-list>
<triton-list-header>The Header</triton-list-header>
<triton-list-item>Item One</triton-list-item>
<triton-list-item>Item Two</triton-list-item>
<triton-list-footer>The Footer</triton-list-footer>
</triton-list>
<TritonList>
<TritonListHeader>The Header</TritonListHeader>
<TritonListItem>Item One</TritonListItem>
<TritonListItem>Item Two</TritonListItem>
<TritonListFooter>The Footer</TritonListFooter>
</TritonList>
<html> 
<head>
<script type="module">
import { defineCustomElements } from '~node_modules/@kognifai/triton-cl-core/loader/index.es2017.js';
defineCustomElements();
</script>
</head>
<body>
<triton-list>
<triton-list-header>The Header</triton-list-header>
<triton-list-item>Item One</triton-list-item>
<triton-list-item>Item Two</triton-list-item>
<triton-list-footer>The Footer</triton-list-footer>
</triton-list>
</body>
</html>
The HeaderItem OneItem TwoThe Footer

Variants

List

To render a list, wrap list-items with <triton-list>. This wrapper will apply style and prevent unwanted events from child conmponents to propagate outside the list.

  <triton-list>
...
</triton-list>

Items

A TritonList consists of TritonListItem elements. These are the items which will be rendered in the list. TritonListItems can be rendered in two different ways, either by simply passing in markup, or by using predefined props. If title or description properties are set, the content in the slot will be ignored.

List Item 1List Item 2List Item 3
<triton-list>
<triton-list-item>List Item 1</triton-list-item>
<triton-list-item>List Item 2</triton-list-item>
<triton-list-item>List Item 3</triton-list-item>
</triton-list>

Up to one header and up to one footer can be added to the list.

Header!List Item 1The Footer
<triton-list>
<triton-list-header>Header!</triton-list-header>
<triton-list-item>List Item 1</triton-list-item>
<triton-list-footer>The Footer</triton-list-footer>
</triton-list>

Appearance

Skin

The list itself can be styled using the skin property.

Flat List ItemFlat List ItemFlat List ItemSemi-border List ItemSemi-border List ItemSemi-border List Item
<triton-list skin="flat">
<triton-list-item>Flat List Item</triton-list-item>
<triton-list-item>Flat List Item</triton-list-item>
<triton-list-item>Flat List Item</triton-list-item>
</triton-list>

<triton-list skin="semi-border">
<triton-list-item>Semi-border List Item</triton-list-item>
<triton-list-item>Semi-border List Item</triton-list-item>
<triton-list-item>Semi-border List Item</triton-list-item>
</triton-list>

Space

The space property can be used to set the amount of space between the content of the list-items

xlarge space list1 List Item2 List Item3 List Item
<triton-list space="xlarge">
<triton-list-header>xlarge space list</triton-list-header>
<triton-list-item>1 List Item</triton-list-item>
<triton-list-item>2 List Item</triton-list-item>
<triton-list-item>3 List Item</triton-list-item>
</triton-list>

Behavior

Orientation

Use the orientation property to determine the direction in which the list renders.

Horizontal List1 List Item2 List Item3 List Item
<triton-list orientation="horizontal">
<triton-list-header>Horizontal List</triton-list-header>
<triton-list-item>1 List Item</triton-list-item>
<triton-list-item>2 List Item</triton-list-item>
<triton-list-item>3 List Item</triton-list-item>
</triton-list>

Clickable

To make the list item appear clickable, use the clickable property. This will also allow the list to be manouvered by tab.

Clickable ListClickable List ItemClickable List ItemTry to use tab!
<triton-list clickable>
<triton-list-header>Clickable List</triton-list-header>
<triton-list-item>Clickable List Item</triton-list-item>
<triton-list-item>Clickable List Item</triton-list-item>
<triton-list-item>Try to use tab!</triton-list-item>
</triton-list>

API

Properties

TritonList

PropertyDescriptionTypeDefault
clickableMake the list items appear clickable, it will also make them tabablebooleanfalse
gapGap between each element in the component, only applies to skin flatbase body large medium small tiny xlarge xxlarge xxxlarge-
orientationOrientation of the list layouthorizontal vertical'vertical'
skinSkin of the entire listborder flat semi-border'border'
spaceGap between each element inside items in the listbase body large medium small tiny xlarge xxlarge xxxlarge'base'

TritonListHeader

PropertyDescriptionTypeDefault
stickyStic the header to the top of the list on scrollbooleanfalse

TritonListItem

PropertyDescriptionTypeDefault
activeThe state of the list item, true indicates activebooleanfalse
iconIcon-
primary-textstring-
secondary-textstring-
spaceGap between each element in the componentbase body large medium small tiny xlarge xxlarge xxxlarge'base'

Details

Depends on