✨ Announcing our seed funding led by Lux Capital! Read more about it on our blog
DocsBlogChangelog

Search documentation...

/

Star

12k+

[ Learn ]

[ Concepts ]

[ Reference ]

List


There are three types of lists: regular lists, ordered, unordered.
The shorthand syntax used to create a list is by passing in a list of items. These items can be components or Python primitives.
  • Example 1
  • Example 2
  • Example 3
rx.list(
    items=["Example 1", "Example 2", "Example 3"],
    spacing=".25em",
)
The examples below have the explicit syntax of list and list_items. Regular lists are used to display a list of items. They have no bullet points or numbers and stack the list items vertically.
  • Example 1
  • Example 2
  • Example 3
rx.list(
    rx.list_item("Example 1"),
    rx.list_item("Example 2"),
    rx.list_item("Example 3"),
)
Unordered have bullet points to display the list items.
  • Example 1
  • Example 2
  • Example 3
rx.unordered_list(
    rx.list_item("Example 1"),
    rx.list_item("Example 2"),
    rx.list_item("Example 3"),
)
Ordered lists have numbers to display the list items.
  1. Example 1
  2. Example 2
  3. Example 3
rx.ordered_list(
    rx.list_item("Example 1"),
    rx.list_item("Example 2"),
    rx.list_item("Example 3"),
)
Lists can also be used with icons.
  • Allowed
  • Not
  • Settings
rx.list(
    rx.list_item(
        rx.icon(tag="check_circle", color="green"),
        "Allowed",
    ),
    rx.list_item(
        rx.icon(tag="not_allowed", color="red"), "Not"
    ),
    rx.list_item(
        rx.icon(tag="settings", color="grey"), "Settings"
    ),
    spacing=".25em",
)
Lists can also be created with a shorthand syntax. Just pass in a list of items and the list items will be created automatically.

List


Display a list of items.


  • Base Event Triggers

ListItem


A single list item.


  • No props for ListItem.

  • Base Event Triggers

UnorderedList


An unordered list component with bullets.


  • No props for UnorderedList.

  • Base Event Triggers

OrderedList


An ordered list component with numbers.


  • No props for OrderedList.

  • Base Event Triggers

← DataTableStat →

Copyright © 2023 Pynecone, Inc.