项目作者: adamwattis

项目描述 :
Extension to MUI's ListItem, adding an overline text as well as option for two action items inside a ListItem.
高级语言: JavaScript
项目地址: git://github.com/adamwattis/mui-listitem-extended.git
创建时间: 2021-09-21T18:27:38Z
项目社区:https://github.com/adamwattis/mui-listitem-extended

开源协议:

下载


mui-listitem-extended 🪜

Tests

Helper components to extend the functionality of MUI’s ListItem

  • Works with MUI Material-UI
  • Add Overline text to a ListItem
  • Add two components to ListItemSecondaryAction

Installation and use

Install in your React app:

  1. npm install mui-listitem-extended

Import the extended components:

  1. import { ListItemTextExtended, ListItemSecondaryActionExtended } from 'mui-listitem-extended'

You can then use the components exactly the same as you would the regular ListItemTest and ListItemSecondaryAction components - with the added benefit of having a third, Overline text field, and room for two actions (IconButton, Switch, etc.):

  1. <ListItem>
  2. <ListItemAvatar>
  3. <Avatar>
  4. <Image ></Image>
  5. </Avatar>
  6. </ListItemAvatar>
  7. <ListItemTextExtended
  8. overline="new contact"
  9. primary="(123) 456-7890"
  10. secondary="Jan 9, 2021" ></ListItemTextExtended>
  11. <ListItemSecondaryAction>
  12. <IconButton>
  13. <Inbox></Inbox>
  14. </IconButton>
  15. <IconButton>
  16. <Comment ></Comment>
  17. </IconButton>
  18. </ListItemSecondaryAction>
  19. </ListItem>

The above snippet will render:
Something

Overline styling

You can use the overlineTypographyProps prop to style the overline component.

License

Licensed under the MIT License