If you answer yes, we store and analyse information that helps us improve the website. You can change your choice at any time at the bottom of the page. More about what we store and why.

We also store necessary information that cannot be opted out of. This makes the website work and keeps it secure.

Skip to main content

What are you looking for?

Try searching for…

Components

List

List is used to present content in a clear and structured way, for example to summarize main points or show the user which steps must be followed in a specific order.

Press Enter to start editing
<ul class="ds-list">
  <li>Bøyabreen</li>
  <li>Briksdalsbreen</li>
  <li>Nigardsbreen</li>
</ul>
const Preview = () => {
  return (
    <List.Unordered>
      <List.Item>Bøyabreen</List.Item>
      <List.Item>Briksdalsbreen</List.Item>
      <List.Item>Nigardsbreen</List.Item>
    </List.Unordered>
  );
};

render(<Preview />)

Usage

You use either <ul> or <ol> with the class name ds-list. <li> is used for each list item, and does not need a class name.

CSS variables and data attributes

Sizes are controlled with data-size. The component will inherit the closest parent where this is set.

CSS Variables
NameValue
--dsc-list-margin-topvar(--ds-size-3)
--dsc-list-margin-top-nestedvar(--ds-size-2)
--dsc-list-padding-inlinevar(--ds-size-6) 0

No relevant data attributes found.

Example

Unordered list

Ordered list

React

ListItem

asChild
Description

Change the default rendered element for the one passed as a child, merging their props and behavior.

Type
boolean
Default
false
NameTypeDefaultDescription
asChildbooleanfalse

Change the default rendered element for the one passed as a child, merging their props and behavior.

ListUnordered

asChild
Description

Change the default rendered element for the one passed as a child, merging their props and behavior.

Type
boolean
Default
false
NameTypeDefaultDescription
asChildbooleanfalse

Change the default rendered element for the one passed as a child, merging their props and behavior.

ListOrdered

asChild
Description

Change the default rendered element for the one passed as a child, merging their props and behavior.

Type
boolean
Default
false
NameTypeDefaultDescription
asChildbooleanfalse

Change the default rendered element for the one passed as a child, merging their props and behavior.

Edit this page on github.com (opens in a new tab)