Skip to main content

Definition List Deprecated

Definition Lists are used to display name/value pairs such as terms and definitions. Particularly useful for glossaries.

Please note that this component has been deprecated and will be removed in the future releases. It’s replaced by List and List Item components.

Examples

Open in new window
<duet-definition-list variation="striped"></duet-definition-list>

<script>
// Select the above definition list
var list = document.querySelector("duet-definition-list")

// Sets list items and their values
list.items = [
{ label: "Nimi", value: "Lasse Mäkinen" },
{ label: "Osoite", value: "Kotikatu 23 A 4, 00220 Helsinki, Suomi" },
{ label: "Puhelin", value: "+358 400 123 456" },
{ label: "Email", value: "lasse.makinen@test.com" },
{ label: "Kieli", value: "Suomi" },
{ label: "Alueyhtiö", value: "Lähitapiola Keskinäinen Vakuutusyhtiö" }
]
</script>
Open in new window
<duet-definition-list></duet-definition-list>

<script>
var list = document.querySelector("duet-definition-list")

list.items = [
{ label: "Nimi", value: "Lasse Mäkinen" },
{ label: "Osoite", value: "Kotikatu 23 A 4, 00220 Helsinki, Suomi" },
{ label: "Puhelin", value: "+358 400 123 456" },
{ label: "Email", value: "lasse.makinen@test.com" },
{ label: "Kieli", value: "Suomi" },
{ label: "Alueyhtiö", value: "Lähitapiola Keskinäinen Vakuutusyhtiö" }
]
</script>
Open in new window
<duet-definition-list label-width="30" variation="striped"></duet-definition-list>  
<duet-definition-list label-width="50" variation="striped"></duet-definition-list>
<duet-definition-list label-width="70" variation="striped"></duet-definition-list>

<script>
var lists = document.querySelectorAll("duet-definition-list")

lists.forEach(function(list) {
list.items = [
{ label: "Nimi", value: "Lasse Mäkinen" },
{ label: "Osoite", value: "Kotikatu 23 A 4, 00220 Helsinki, Suomi" },
{ label: "Puhelin", value: "+358 400 123 456" },
{ label: "Email", value: "lasse.makinen@test.com" },
{ label: "Kieli", value: "Suomi" },
{ label: "Alueyhtiö", value: "Lähitapiola Keskinäinen Vakuutusyhtiö" }
]
})
</script>

Properties #

Property Attribute Description Type Default
items -- An array of items for the definition list. Items have to include mandatory "label" and "value" fields to work. DuetDefinitionListItem[] undefined
labelWidth label-width Set the column width of the first column in percentages. "30" | "50" | "70" "30"
margin margin Controls the margin of the component. "auto" | "none" "auto"
theme theme Theme of the definition list. "" | "default" | "turva" ""
variation variation Style variation of the definition list. "default" | "striped" "default"

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.

Integration guidelines


Tutorials

Follow these practical tutorials to learn how to build simple page layouts using Duet’s CSS Framework, Web Components and other features:

Tutorials

Abstract

Tutorials

Building Layouts

Tutorials

Using CLI Tools

Tutorials

Creating Custom Patterns

Tutorials

Server Side Rendering

Tutorials

Sharing Prototypes

Tutorials

VS Code

Tutorials

Zeplin

Tutorials

Usage With Markdown


Troubleshooting

If you experience any issues while using a component, please head over to the Support page for more guidelines and help.