List
Lists are structured collections of text and images, presented in a vertical format, typically with individual items and potential actions associated with each.
Basic
Container Dangerous
Container Dry
Container Flatrack
Container Tank
Crane Container
Source Code
import { List, ListItem, ListItemText } from '@ocean-network-express/magenta-ui/react';
import * as React from 'react';
import { mockListItems } from '../../utils/List/helpers';
export function ListBasic() {
return (
<List>
{mockListItems.map((item, index) => {
return (
<ListItem key={item.title + index}>
<ListItemText primaryText={item.title}></ListItemText>Sizes
- List supports 4 sizes
sm,md,lgandresponsiveand can be changed by passing thesizeprop. - Default size is
lg.
Container Dangerous
This following list includes such commodities as propane gas lighters, ordinary wall paint, and more.
Container Dry
This type of container is for general cargo. General cargo should not be over-length or in bulk.
Container Flatrack
Flat racks are best suited for stowage of heavy lift, over-height and/or over-width cargo.
Container Tank
A tank container or tanktainer is an intermodal container for the transport of liquids as bulk cargo.
Crane Container
Crane Container provides basic port crane products include Rail Mounted Container Gantry Crane, etc.
Container Dangerous
This following list includes such commodities as propane gas lighters, ordinary wall paint, and more.
Container Dry
This type of container is for general cargo. General cargo should not be over-length or in bulk.
Container Flatrack
Flat racks are best suited for stowage of heavy lift, over-height and/or over-width cargo.
Container Tank
A tank container or tanktainer is an intermodal container for the transport of liquids as bulk cargo.
Crane Container
Crane Container provides basic port crane products include Rail Mounted Container Gantry Crane, etc.
Container Dangerous
This following list includes such commodities as propane gas lighters, ordinary wall paint, and more.
Container Dry
This type of container is for general cargo. General cargo should not be over-length or in bulk.
Container Flatrack
Flat racks are best suited for stowage of heavy lift, over-height and/or over-width cargo.
Container Tank
A tank container or tanktainer is an intermodal container for the transport of liquids as bulk cargo.
Crane Container
Crane Container provides basic port crane products include Rail Mounted Container Gantry Crane, etc.
Source Code
import { List, ListItem, ListItemText } from '@ocean-network-express/magenta-ui/react';
import { mockListItems } from '../../utils/List/helpers';
export function ListSizes() {
return (
<div className="grid grid-cols-3 gap-6">
{[{ size: 'sm' }, { size: 'md' }, { size: 'lg' }].map(({ size }) => (
<List size={size as 'sm' | 'md' | 'lg'}>
{mockListItems.map((item, index) => {
return (
<ListItem key={item.title + index}>- With size
responsive, the component will be responsive to the viewport.
Screen prefix | Screen width | Component size |
|---|---|---|
xs → xl | 0px → 1279px | sm |
xl → 3xl | 1280px → 1919px | md |
3xl → ∞ | 1920px → ∞ | lg |
Container Dangerous
This following list includes such commodities as propane gas lighters, ordinary wall paint, and more.
Container Dry
This type of container is for general cargo. General cargo should not be over-length or in bulk.
Container Flatrack
Flat racks are best suited for stowage of heavy lift, over-height and/or over-width cargo.
Container Tank
A tank container or tanktainer is an intermodal container for the transport of liquids as bulk cargo.
Crane Container
Crane Container provides basic port crane products include Rail Mounted Container Gantry Crane, etc.
Source Code
import { List, ListItem, ListItemText } from '@ocean-network-express/magenta-ui/react';
import { mockListItems } from '../../utils/List/helpers';
export function ListSizeResponsive() {
return (
<List size="responsive">
{mockListItems.map((item, index) => {
return (
<ListItem key={item.title + index}>
<ListItemText primaryText={item.title} secondaryText={item.subtitle} />
</ListItem>With Icons
- We supports icons from the
@ocean-network-express/magenta-ui/iconspackage.
Container Dangerous
This following list includes such commodities as propane gas lighters, ordinary wall paint, and more.
Container Dry
This type of container is for general cargo. General cargo should not be over-length or in bulk.
Container Flatrack
Flat racks are best suited for stowage of heavy lift, over-height and/or over-width cargo.
Container Tank
A tank container or tanktainer is an intermodal container for the transport of liquids as bulk cargo.
Crane Container
Crane Container provides basic port crane products include Rail Mounted Container Gantry Crane, etc.
Source Code
import { AddCircleOutline } from '@ocean-network-express/magenta-ui/icons';
import {
List,
ListItem,
ListItemIcon,
ListItemText,
} from '@ocean-network-express/magenta-ui/react';
import * as React from 'react';
import { mockListItems } from '../../utils/List/helpers';
export function ListWithIcons() {Interactive
- Below is an interactive demo that lets you explore the visual results of the different props:
Source Code
import {
Checkbox,
List,
ListItem,
ListItemIcon,
ListItemText,
} from '@ocean-network-express/magenta-ui/react';
import { mockListItems } from '../../utils/List/helpers';
export function ListInteractive() {
return (Selected ListItem
- You can set a
ListItemas selected by passing theselectedprop.
Source Code
import {
List,
ListItem,
ListItemIcon,
ListItemText,
} from '@ocean-network-express/magenta-ui/react';
import * as React from 'react';
import { mockListItemsTwo } from '../../utils/List/helpers';
export function ListSelectedListItem() {
const [selected, setSelected] = React.useState<string>();Active ListItem
- You can set a
ListItemas active by passing theactiveprop.
Source Code
import {
List,
ListItem,
ListItemIcon,
ListItemText,
} from '@ocean-network-express/magenta-ui/react';
import * as React from 'react';
import { mockListItemsTwo } from '../../utils/List/helpers';
export function ListItemActive() {
const [selected, setSelected] = React.useState<string>();Grouped list
- Group header level 1
- Group header level 2 A
- Group header level 2 B
Source Code
import {
List,
ListItem,
ListItemIcon,
ListItemText,
ListSubheader,
} from '@ocean-network-express/magenta-ui/react';
import * as React from 'react';
import { mockListItems } from '../../utils/List/helpers';
export function ListGrouped() {List control
ListItemcould using along withCheckboxcomponent, see example below:
Source Code
import {
Avatar,
Checkbox,
List,
ListItem,
ListItemIcon,
ListItemText,
} from '@ocean-network-express/magenta-ui/react';
import * as React from 'react';
import { mockListItems } from '../../utils/List/helpers';
Disabled
- Disabled state can be enabled by setting
disabledprop totrue.
Source Code
import {
List,
ListItem,
ListItemIcon,
ListItemText,
} from '@ocean-network-express/magenta-ui/react';
import { mockListItems } from '../../utils/List/helpers';
export function ListDisabled() {
return (
<div className="grid grid-cols-2 gap-6">List Empty
Source Code
import { List, ListEmpty as MagentaListEmpty } from '@ocean-network-express/magenta-ui/react';
export function ListEmpty() {
return (
<List>
<MagentaListEmpty text="Empty" />
</List>
);
}
List Loading
Source Code
import { List, ListLoading as MagentaListLoading } from '@ocean-network-express/magenta-ui/react';
export function ListLoading() {
return (
<List>
<MagentaListLoading text="Loading" />
</List>
);
}
Was this page helpful?
List
Item List
ListView