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><QListItemdescription="Description"label="Label"secondaryText="Seconday Text"/><QListItemdescription="Description"label="Label"secondaryText="Seconday Text"/><QListItemdescription="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><QListItemdescription="Description"label="Start Icon"secondaryText="Secondary Text"startIcon={Box}/><QListItemdescription="Description"endIcon={ChevronRight}label="End Icon"secondaryText="Secondary Text"/><QListItemdescription="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"><QListItemdescription="Description"label="Label"secondaryText="Seconday Text"startIcon={Box}/><QListItemdescription="Description"label="Label"secondaryText="Seconday Text"startIcon={Box}/><QListItemdescription="Description"label="Label"secondaryText="Seconday Text"startIcon={Box}/></QList><QList size="m"><QListItemdescription="Description"label="Label"secondaryText="Seconday Text"startIcon={Box}/><QListItemdescription="Description"label="Label"secondaryText="Seconday Text"startIcon={Box}/><QListItemdescription="Description"label="Label"secondaryText="Seconday Text"startIcon={Box}/></QList><QList size="l"><QListItemdescription="Description"label="Label"secondaryText="Seconday Text"startIcon={Box}/><QListItemdescription="Description"label="Label"secondaryText="Seconday Text"startIcon={Box}/><QListItemdescription="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><QListItemlabel="Label"secondaryText="Seconday Text"startContent={<QAvatar color="brand" content="QC" />}/><QListItemdescription="Description"endContent={<div className="flex items-center"><QBadge color="informative">Badge</QBadge></div>}label="Label"/><QListItemdescription="Description"disabledlabel="Label"secondaryText="Secondary Text"/></QList></div>)}
API – List Item
Input
Name & Description | Option(s) | Default |
---|---|---|
The component used for the root node. It can be a React component or
element. |
| 'div' |
The className property of the Element
interface gets and sets the value of the
class attribute
of the specified element. |
| |
Optional description text shown below the label. | ReactNode | |
If true, the item is disabled. |
| 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. |
| |
If true, the bottom separator is hidden. |
| |
HTML id attribute, applied to the root element. |
| |
Label text – the list item's primary message. | ReactNode | |
| '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 |
| |
Optional template content, placed at the start of the list item. | ReactNode | |
lucide-react icon, positioned before the label. |
| |
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
ReactNode
Description
Optional description text shown below the label.
Type
boolean
Default
false
Description
If true, the item is disabled.
Type
ReactNode
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.
Type
ReactNode
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
Type
ReactNode
Description
Optional template content, placed at the start of the list item.
Type
| LucideIcon| ReactNode
Description
lucide-react icon, positioned before the label.
Type
CSSProperties
Description
The style global attribute
contains CSS styling
declarations to be applied to the element.
API – List
Input
Name & Description | Option(s) | Default |
---|---|---|
The component used for the root node. It can be a React component or
element. |
| 'div' |
The className property of the Element
interface gets and sets the value of the
class attribute
of the specified element. |
| |
| '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. |
| '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
| '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.
Type
CSSProperties
Description
The style global attribute
contains CSS styling
declarations to be applied to the element.