QUI React

List

Lists are continuous, vertical indices of text or images.

import {QList, QListItem} from "@qui/react"

Examples

Showcase

Use the label, description, and secondaryText properties to customize each item. Should you need more control over the rendered content, you can provide a ReactNode instead of a string.

LabelDescription
Seconday Text
LabelDescription
Seconday Text
LabelDescription
Seconday Text
import {ReactNode} from "react"
import {QList, QListItem} from "@qui/react"
export default function Showcase(): ReactNode {
return (
<div className="grid justify-center gap-4">
<QList>
<QListItem
description="Description"
label="Label"
secondaryText="Seconday Text"
/>
<QListItem
description="Description"
label="Label"
secondaryText="Seconday Text"
/>
<QListItem
description="Description"
label="Label"
secondaryText="Seconday Text"
/>
</QList>
</div>
)
}

Icons

Icons are available via the startIcon and endIcon properties.

Start IconDescription
Secondary Text
End IconDescription
Secondary Text
Both IconsDescription
Secondary Text
import {ReactNode} from "react"
import {Box, ChevronRight} from "lucide-react"
import {QList, QListItem} from "@qui/react"
export default function Icons(): ReactNode {
return (
<div className="grid justify-center gap-4">
<QList>
<QListItem
description="Description"
label="Start Icon"
secondaryText="Secondary Text"
startIcon={Box}
/>
<QListItem
description="Description"
endIcon={ChevronRight}
label="End Icon"
secondaryText="Secondary Text"
/>
<QListItem
description="Description"
endIcon={ChevronRight}
label="Both Icons"
secondaryText="Secondary Text"
startIcon={Box}
/>
</QList>
</div>
)
}

Sizes

Use the size property to adjust the padding and font size of text elements.

LabelDescription
Seconday Text
LabelDescription
Seconday Text
LabelDescription
Seconday Text
LabelDescription
Seconday Text
LabelDescription
Seconday Text
LabelDescription
Seconday Text
LabelDescription
Seconday Text
LabelDescription
Seconday Text
LabelDescription
Seconday Text
import {ReactNode} from "react"
import {Box} from "lucide-react"
import {QList, QListItem} from "@qui/react"
export default function Sizes(): ReactNode {
return (
<div className="grid justify-center gap-4">
<QList size="s">
<QListItem
description="Description"
label="Label"
secondaryText="Seconday Text"
startIcon={Box}
/>
<QListItem
description="Description"
label="Label"
secondaryText="Seconday Text"
startIcon={Box}
/>
<QListItem
description="Description"
label="Label"
secondaryText="Seconday Text"
startIcon={Box}
/>
</QList>
<QList size="m">
<QListItem
description="Description"
label="Label"
secondaryText="Seconday Text"
startIcon={Box}
/>
<QListItem
description="Description"
label="Label"
secondaryText="Seconday Text"
startIcon={Box}
/>
<QListItem
description="Description"
label="Label"
secondaryText="Seconday Text"
startIcon={Box}
/>
</QList>
<QList size="l">
<QListItem
description="Description"
label="Label"
secondaryText="Seconday Text"
startIcon={Box}
/>
<QListItem
description="Description"
label="Label"
secondaryText="Seconday Text"
startIcon={Box}
/>
<QListItem
description="Description"
label="Label"
secondaryText="Seconday Text"
startIcon={Box}
/>
</QList>
</div>
)
}

Content Customization

Should you need to render dynamic content, supply ReactNode to the startContent and endContent properties.

Label
Seconday Text
LabelDescription
Badge
LabelDescription
Secondary Text
import {ReactNode} from "react"
import {QAvatar, QBadge, QList, QListItem} from "@qui/react"
export default function Sizes(): ReactNode {
return (
<div className="grid justify-center gap-4">
<QList>
<QListItem
label="Label"
secondaryText="Seconday Text"
startContent={<QAvatar color="brand" content="QC" />}
/>
<QListItem
description="Description"
endContent={
<div className="flex items-center">
<QBadge color="informative">Badge</QBadge>
</div>
}
label="Label"
/>
<QListItem
description="Description"
disabled
label="Label"
secondaryText="Secondary Text"
/>
</QList>
</div>
)
}

API – List Item

Input

Name & DescriptionOption(s)Default
The component used for the root node. It can be a React component or element.
| ElementType
| ComponentType
'div'
The className property of the Element interface gets and sets the value of the class attribute of the specified element.
string
Optional description text shown below the label.
ReactNode
If true, the item is disabled.
boolean
false
Optional template content, placed at the right end of the list item.
ReactNode
lucide-react icon, positioned at the far end of the list item.
| LucideIcon
| ReactNode
If true, the bottom separator is hidden.
boolean
HTML id attribute, applied to the root element.
string
Label text – the list item's primary message.
ReactNode
HTML role attribute applied to the root element.
string
'listitem'
Label rendered at the far end of the list item, opposite of the label and description.
ReactNode
The size of the list item and its contents. This value overrides the list size if defined
| 's'
| 'm'
| 'l'
Optional template content, placed at the start of the list item.
ReactNode
lucide-react icon, positioned before the label.
| LucideIcon
| ReactNode
The style global attribute contains CSS styling declarations to be applied to the element.
CSSProperties
Type
| ElementType
| ComponentType
Default
'div'
Description
The component used for the root node. It can be a React component or element.
Type
string
Description
The className property of the Element interface gets and sets the value of the class attribute of the specified element.
Description
Optional description text shown below the label.
Type
boolean
Default
false
Description
If true, the item is disabled.
Description
Optional template content, placed at the right end of the list item.
Type
| LucideIcon
| ReactNode
Description
lucide-react icon, positioned at the far end of the list item.
Type
boolean
Description
If true, the bottom separator is hidden.
Type
string
Description
HTML id attribute, applied to the root element.
Description
Label text – the list item's primary message.
Type
string
Default
'listitem'
Description
HTML role attribute applied to the root element.
Description
Label rendered at the far end of the list item, opposite of the label and description.
Type
| 's'
| 'm'
| 'l'
Description
The size of the list item and its contents. This value overrides the list size if defined
Description
Optional template content, placed at the start of the list item.
Type
| LucideIcon
| ReactNode
Description
lucide-react icon, positioned before the label.
Description
The style global attribute contains CSS styling declarations to be applied to the element.

API – List

Input

Name & DescriptionOption(s)Default
The component used for the root node. It can be a React component or element.
| ElementType
| ComponentType
'div'
The className property of the Element interface gets and sets the value of the class attribute of the specified element.
string
HTML role attribute applied to the root element.
string
'list'
Applies a default size to each list item in this list. Note that each list item's size, if configured, will override this value.
| 's'
| 'm'
| 'l'
'm'
The style global attribute contains CSS styling declarations to be applied to the element.
CSSProperties
Type
| ElementType
| ComponentType
Default
'div'
Description
The component used for the root node. It can be a React component or element.
Type
string
Description
The className property of the Element interface gets and sets the value of the class attribute of the specified element.
Type
string
Default
'list'
Description
HTML role attribute applied to the root element.
Type
| 's'
| 'm'
| 'l'
Default
'm'
Description
Applies a default size to each list item in this list. Note that each list item's size, if configured, will override this value.
Description
The style global attribute contains CSS styling declarations to be applied to the element.