List

List is used to display list items. It renders a <ul> element by default.

Source@chakra-ui/react

Import#

import { List } from '@chakra-ui/react'

Unordered List#

<List.Root>
<List.Item>Lorem ipsum dolor sit amet</List.Item>
<List.Item>Consectetur adipiscing elit</List.Item>
<List.Item>Integer molestie lorem at massa</List.Item>
<List.Item>Facilisis in pretium nisl aliquet</List.Item>
</List.Root>

Ordered List#

<List.Root>
<List.Item>Lorem ipsum dolor sit amet</List.Item>
<List.Item>Consectetur adipiscing elit</List.Item>
<List.Item>Integer molestie lorem at massa</List.Item>
<List.Item>Facilisis in pretium nisl aliquet</List.Item>
</List.Root>

Unstyled List with icon#

Add icons to the list items by using the ListIcon component. You can pass the name of the icon or use custom icons. The size of the icon is relative to the font size of the list item.

<List.Root gap={3}>
<List.Item>
<ListIcon as={MdCheckCircle} color='green.500' />
Lorem ipsum dolor sit amet, consectetur adipisicing elit
</List.Item>
<List.Item>
<ListIcon as={MdCheckCircle} color='green.500' />
Assumenda, quia temporibus eveniet a libero incidunt suscipit
</List.Item>
<List.Item>
<ListIcon as={MdCheckCircle} color='green.500' />
Quidem, ipsam illum quis sed voluptatum quae eum fugit earum
</List.Item>
{/* You can also use custom icons from react-icons */}
<List.Item>
<ListIcon as={MdSettings} color='green.500' />
Quidem, ipsam illum quis sed voluptatum quae eum fugit earum
</List.Item>
</List.Root>
Edit this page on GitHub

Proudly made inNigeria by Segun Adebayo

Deployed by â–² Vercel