Roadmap UIRoadmap UI

List

List views are a great way to show a list of tasks grouped by status and ranked by priority.

Planned

AI Scene Analysis

Al

Real-time Video Chat

Di

AI-Assisted Video Transitions

Ge

Multi-User Permissions

Ju

AI Scene Recommendations

Mi

Global CDN Integration

Pe

AI-Powered Video Summarization

Sa

In Progress

Collaborative Editing

Bo

AI Voice-to-Text Subtitles

Et

Version Control System

Ha

AI-Powered Audio Enhancement

Ke

Collaborative Storyboarding

Na

AI Object Tracking

Qu

Blockchain-based Asset Licensing

To

Done

AI-Powered Color Grading

Ch

Cloud Asset Management

Fi

AI Content-Aware Fill

Ia

Real-time Project Analytics

La

AI-Driven Video Compression

Os

Real-time Language Translation

Ra

Installation

npx roadmap-ui add list

Features

  • Drag and drop items between groups
  • Customize the item contents

Code

list.tsx
'use client';
 
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
import { exampleFeatures, exampleStatuses } from '@/lib/content';
import {
  ListGroup,
  ListHeader,
  ListItem,
  ListItems,
  ListProvider,
} from '@/components/roadmap-ui/list';
import type { DragEndEvent } from '@dnd-kit/core';
import { type FC, useState } from 'react';
 
export const ListExample: FC = () => {
  const [features, setFeatures] = useState(exampleFeatures);
 
  const handleDragEnd = (event: DragEndEvent) => {
    const { active, over } = event;
 
    if (!over) {
      return;
    }
 
    const status = exampleStatuses.find((status) => status.name === over.id);
 
    if (!status) {
      return;
    }
 
    setFeatures(
      features.map((feature) => {
        if (feature.id === active.id) {
          return { ...feature, status };
        }
 
        return feature;
      })
    );
  };
 
  return (
    <ListProvider onDragEnd={handleDragEnd}>
      {exampleStatuses.map((status) => (
        <ListGroup key={status.name} id={status.name}>
          <ListHeader name={status.name} color={status.color} />
          <ListItems>
            {features
              .filter((feature) => feature.status.name === status.name)
              .map((feature, index) => (
                <ListItem
                  key={feature.id}
                  id={feature.id}
                  name={feature.name}
                  parent={feature.status.name}
                  index={index}
                >
                  <div
                    className="h-2 w-2 shrink-0 rounded-full"
                    style={{ backgroundColor: feature.status.color }}
                  />
                  <p className="m-0 flex-1 font-medium text-sm">
                    {feature.name}
                  </p>
                  {feature.owner && (
                    <Avatar className="h-4 w-4 shrink-0">
                      <AvatarImage src={feature.owner.image} />
                      <AvatarFallback>
                        {feature.owner.name?.slice(0, 2)}
                      </AvatarFallback>
                    </Avatar>
                  )}
                </ListItem>
              ))}
          </ListItems>
        </ListGroup>
      ))}
    </ListProvider>
  );
};

Subcomponents

The list view is made up of the following subcomponents:

ListProvider

The ListProvider component is used to provide the features to the list.

PropTypeDefault
children
ReactNode
-
onDragEnd
(event: DragEndEvent) => void
-
className
string
-

ListGroup

The ListGroup component is used to display a group of items.

PropTypeDefault
id
string
-
children
ReactNode
-
className
string
-

ListHeader

The ListHeader component is used to display the header of a group.

PropTypeDefault

ListItems

The ListItems component is used to display the items of a group.

PropTypeDefault
children
ReactNode
-
className
string
-

ListItem

The ListItem component is used to display an item.

PropTypeDefault
id
string
-
name
string
-
index
number
-
parent
string
-
children
ReactNode
-
className
string
-

On this page