Skip to content
brandonk1234 edited this page Feb 23, 2017 · 4 revisions

List

The ListItems component can be used for displaying pieces of content in a block. The user has the ability to use alternative colours

Props

The props needed for this component are listed and explained below:

  • shouldShowAlternativeColors - This prop must be a boolean.

  • className - This prop must be a string.

  • items - This prop is an array of <ListItem /> components. Inside the <ListItem /> component you should have an itemText prop, an icon prop, a key, and a buttons prop which contains an array with an object where you input your button info in. See example of that below.

Example

<ListItems
     shouldShowAlternativeColors={true}
     className="dashboard-items"
     items={[
         <ListItem 
            onClick={this.onClick} 
            itemText="this is the text for the list item"
            itemDetail="the item detail"
            key={1}
            buttons={
                [{
                  type: "primary",
                  icon: "pencil4",
                  onClick: this.onClick    
                 }
            ]}
        />,
/>

Related