Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: contained-list #3145

Merged
merged 37 commits into from
Sep 16, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
427f8d6
add new mdx pages
laurenmrice Sep 12, 2022
c2b9c8c
add images for usage tab
laurenmrice Sep 12, 2022
0428b55
fix content
laurenmrice Sep 12, 2022
efd6567
fix typos
laurenmrice Sep 12, 2022
c20f9d5
update content
laurenmrice Sep 12, 2022
628db0b
update headers
laurenmrice Sep 12, 2022
41fa89c
Update src/pages/components/contained-list/usage.mdx
laurenmrice Sep 12, 2022
fa909df
Update src/pages/components/contained-list/usage.mdx
laurenmrice Sep 12, 2022
8fef075
Update src/pages/components/contained-list/usage.mdx
laurenmrice Sep 12, 2022
2242e84
Update src/pages/components/contained-list/usage.mdx
laurenmrice Sep 12, 2022
21a21ee
Update src/pages/components/contained-list/usage.mdx
laurenmrice Sep 12, 2022
168a578
add in inline notification
laurenmrice Sep 12, 2022
f1dd71e
fix images
laurenmrice Sep 12, 2022
2b836c1
update side nav
laurenmrice Sep 13, 2022
6cbbd78
update images
laurenmrice Sep 13, 2022
a30452f
add Mike A feedback
laurenmrice Sep 13, 2022
2e77503
add code, accessibility, and style tab content
laurenmrice Sep 13, 2022
2d2a235
add style tab images
laurenmrice Sep 13, 2022
b4cce60
rename tab
laurenmrice Sep 14, 2022
75f0a69
fix style images
laurenmrice Sep 14, 2022
911e9cc
update style content
laurenmrice Sep 14, 2022
97b01a5
update from Jan
laurenmrice Sep 14, 2022
5826ad0
stlye image update
laurenmrice Sep 14, 2022
6f989bf
Merge branch 'main' into contained-list-docs
laurenmrice Sep 14, 2022
bf39a7c
update break
laurenmrice Sep 14, 2022
01125dc
Update src/pages/components/contained-list/style.mdx
laurenmrice Sep 15, 2022
ba5b887
Update src/pages/components/contained-list/style.mdx
laurenmrice Sep 15, 2022
909a334
update style and usage content
laurenmrice Sep 15, 2022
8d2df8b
update style and usage images
laurenmrice Sep 15, 2022
bcd21da
update image bug
laurenmrice Sep 15, 2022
289ab53
insert break
laurenmrice Sep 15, 2022
dbe3aa3
update structure content
laurenmrice Sep 15, 2022
4f1db73
update style images
laurenmrice Sep 15, 2022
abf8271
update image
laurenmrice Sep 15, 2022
cbaf07a
update style tab
laurenmrice Sep 15, 2022
6e17851
style tab updates
laurenmrice Sep 15, 2022
447bece
Merge branch 'main' into contained-list-docs
kodiakhq[bot] Sep 16, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
246 changes: 246 additions & 0 deletions src/pages/components/contained-list/usage.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,246 @@
---
title: Contained list
description:
Contained lists group content that is similar or related and can contain
read-only or interactive information.
tabs: ['Usage', 'Style', 'Code', 'Accessibility']
---

<PageDescription>

Contained lists group content that is similar or related and can contain
read-only or interactive information.

</PageDescription>

<AnchorLinks>

<AnchorLink>Overview</AnchorLink>
<AnchorLink>Live demo</AnchorLink>
<AnchorLink>Formatting</AnchorLink>
<AnchorLink>Content</AnchorLink>
<AnchorLink>On page list</AnchorLink>
<AnchorLink>Disclosed list</AnchorLink>
<AnchorLink>Modifiers</AnchorLink>
<AnchorLink>Related</AnchorLink>
<AnchorLink>Feedback</AnchorLink>

</AnchorLinks>

## Overview

Contained lists are typically used in smaller spaces inside of containers like
cards, sidebars, and disclosure situations. These lists allow one column of
information with multiple list item rows. The list header area and individual
list items can have inline actions and include interactive elements.
laurenmrice marked this conversation as resolved.
Show resolved Hide resolved

### When to use

- Use on a page inside of small spaces or in disclosure situations.
- Use when including interactive elements or inline actions.
laurenmrice marked this conversation as resolved.
Show resolved Hide resolved
- To logically group items that follow the same content structure.

### When not to use
laurenmrice marked this conversation as resolved.
Show resolved Hide resolved

