Skip to content
On this page

NcListItem

Props

Prop nameDescriptionTypeValuesDefault
detailsThe details text displayed in the upper right part of the componentstring-''
titleTitle (first line of text)string-
exactPass in true if you want the matching behavior to
be non-inclusive: https://router.vuejs.org/api/#exact
boolean-false
toThe route for the router link.string|object-''
hrefThe value for the external linkstring-'#'
anchorIdId for the <a> elementstring-''
boldMake subtitle boldboolean-false
compactShow the NcListItem in compact designboolean-false
activeToggle the active state of the componentboolean-false
linkAriaLabelAria label for the wrapper elementstring-''
actionsAriaLabelAria label for the actions togglestring-''
counterNumberIf different from from 0 this component will display the
NcCounterBubble component
number|string-0
counterTypeOutlined or highlighted state of the counterstringhighlighted, outlined''
forceDisplayActionsTo be used only when the elements in the actions menu are very importantboolean-false

Events

Event namePropertiesDescription
click
update:menuOpen

Slots

NameDescriptionBindings
iconThis slot is used for the NcAvatar or icon
subtitleSlot for the second line of the component
indicatorThis slot is used for some indicator in form of icon
actionsProvide the actions for the right side quick menu
extra

Default Usage

vue
<template>
  <ul>
    <NcListItem
      :title="'Title of the element'"
      :bold="false"
      :details="'1h'"
      :counter-number="44"
      counterType="highlighted"
    >
      <template #icon>
        <NcAvatar :size="44" user="janedoe" display-name="Jane Doe" />
      </template>
      <template #subtitle>
        In this slot you can put both text and other components such as icons
      </template>
      <template #indicator>
        <!-- Color dot -->
        <CheckboxBlankCircle :size="16" fill-color="#0082c9" />
      </template>
      <template #actions>
        <NcActionButton>
          Button one
        </NcActionButton>
        <NcActionButton>
          Button two
        </NcActionButton>
        <NcActionButton>
          Button three
        </NcActionButton>
      </template>
    </NcListItem>
    <NcListItem
      :title="'Title of the element'"
      :bold="false"
      :force-display-actions="true"
      :details="'1h'"
      :counter-number="44"
      counterType="highlighted"
    >
      <template #icon>
        <NcAvatar :size="44" user="janedoe" display-name="Jane Doe" />
      </template>
      <template #subtitle>
        In this slot you can put both text and other components such as icons
      </template>
      <template #actions>
        <NcActionButton>
          Button one
        </NcActionButton>
        <NcActionButton>
          Button two
        </NcActionButton>
        <NcActionButton>
          Button three
        </NcActionButton>
      </template>
    </NcListItem>
    <NcListItem :title="'Title of the element'" :bold="false">
      <template #icon>
        <NcAvatar :size="44" user="janedoe" display-name="Jane Doe" />
      </template>
      <template #subtitle>
        In this slot you can put both text and other components such as icons
      </template>
      <template #indicator>
        <!-- Color dot -->
        <CheckboxBlankCircle :size="16" fill-color="#0082c9" />
      </template>
      <template #actions>
        <NcActionButton>
          Button one
        </NcActionButton>
        <NcActionButton>
          Button two
        </NcActionButton>
        <NcActionButton>
          Button three
        </NcActionButton>
      </template>
    </NcListItem>
    <NcListItem :title="'Title of the element'" :bold="false" :details="'1h'">
      <template #icon>
        <NcAvatar :size="44" user="janedoe" display-name="Jane Doe" />
      </template>
      <template #subtitle>
        In this slot you can put both text and other components such as icons
      </template>
      <template #indicator>
        <!-- Color dot -->
        <CheckboxBlankCircle :size="16" fill-color="#0082c9" />
      </template>
    </NcListItem>
  </ul>
</template>

<script>
import CheckboxBlankCircle from "vue-material-design-icons/CheckboxBlankCircle";

export default {
  components: {
    CheckboxBlankCircle
  }
};
</script>

NcListItem compact mode

<ul style="width: 350px;">
	<NcListItem
		:title="'Title of the element'"
		:counter-number="1"
		:compact="true" >
		<template #icon>
			<div class="icon-edit" />
		</template>
		<template #subtitle>
			This one is with subtitle
		</template>
		<template #actions>
			<NcActionButton>
				Button one
			</NcActionButton>
			<NcActionButton>
				Button two
			</NcActionButton>
		</template>
	</NcListItem>
	<NcListItem
		:title="'Title of the element'"
		:compact="true" >
		<template #icon>
			<div class="icon-edit" />
		</template>
	</NcListItem>
	<NcListItem
		:title="'Title of the element'"
		:counter-number="3"
		:compact="true" >
		<template #icon>
			<div class="icon-edit" />
		</template>
		<template #subtitle>
			This one is with subtitle
		</template>
		<template #actions>
			<NcActionButton>
				Button one
			</NcActionButton>
			<NcActionButton>
				Button two
			</NcActionButton>
		</template>
	</NcListItem>
	<NcListItem
		:title="'Title of the element'"
		:compact="true"
		:counter-number="4"
		href="https://nextcloud.com">
		<template #icon>
			<div class="icon-edit" />
		</template>
		<template #subtitle>
			This one is with an external link
		</template>
	</NcListItem>
</ul>