React Lists - Flowbite
Use the list component to show an unordered or ordered list of items based on multiple styles, layouts, and variants built with Tailwind CSS and Flowbite
Get started with a collection of list components built with Tailwind CSS for ordered and unordered lists with bullets, numbers, or icons and other styles and layouts to show a list of items inside an article or throughout your web page.
Start using the list component by first importing it from Flowbite React:
import { List } from "flowbite-react";
#
Default listUse this example to create a default unordered list of items using the List
component with List.Item
child components inside of it.
- At least 10 characters (and up to 100 characters)
- At least one lowercase character
- Inclusion of at least one special character, e.g., ! @ # ?
import { List, ListItem } from "flowbite-react"; export function Component() { return ( <List> <ListItem>At least 10 characters (and up to 100 characters)</ListItem> <ListItem>At least one lowercase character</ListItem> <ListItem>Inclusion of at least one special character, e.g., ! @ # ?</ListItem> </List> ); }
#
IconsThis example can be used to apply custom icons instead of the default bullets for the list items.
- At least 10 characters (and up to 100 characters)
- At least one lowercase character
- Inclusion of at least one special character, e.g., ! @ # ?
"use client"; import { List, ListItem } from "flowbite-react"; import { HiCheckCircle } from "react-icons/hi"; export function Component() { return ( <List> <ListItem icon={HiCheckCircle}>At least 10 characters (and up to 100 characters)</ListItem> <ListItem icon={HiCheckCircle}>At least one lowercase character</ListItem> <ListItem icon={HiCheckCircle}>Inclusion of at least one special character, e.g., ! @ # ?</ListItem> </List> ); }
#
NestedUse this example to nest another list of items inside the parent list element.
- List item one
- You might feel like you are being really "organized" o
- Nested navigation in UIs is a bad idea too, keep things as flat as possible.
- Nesting tons of folders in your source code is also not helpful.
- List item two
- I'm not sure if we'll bother styling more than two levels deep.
- Two is already too much, three is guaranteed to be a bad idea.
- If you nest four levels deep you belong in prison.
- List item three
- Again please don't nest lists if you want
- Nobody wants to look at this.
- I'm upset that we even have to bother styling this.
import { List, ListItem } from "flowbite-react"; export function Component() { return ( <List> <ListItem> List item one <List ordered nested> <ListItem>You might feel like you are being really "organized" o</ListItem> <ListItem>Nested navigation in UIs is a bad idea too, keep things as flat as possible.</ListItem> <ListItem>Nesting tons of folders in your source code is also not helpful.</ListItem> </List> </ListItem> <ListItem> List item two <List ordered nested> <ListItem>I'm not sure if we'll bother styling more than two levels deep.</ListItem> <ListItem>Two is already too much, three is guaranteed to be a bad idea.</ListItem> <ListItem>If you nest four levels deep you belong in prison.</ListItem> </List> </ListItem> <ListItem> List item three <List ordered nested> <ListItem>Again please don't nest lists if you want</ListItem> <ListItem>Nobody wants to look at this.</ListItem> <ListItem>I'm upset that we even have to bother styling this.</ListItem> </List> </ListItem> </List> ); }
#
UnstyledUse the unstyled
prop to disable the list style bullets or numbers.
- At least 10 characters (and up to 100 characters)
- At least one lowercase character
- Inclusion of at least one special character, e.g., ! @ # ?
import { List, ListItem } from "flowbite-react"; export function Component() { return ( <List unstyled> <ListItem>At least 10 characters (and up to 100 characters)</ListItem> <ListItem>At least one lowercase character</ListItem> <ListItem>Inclusion of at least one special character, e.g., ! @ # ?</ListItem> </List> ); }
#
Ordered listUse the ordered
prop tag to create an ordered list of items with numbers.
- At least 10 characters (and up to 100 characters)
- At least one lowercase character
- Inclusion of at least one special character, e.g., ! @ # ?
import { List, ListItem } from "flowbite-react"; export function Component() { return ( <List ordered> <ListItem>At least 10 characters (and up to 100 characters)</ListItem> <ListItem>At least one lowercase character</ListItem> <ListItem>Inclusion of at least one special character, e.g., ! @ # ?</ListItem> </List> ); }
#
Advanced layoutThis example can be used to show more details for each list item such as the user's name, email and profile picture.
import { Avatar, List, ListItem } from "flowbite-react"; export function Component() { return ( <List unstyled className="max-w-md divide-y divide-gray-200 dark:divide-gray-700"> <ListItem className="pb-3 sm:pb-4"> <div className="flex items-center space-x-4 rtl:space-x-reverse"> <Avatar img="/images/people/profile-picture-1.jpg" alt="Neil image" rounded size="sm" /> <div className="min-w-0 flex-1"> <p className="truncate text-sm font-medium text-gray-900 dark:text-white">Neil Sims</p> <p className="truncate text-sm text-gray-500 dark:text-gray-400">[email protected]</p> </div> <div className="inline-flex items-center text-base font-semibold text-gray-900 dark:text-white">$320</div> </div> </ListItem> <ListItem className="py-3 sm:py-4"> <div className="flex items-center space-x-4 rtl:space-x-reverse"> <Avatar img="/images/people/profile-picture-3.jpg" alt="Neil image" rounded size="sm" /> <div className="min-w-0 flex-1"> <p className="truncate text-sm font-medium text-gray-900 dark:text-white">Bonnie Green</p> <p className="truncate text-sm text-gray-500 dark:text-gray-400">[email protected]</p> </div> <div className="inline-flex items-center text-base font-semibold text-gray-900 dark:text-white">$3467</div> </div> </ListItem> <ListItem className="py-3 sm:py-4"> <div className="flex items-center space-x-4 rtl:space-x-reverse"> <Avatar img="/images/people/profile-picture-2.jpg" alt="Neil image" rounded size="sm" /> <div className="min-w-0 flex-1"> <p className="truncate text-sm font-medium text-gray-900 dark:text-white">Michael Gough</p> <p className="truncate text-sm text-gray-500 dark:text-gray-400">[email protected]</p> </div> <div className="inline-flex items-center text-base font-semibold text-gray-900 dark:text-white">$67</div> </div> </ListItem> <ListItem className="py-3 sm:py-4"> <div className="flex items-center space-x-4 rtl:space-x-reverse"> <Avatar img="/images/people/profile-picture-5.jpg" alt="Neil image" rounded size="sm" /> <div className="min-w-0 flex-1"> <p className="truncate text-sm font-medium text-gray-900 dark:text-white">Thomas Lean</p> <p className="truncate text-sm text-gray-500 dark:text-gray-400">[email protected]</p> </div> <div className="inline-flex items-center text-base font-semibold text-gray-900 dark:text-white">$2367</div> </div> </ListItem> <ListItem className="pb-0 pt-3 sm:pt-4"> <div className="flex items-center space-x-4 rtl:space-x-reverse"> <Avatar img="/images/people/profile-picture-4.jpg" alt="Neil image" rounded size="sm" /> <div className="min-w-0 flex-1"> <p className="truncate text-sm font-medium text-gray-900 dark:text-white">Lana Byrd</p> <p className="truncate text-sm text-gray-500 dark:text-gray-400">[email protected]</p> </div> <div className="inline-flex items-center text-base font-semibold text-gray-900 dark:text-white">$367</div> </div> </ListItem> </List> ); }
#
Horizontal listUse this example to create a horizontally aligned list of items.
- About
- Premium
- Campaigns
- Blog
- Affiliate Program
- FAQs
- Contact
import { List, ListItem } from "flowbite-react"; export function Component() { return ( <List horizontal> <ListItem>About</ListItem> <ListItem>Premium</ListItem> <ListItem>Campaigns</ListItem> <ListItem>Blog</ListItem> <ListItem>Affiliate Program</ListItem> <ListItem>FAQs</ListItem> <ListItem>Contact</ListItem> </List> ); }
#
ThemeTo learn more about how to customize the appearance of components, please see the Theme docs.
{ "root": { "base": "list-inside space-y-1 text-gray-500 dark:text-gray-400", "ordered": { "off": "list-disc", "on": "list-decimal" }, "horizontal": "flex list-none flex-wrap items-center justify-center space-x-4 space-y-0", "unstyled": "list-none", "nested": "mt-2 ps-5" }, "item": { "withIcon": { "off": "", "on": "flex items-center" }, "icon": "me-2 h-3.5 w-3.5 shrink-0" } }