List Ready
Lists are used to display name/value pairs such as terms and definitions. Particularly useful for glossaries.
Examples #
<duet-list variation="striped">
<duet-list-item>
<span slot="label">Nimi</span>
<span slot="value">Lasse Mäkinen</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Osoite</span>
<span slot="value">Kotikatu 23 A 4, 00220 Helsinki, Suomi</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Puhelin</span>
<span slot="value">+358 400 123 456</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Email</span>
<span slot="value">lasse.makinen@test.com</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Kieli</span>
<span slot="value">Suomi</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Alueyhtiö</span>
<span slot="value">Lähitapiola Keskinäinen Vakuutusyhtiö</span>
</duet-list-item>
</duet-list>
<duet-list variation="bordered">
<duet-list-item>
<span slot="label">Nimi</span>
<span slot="value">Lasse Mäkinen</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Osoite</span>
<span slot="value">Kotikatu 23 A 4, 00220 Helsinki, Suomi</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Puhelin</span>
<span slot="value">+358 400 123 456</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Email</span>
<span slot="value">lasse.makinen@test.com</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Kieli</span>
<span slot="value">Suomi</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Alueyhtiö</span>
<span slot="value">Lähitapiola Keskinäinen Vakuutusyhtiö</span>
</duet-list-item>
</duet-list>
<duet-list variation="inner-bordered">
<duet-list-item>
<span slot="label">Nimi</span>
<span slot="value">Lasse Mäkinen</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Osoite</span>
<span slot="value">Kotikatu 23 A 4, 00220 Helsinki, Suomi</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Puhelin</span>
<span slot="value">+358 400 123 456</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Email</span>
<span slot="value">lasse.makinen@test.com</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Kieli</span>
<span slot="value">Suomi</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Alueyhtiö</span>
<span slot="value">Lähitapiola Keskinäinen Vakuutusyhtiö</span>
</duet-list-item>
</duet-list>
<duet-list>
<duet-list-item>
<span slot="label">Nimi</span>
<span slot="value">Lasse Mäkinen</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Osoite</span>
<span slot="value">Kotikatu 23 A 4, 00220 Helsinki, Suomi</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Puhelin</span>
<span slot="value">+358 400 123 456</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Email</span>
<span slot="value">lasse.makinen@test.com</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Kieli</span>
<span slot="value">Suomi</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Alueyhtiö</span>
<span slot="value">Lähitapiola Keskinäinen Vakuutusyhtiö</span>
</duet-list-item>
</duet-list>
<duet-list label-width="30" variation="striped">
<duet-list-item>
<span slot="label">Nimi</span>
<span slot="value">Lasse Mäkinen</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Osoite</span>
<span slot="value">Kotikatu 23 A 4, 00220 Helsinki, Suomi</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Puhelin</span>
<span slot="value">+358 400 123 456</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Email</span>
<span slot="value">lasse.makinen@test.com</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Kieli</span>
<span slot="value">Suomi</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Alueyhtiö</span>
<span slot="value">Lähitapiola Keskinäinen Vakuutusyhtiö</span>
</duet-list-item>
</duet-list>
<duet-list label-width="50" variation="striped">
<duet-list-item>
<span slot="label">Nimi</span>
<span slot="value">Lasse Mäkinen</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Osoite</span>
<span slot="value">Kotikatu 23 A 4, 00220 Helsinki, Suomi</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Puhelin</span>
<span slot="value">+358 400 123 456</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Email</span>
<span slot="value">lasse.makinen@test.com</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Kieli</span>
<span slot="value">Suomi</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Alueyhtiö</span>
<span slot="value">Lähitapiola Keskinäinen Vakuutusyhtiö</span>
</duet-list-item>
</duet-list>
<duet-list label-width="70" variation="striped">
<duet-list-item>
<span slot="label">Nimi</span>
<span slot="value">Lasse Mäkinen</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Osoite</span>
<span slot="value">Kotikatu 23 A 4, 00220 Helsinki, Suomi</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Puhelin</span>
<span slot="value">+358 400 123 456</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Email</span>
<span slot="value">lasse.makinen@test.com</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Kieli</span>
<span slot="value">Suomi</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Alueyhtiö</span>
<span slot="value">Lähitapiola Keskinäinen Vakuutusyhtiö</span>
</duet-list-item>
</duet-list>
<duet-card accessible-label="Pariturva-henkivakuutus, Laura-Karoliina Mäkinen" url="#" padding="large">
<duet-grid responsive distribution="space-between" alignment="top">
<duet-grid alignment="center" responsive breakpoint="medium">
<duet-grid-item fill>
<duet-heading level="h2" visual-level="h3">Pariturva-henkivakuutus</duet-heading>
<duet-spacer size="xx-small"></duet-spacer>
<duet-list padding="none" margin="none">
<duet-list-item>
<span slot="label">Hakemuksen luoja</span>
<span slot="value">Laura-Karoliina Mäkinen</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Vakuutusmäärä</span>
<span slot="value">55 000,00 €</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Hinta</span>
<span slot="value">480,77 € / vuosi</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Hakemus luotu</span>
<span slot="value">20.2.2020</span>
</duet-list-item>
</duet-list>
</duet-grid-item>
<duet-grid-item margin="none">
<duet-grid mobile="center">
<duet-spacer breakpoint="medium" direction="horizontal" size="xxxx-large"> </duet-spacer>
<duet-button tabindex="-1" wrapping="none" margin="none" variation="primary"> Valitse </duet-button>
</duet-grid>
<duet-spacer breakpoint="x-small" direction="vertical" size="large"></duet-spacer>
</duet-grid-item>
</duet-grid>
</duet-grid>
</duet-card>
<duet-list breakpoint="large" mobile="center" variation="striped">
<duet-list-item>
<span slot="label">Nimi</span>
<span slot="value">Lasse Mäkinen</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Osoite</span>
<span slot="value">Kotikatu 23 A 4, 00220 Helsinki, Suomi</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Puhelin</span>
<span slot="value">+358 400 123 456</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Email</span>
<span slot="value">lasse.makinen@test.com</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Kieli</span>
<span slot="value">Suomi</span>
</duet-list-item>
<duet-list-item>
<span slot="label">Alueyhtiö</span>
<span slot="value">Lähitapiola Keskinäinen Vakuutusyhtiö</span>
</duet-list-item>
</duet-list>
Properties #
Property | Attribute | Description | Type | Default |
---|---|---|---|---|
breakpoint | breakpoint | Switch the breakpoint used to trigger the content stacking. These match to similar media query tokens: $media-query-small and $media-query-large. | "large" | "medium" | "small" | "x-large" | "x-small" | "small" |
labelWidth | label-width | Set the column width of the first column in percentages. For automatic sizing of the column you can use class "duet-list" with a native <dl> element. See list utilities of the CSS framework. | "100" | "30" | "50" | "70" | "30" |
margin | margin | Controls the margin of the component. | "auto" | "none" | "auto" |
mobile | mobile | Adjusts the alignment of the list items on mobile breakpoint. | "center" | "left" | "left" |
padding | padding | Controls the padding of the component. | "auto" | "none" | "auto" |
responsive | responsive | Enable or disable the automatic responsive behaviour of the list component. Setting this option to "true" makes sure that contents are stacked vertically on mobile. When "false" is set, contents are always shown in a single row. | boolean | true |
theme | theme | Theme of the list. | "" | "default" | "turva" | "" |
variation | variation | Style variation of the list. | "bordered" | "default" | "inner-bordered" | "striped" | "default" |
Usage #
This section includes guidelines for designers and developers about the usage of this component in different contexts.
When to use #
- To display name/value pairs such as terms and definitions.
- To display a glossary list.
When not to use #
- To show tabular data. Use table component instead.
Accessibility #
This component has been validated to meet the WCAG 2.1 AA accessibility guidelines. You can find additional information regarding accessibility of this component below.
- List outputs a
dl
element (description list) which has a semantic meaning in HTML. For this reason list component should never be used for displaying e.g. tabular data. - Please note that some validation tools (e.g. Axe) will throw a warning for this component as we use Shadow DOM and the
dt
anddd
elements are wrapped in aduet-list-item
element. This warning can however be ignored in testing, as the browsers ignore the wrappings and interpret this component a regular descprition list.
Integration
For integration, event and theming guidelines, please see Using Components. This documentation explains how to implement and use Duet’s components across different technologies like Angular, React or Vanilla JavaScript.
Tutorials
Follow these practical tutorials to learn how to build simple page layouts using Duet’s CSS Framework, Web Components and other features:
Building Layouts
TutorialsUsing CLI Tools
TutorialsCreating Custom Patterns
TutorialsServer Side Rendering
TutorialsSharing Prototypes
TutorialsUsage With Markdown
Troubleshooting
If you experience any issues while using a component, please head over to the Support page for more guidelines and help.