# List A list is a component used to organize and display a continuous collection of related items in a structured, scannable format **Category:** Components **Storybook:** https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-list--introduction ## Variants documented in Storybook - ListSizes: https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-list--listsizes - ValidationStates: https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-list--validationstates - SelectionPatterns: https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-list--selectionpatterns - SwitchPatterns: https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-list--switchpatterns ## Framework setup ### HTML / CDN ```html ``` ### React ```bash npm install ux4g-web-components ``` ```jsx import 'ux4g-web-components/styles.css'; import 'ux4g-web-components/design-system'; ``` ### Angular Update `angular.json`: ```json { "styles": [ "node_modules/ux4g-web-components/styles/ux4g.css", "src/styles.css" ], "scripts": [ "node_modules/ux4g-web-components/dist/runtime/design-system.js" ] } ``` ## Code examples The snippets below are extracted from the Storybook canvas for List. Each example shows the rendered HTML, the equivalent React JSX, and the Angular template markup. ### 1. Introduction — Introduction HTML: ```html
A list is a component used to organize and display a continuous collection of related items in a structured, scannable format
Quick reference for essential layout and state classes.
| Class | Usage |
|---|---|
ux4g-list |
Main list container |
ux4g-list-item |
Wrapper for a single list row |
ux4g-list-item-row |
Interactive row content |
ux4g-list-item-start |
Leading content slot |
ux4g-list-item-end |
Trailing content slot |
| Class | Usage |
|---|---|
ux4g-list-s/m/l/xl |
Size variants |
ux4g-list-error |
Error validation state |
ux4g-list-success |
Success validation state |
ux4g-list-warning |
Warning validation state |
active |
Selection highlight state |
A list is a component used to organize and display a continuous collection of related items in a structured, scannable format
Quick reference for essential layout and state classes.
| Class | Usage |
|---|---|
ux4g-list
|
Main list container |
ux4g-list-item
|
Wrapper for a single list row |
ux4g-list-item-row
|
Interactive row content |
ux4g-list-item-start
|
Leading content slot |
ux4g-list-item-end
|
Trailing content slot |
| Class | Usage |
|---|---|
ux4g-list-s/m/l/xl
|
Size variants |
ux4g-list-error
|
Error validation state |
ux4g-list-success
|
Success validation state |
ux4g-list-warning
|
Warning validation state |
active
|
Selection highlight state |
A list is a component used to organize and display a continuous collection of related items in a structured, scannable format
Quick reference for essential layout and state classes.
| Class | Usage |
|---|---|
ux4g-list |
Main list container |
ux4g-list-item |
Wrapper for a single list row |
ux4g-list-item-row |
Interactive row content |
ux4g-list-item-start |
Leading content slot |
ux4g-list-item-end |
Trailing content slot |
| Class | Usage |
|---|---|
ux4g-list-s/m/l/xl |
Size variants |
ux4g-list-error |
Error validation state |
ux4g-list-success |
Success validation state |
ux4g-list-warning |
Warning validation state |
active |
Selection highlight state |