Do not use contained lists if the content needs to be nested more than one level
deep and if the content becomes overly complex and lengthy. For these
situations, use the
[data table](https://carbondesignsystem.com/components/data-table/usage/)
component instead.

## Variants
laurenmrice marked this conversation as resolved.
Show resolved Hide resolved

| Variant | Purpose |
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| [On page list](#on-page-list) | Use this variant when placing the list on the main page of a user interface, for example on a card or in a sidebar. |
laurenmrice marked this conversation as resolved.
Show resolved Hide resolved
| [Disclosed list](#disclosed-list) | Use this variant when the list is shown within a temporary context, for example within a popover or layer that is elevated by a drop shadow or border. |

## Live demo
laurenmrice marked this conversation as resolved.
Show resolved Hide resolved

## Formatting

### Anatomy

Contained lists are made up of a list header, list title, list item rows, and
optional interactive elements.

<Row>
<Column colLg={8}>

![Contained list anatomy](images/contained-list-usage-1.png)

</Column>
</Row>

1. **List header:** Area to group the succeeding list items.
2. **List title:** Descriptive name for the group of list items.
3. **List item:** The content with in a list item row.
4. **Interactive element:** An element that you can interact with or treat as an
laurenmrice marked this conversation as resolved.
Show resolved Hide resolved
inline action, such as links, icons, and toggles.

### Sizing

#### List header area

The list header height is always fixed. The on page variant style list header
has a height of 48px. The disclosed variant style list header has a height of
32px.

#### List item row

List item row heights can vary based on the amount of content in each row. The
content in each row is flexible. By default, each list item row height is 48px
for one line of content.

<Row>
<Column colLg={8}>

![Contained list height](images/contained-list-usage-2.png)
laurenmrice marked this conversation as resolved.
Show resolved Hide resolved

</Column>
</Row>

### Alignment

Contained lists can have multiple sections. When multiple list sections are
present, they should stack and have 0px padding between each other.

<Row>
<Column colLg={8}>

![Contained list alignment](images/contained-list-usage-3.png)

</Column>
</Row>

### Scrolling

Contained list header areas can be sticky and fixed in place while the list item
rows scroll underneath. This functionality is optional depending on the use
case.

<Row>
<Column colLg={8}>

![Contained list scrolling](images/contained-list-usage-4.png)

</Column>
</Row>

## Content

### Main elements

#### List title

- A list title is a descriptive name for the group of list items.
- List titles should be short and clear, ranging from one to three words to
describe the list item group.
- Use sentence-case capitalization.

#### List item

— List item text can vary but the structure of the content should be similar per
row in the same contained list.

laurenmrice marked this conversation as resolved.
Show resolved Hide resolved
- List item text can have multiple lines of concise content, but should not
contain multiple paragraphs of lengthy information.
- Use sentence-case capitalization.

## On page list

Use the on page list variant when placing the list on the general page of a user
interface. On page lists typically appear in smaller spaces, like in a card or
sidebars. The on page list styling has no visible background header with fixed
information. If there are scrolling capabitlies, the header will remain sticky
and have a background layer to differentiate it from the list item rows
scrolling beneath it.

### Placement

On page lists should span the entire width of the container they are placed
within to make the best use of space and to achieve vertical type alignment with
other text and components on the page.

<Row>
<Column colLg={8}>

![Contained list on page variant in context image](images/contained-list-usage-5.png)

</Column>
</Row>

## Disclosed list

Use the disclosed list variant when placing the list within a temporary context,
like a popover or disclosure, which is typically accompanied by an enclosed
border or drop shadow. The disclosed list styling has a background layer
underneath the header. Each header has a smaller height than the on page list
styling to take up less real estate in the smaller and scrollable spaces it
usually appears in.

### Placement

Disclosed lists should span the entire width of the container they are placed
within to make the best use of space.

<Row>
<Column colLg={8}>

![Contained list disclosed variant in context image](images/contained-list-usage-6.png)

</Column>
</Row>

## Modifiers

### Inline actions

Contained lists can include inline actions, such as closing or dismissing row
items in the list.

<Row>
<Column colLg={8}>

![Contained list inline actions](images/contained-list-usage-7.png)

</Column>
</Row>

### Interactive elements

Contained lists can have interactive elements in headers and rows, such as
links, icon buttons, and toggles.

<Row>
<Column colLg={8}>

![Contained list interactive elements](images/contained-list-usage-8.png)

</Column>
</Row>

### Clickable rows

Contained lists support clickable rows as an optional feature.

<Row>
<Column colLg={8}>

![Contained list clickable rows](images/contained-list-usage-9.png)

</Column>
</Row>

## Related

- [Accordion](https://carbondesignsystem.com/components/accordion/usage/)
- [Data table](https://carbondesignsystem.com/components/data-table/usage/)
- [List](https://carbondesignsystem.com/components/list/usage/)
- [Structured list](https://carbondesignsystem.com/components/structured-list/usage/)

## Feedback

Help us improve this component by providing feedback, asking questions, and
leaving any other comments on
[GitHub](https://github.com/carbon-design-system/carbon-website/issues/new?assignees=&labels=feedback&template=feedback.md).