Hone UI
Components

List

Vertical lists of text, icons, avatars and actions.

List shows a column of items. ListItemButton makes a row pressable. ListItemText, ListItemIcon and ListItemAvatar fill a row, and ListSubheader titles a group.

import List from '@hone-ui/react/List';
import ListItem from '@hone-ui/react/ListItem';
import ListItemButton from '@hone-ui/react/ListItemButton';
import ListItemText from '@hone-ui/react/ListItemText';
import ListItemIcon from '@hone-ui/react/ListItemIcon';
import ListItemAvatar from '@hone-ui/react/ListItemAvatar';
import ListSubheader from '@hone-ui/react/ListSubheader';

Examples

  • Mail
  • A
    AdaOnline
<List subheader={<ListSubheader>Mail</ListSubheader>} sx={{ width: 280 }}>
  <ListItem disablePadding>
    <ListItemButton selected>
      <ListItemText primary="Inbox" secondary="3 new" />
    </ListItemButton>
  </ListItem>
  <ListItem disablePadding>
    <ListItemButton>
      <ListItemText primary="Drafts" />
    </ListItemButton>
  </ListItem>
  <ListItem>
    <ListItemAvatar>
      <Avatar>A</Avatar>
    </ListItemAvatar>
    <ListItemText primary="Ada" secondary="Online" />
  </ListItem>
</List>

Props

ComponentProps
Listdense (false), disablePadding (false), subheader, component ('ul')
ListItemalignItems ('center'), dense, disableGutters, disablePadding, divider, secondaryAction, component ('li')
ListItemButtonselected, dense, disableGutters, divider, alignItems, autoFocus, disabled, href, onClick(event)
ListItemTextprimary, secondary, inset, disableTypography, slotProps.primary, slotProps.secondary
ListItemIconchildren: an icon
ListItemAvatarchildren: an Avatar
ListSubheadercolor ('default', 'primary', 'inherit'), disableGutters, disableSticky, inset, component ('li')

Every part takes sx, className, style, ref and the HTML props of its element.

Notes

  • All parts except ListItemButton are Server Components and ignore theme defaultProps.
  • ListItemText slotProps.primary and slotProps.secondary take Typography props, such as component, variant and color.
  • dense on List tightens every item through CSS.
  • ListItem's button prop and ListItemSecondaryAction are not supported. Use ListItemButton and secondaryAction.

Accessibility

List renders ul and li elements. ListItemButton is a button, or an a with href. A selected link row gets aria-current="page".

On this page