List
Vertical list group with optional interactivity, icons, meta, and avatars.
Overview
The List component is a core building block of the Byteion design system, providing a robust, accessibility-compliant interface for its specific UI capabilities.
Why this exists
Lists organize items vertically in a scannable format. They are the simplest data display structure for menus, settings, and summaries.
Mental model
A list is a vertical sequence of items, each with optional leading icon, primary text, secondary text, and trailing action.
When to use
When not to use
Basic example
The following example demonstrates standard usage, fully compliant with Byteion's token-first approach.
List Variations
Lists present related items in a vertical layout. Use dividers, states, and affordances to guide user interaction.
1. Basic list
Simple vertical list with dividers.
- First item
- Second item
- Third item
2. Interactive / navigational list
Items respond to hover and active states.
3. Icon + meta list
Useful for navigation with item counts.
- Inbox 24
- Starred 3
- Trash 12
4. User / contact list
Display people with identity and context.
-
JD
Admin
Jane Doe
jane@byteion.dev
-
JS
Member
John Smith
john@byteion.dev
5. Selectable list
Enable selection for bulk actions.
- Design system v1
- Components library
- Marketing site
6. Dense / compact variant
Tighter spacing for data-dense interfaces.
- Language English
- Notifications On
- Appearance Light
- Privacy Manage
import { List, ListItem, ListLink } from '@byteion/react';
export default function ListDemo() {
return (
<List className="p-6">
<ListLink href="/inbox" active>Inbox</ListLink>
<ListLink href="/sent" >Sent</ListLink>
<ListLink href="/drafts">Drafts</ListLink>
<ListItem>Spam — disabled</ListItem>
</List>
);
}
<script setup lang="ts">
import { List, ListItem, ListLink } from '@byteion/vue';
</script>
<template>
<List class="p-6">
<ListLink href="/inbox" active>Inbox</ListLink>
<ListLink href="/sent" >Sent</ListLink>
<ListLink href="/drafts">Drafts</ListLink>
<ListItem>Spam — disabled</ListItem>
</List>
</template>
Variants
Each variant communicates a different meaning. Choose based on priority, not aesthetics.
Single default variant.
Sizes
Size should match the importance and context of the component.
- md — md size.
States
This component reacts seamlessly to the following interaction and data states:
- default — Resting appearance before interaction.
- hover — Pointer is over the element — visual feedback via color or shadow.
- active — Currently selected or in use.
- focus — Keyboard or tab focus — shows ring indicator for accessibility.
- disabled — Non-interactive — grayed out, cursor not-allowed.
Anatomy
Usage guidelines
- Keep items to one line when possible.
- Use dividers between items.
- Leading icons should be consistent.
Do and Don't
Do
- Use dividers.
- Keep items scannable.
- Use consistent leading icons.
Don't
- Do not use for multi-column data.
- Do not omit dividers in bordered lists.
- Do not mix item layouts randomly.
Accessibility
Interactive items should be links or buttons. List container is a <ul> or <ol>.
Role:list (implicit via )
Customization
Border and hover follow list tokens.
Compose with React cva()
Use the exportedcva() +cn() utilities to compose your own variant on top of the Byteion tokens.
import { cva, cn, type VariantProps } from '@byteion/react';
const myList = cva('base classes…', {
variants: {
accent: { soft:'border-primary-200', loud:'border-primary-500' },
},
defaultVariants: { accent:'soft' },
});
type Props = React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof myList>;
Compose with Vue cva()
Use the exportedcva() +cn() utilities inside standard Vue setup blocks.
<script setup lang="ts">
import { computed, useAttrs } from 'vue';
import { cva, type VariantProps } from '@byteion/vue';
interface Props { accent?:'soft' |'loud' }
const props = withDefaults(defineProps<Props>(), { accent:'soft' });
const attrs = useAttrs();
const myList = cva('base classes…', {
variants: { accent: { soft:'border-primary-200', loud:'border-primary-500' } },
});
const cls = computed(() => myList({ accent: props.accent, class: attrs.class as string | undefined }));
</script>
Runtime events
Byteion keeps framework APIs idiomatic: HTML uses DOM custom events, React uses callback props, and Vue uses emitted events / v-model updates.
HTML / JS events
No HTML runtime events are declared by this adapter.
React callbacks
No React callback events are declared by this adapter.
Vue emits
No Vue emitted events are declared by this adapter.
Remote / AJAX
This component does not implement Byteion JS remote loading. Use normal HTML form submission, framework state, or your application data layer around it.
API Reference
Static HTML composition.
HTML Data Attributes
No custom data attributes required.
React Props · ListProps
Extracted directly fromreact/src/components/List.tsx.
export interface ListProps extends HTMLAttributes<HTMLUListElement> {
/** Render items inline as `<a>` for navigation lists. */
interactive?: boolean;
/** Dense spacing for compact interfaces. */
dense?: boolean;
children?: ReactNode;
}
Developer tips
Common mistakes
- Using List for tabular data.
- Mixing unrelated row layouts.
- Making only a small text link clickable.
- Forgetting semantic
<li>elements. - Using icons without consistent meaning.
- Hiding important metadata like timestamp or status.
- Putting too many actions in one row.
- Forgetting empty or loading states.
- Using raw colours instead of tokens.
Production usage tips
- Test empty list, one item, many items, long labels, long secondary text, and missing avatars.
- Test keyboard focus for interactive rows.
- Test active state in light mode, dark mode, and branded themes.
- For Laravel or server-rendered apps, use normal links or forms for interactive rows.
- For React or Vue SPAs, use router links for navigation rows and buttons for action rows.
- For notification or activity lists, coordinate List with Badge, Avatar, Dropdown, Empty state, and Skeleton.
- For large datasets, avoid rendering thousands of list items without pagination or virtualisation.
Premium examples
Advanced patterns available in Byteion Pro:
Related components
- Table — multi-column data
- Card — richer item summaries
- Accordion — expandable items
- Dropdown — floating action menus
- Avatar — user identity in list rows
- Badge — inline status or count
- Button — trailing actions
- Empty state — no items state
- Skeleton — list loading placeholder
- Pagination — large list navigation
Unlock Premium Patterns
Get access to copy-paste ready Pro blocks, SaaS templates, and advanced data-tables built with this component.
Explore Pro Components