Skip to content

Commit

Permalink
Merge pull request #5388 from nextcloud-libraries/feat/add-listitem-s…
Browse files Browse the repository at this point in the history
…ide-content

feat: add title slot for NcItemList component
  • Loading branch information
emoral435 committed Mar 12, 2024
2 parents 1bb6ff4 + 6287dac commit 01da3ae
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/components/NcListItem/NcListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
<template #icon>
<NcAvatar disable-menu :size="44" user="janedoe" display-name="Jane Doe" />
</template>
<template #name>
<span style="display: flex; color: var(--color-primary);">
Name of the element with content
</span>
</template>
<template #subname>
In this slot you can put both text and other components such as icons
</template>
Expand Down Expand Up @@ -193,6 +198,14 @@
<template #icon>
<NcAvatar disable-menu :size="44" user="janedoe" display-name="Jane Doe" />
</template>
<template #name>
<span style="display: flex; gap: 0.5rem; color: var(--color-primary);">
Flexible styling within the first line of the component
<div style="color: var(--color-secondary);">
like this.
</div>
</span>
</template>
<template #subname>
In this slot you can put both text and other components such as icons
</template>
Expand Down Expand Up @@ -386,7 +399,8 @@
<div class="list-item-content">
<div class="list-item-content__main">
<div class="list-item-content__name">
{{ name }}
<!-- @slot Slot for the first line of the component. prop 'name' is used as a fallback is no slots are provided -->
<slot name="name">{{ name }}</slot>
</div>
<div v-if="hasSubname"
class="list-item-content__subname"
Expand Down

0 comments on commit 01da3ae

Please sign in to comment.