The Editor component is now implemented! Check it out.
v2.1.16
/
  • Get Started
  • Components
  • Composables
  • Typography
  • GitHub
  • Layout
  • App
  • Container
  • Error
  • SidebarLayout
  • Element
  • Advice
  • Alert
  • Avatar
  • AvatarGroup
  • Badge
  • Banner
  • Button
  • Calendar
  • Card
  • Chip
  • Collapsible
  • Countdown
  • FieldGroup
  • Kbd
  • Progress
  • Separator
  • Skeleton
  • Form
  • Checkbox
  • CheckboxGroup
  • ColorPicker
  • FileUpload
  • Form
  • FormField
  • Input
  • InputDate
  • InputMenu
  • InputNumber
  • InputTags
  • InputTime
  • PinInput
  • RadioGroup
  • Range
  • Select
  • SelectMenu
  • Switch
  • Textarea
  • Data
  • Accordion
  • DescriptionList
  • Empty
  • Table
  • TableWrapper
  • Timeline
  • User
  • Navigation
  • Breadcrumb
  • CommandPalette
  • Link
  • NavigationMenu
  • Pagination
  • Stepper
  • Tabs
  • Overlay
  • ContextMenu
  • DropdownMenu
  • Modal
  • Popover
  • Slideover
  • Toast
  • Tooltip
  • Page
  • PageCard
  • PageColumns
  • PageGrid
  • PageLinks
  • PageList
  • Dashboard
  • DashboardGroup
  • DashboardSearch
  • DashboardSearchButton
  • AI Chat
  • soonChatMessage
  • soonChatMessages
  • soonChatPalette
  • soonChatPrompt
  • soonChatPromptSubmit
  • Editor
  • NewEditor
  • NewEditorDragHandle
  • NewEditorEmojiMenu
  • NewEditorMentionMenu
  • NewEditorSuggestionMenu
  • NewEditorToolbar
  • Content
  • ContentSearch
  • ContentSearchButton
  • ContentSurround
  • ContentToc
  • Color Mode
  • ColorModeAvatar
  • ColorModeButton
  • ColorModeImage
  • ColorModeSelect
  • ColorModeSwitch
  • i18n
  • LocaleSelect
  • b24icons
  • b24jssdk
Use our Nuxt starter
v2.1.16
  • Docs
  • Components
  • Composables
  • Typography

DescriptionList

For instances requiring the conversion of a table row into its own table to enhance page completeness.
GitHub
Demo

Usage

Use the items prop as an array of objects to control the value of the DescriptionList:

  • label?: string
  • description?: string
  • icon?: IconComponent
  • avatar?: AvatarProps
  • actions?: ButtonProps[]
  • orientation?: "horizontal" | "vertical"
  • slot?: string
  • class?: any
  • b24ui?: { labelWrapper?: ClassNameValue, icon?: ClassNameValue, avatar?: ClassNameValue, label?: ClassNameValue, descriptionWrapper?: ClassNameValue, description?: ClassNameValue, actions?: ClassNameValue }
Full name
Michael Foster
Event
Payment is made through Atol online
<script setup lang="ts">
const items = ref([
  {
    label: 'Full name',
    description: 'Michael Foster'
  },
  {
    label: 'Event',
    description: 'Payment is made through Atol online'
  }
])
</script>

<template>
  <B24DescriptionList :items="items" />
</template>

Legend

Use the legend prop to set the legend of the DescriptionList.

Applicant Information

Full name
Michael Foster
Event
Payment is made through Atol online
<script setup lang="ts">
const items = ref([
  {
    label: 'Full name',
    description: 'Michael Foster'
  },
  {
    label: 'Event',
    description: 'Payment is made through Atol online'
  }
])
</script>

<template>
  <B24DescriptionList legend="Applicant Information" :items="items" />
</template>

Text

Use the text prop to set the description of the DescriptionList.

Applicant Information

Personal details and application.

Full name
Michael Foster
Event
Payment is made through Atol online
<script setup lang="ts">
const items = ref([
  {
    label: 'Full name',
    description: 'Michael Foster'
  },
  {
    label: 'Event',
    description: 'Payment is made through Atol online'
  }
])
</script>

<template>
  <B24DescriptionList
    legend="Applicant Information"
    text="Personal details and application."
    :items="items"
  />
</template>

Label Key

You can change the property that is used to set the label by using the label-key prop. Defaults to label.

Applicant Information

Personal details and application.

Full name
Michael Foster
Event
Payment is made through Atol online
<script setup lang="ts">
const items = ref([
  {
    title: 'Full name',
    description: 'Michael Foster'
  },
  {
    title: 'Event',
    description: 'Payment is made through Atol online'
  }
])
</script>

<template>
  <B24DescriptionList
    legend="Applicant Information"
    text="Personal details and application."
    label-key="title"
    :items="items"
  />
</template>

Description Key

You can change the property that is used to set the description by using the description-key prop. Defaults to description.

Applicant Information

Personal details and application.

Full name
Michael Foster
Event
Payment is made through Atol online
<script setup lang="ts">
const items = ref([
  {
    title: 'Full name',
    info: 'Michael Foster'
  },
  {
    title: 'Event',
    info: 'Payment is made through Atol online'
  }
])
</script>

<template>
  <B24DescriptionList
    legend="Applicant Information"
    text="Personal details and application."
    label-key="title"
    description-key="info"
    :items="items"
  />
</template>

Size

Use the size prop to change the size of the DescriptionList.

Applicant Information

Personal details and application.

Full name
Michael Foster
Event
Payment is made through Atol online
<script setup lang="ts">
const items = ref([
  {
    label: 'Full name',
    description: 'Michael Foster'
  },
  {
    label: 'Event',
    description: 'Payment is made through Atol online'
  }
])
</script>

<template>
  <B24DescriptionList
    size="sm"
    legend="Applicant Information"
    text="Personal details and application."
    :items="items"
  />
</template>

Examples

With icon in items

You can use the icon property to display an Icon inside the items.

Applicant Information

Personal details and application.

Line 1.1
Description 1.1
Line 1.2
Description 1.2
Description 1.3
<script setup lang="ts">
import type { DescriptionListItem } from '@bitrix24/b24ui-nuxt'
import SignIcon from '@bitrix24/b24icons-vue/main/SignIcon'
import PersonIcon from '@bitrix24/b24icons-vue/main/PersonIcon'

const items = ref([
  {
    label: 'Line 1.1',
    description: 'Description 1.1',
    icon: SignIcon
  },
  {
    label: 'Line 1.2',
    description: 'Description 1.2',
    avatar: {
      icon: PersonIcon
    }
  },
  {
    description: 'Description 1.3',
    icon: SignIcon
  }
] satisfies DescriptionListItem[])
</script>

<template>
  <B24DescriptionList
    legend="Applicant Information"
    text="Personal details and application."
    :items="items"
  />
</template>

With avatar in items

You can use the avatar property to display an Avatar inside the items.

Applicant Information

Personal details and application.

Line 1.1
Description 1.1
Line 1.2
Description 1.2
Description 1.3
<script setup lang="ts">
import type { DescriptionListItem } from '@bitrix24/b24ui-nuxt'

const items = ref([
  {
    label: 'Line 1.1',
    description: 'Description 1.1',
    avatar: {
      src: '/b24ui/avatar/employee.png'
    }
  },
  {
    label: 'Line 1.2',
    description: 'Description 1.2',
    avatar: {
      src: '/b24ui/avatar/assistant.png'
    }
  },
  {
    description: 'Description 1.3',
    avatar: {
      src: 'https://github.com/bitrix24.png'
    }
  }
] satisfies DescriptionListItem[])
</script>

<template>
  <B24DescriptionList
    legend="Applicant Information"
    text="Personal details and application."
    :items="items"
  />
</template>

With actions in items

Use the actions property to add some Button actions to the items of the DescriptionList.

Use the orientation property to change the orientation actions of the items.

Applicant Information

Personal details and application.

Line 1.1
Description 1.1
Line 1.2
Description 1.2
Line 1.3
Description 1.3
Fugiat ipsum ipsum deserunt culpa aute sint do nostrud anim incididunt cillum culpa consequat. Excepteur qui ipsum aliquip consequat sint. Sit id mollit nulla mollit nostrud in ea officia proident. Irure nostrud pariatur mollit ad adipisicing reprehenderit deserunt qui eu.
<script setup lang="ts">
import type { DescriptionListItem, ButtonProps } from '@bitrix24/b24ui-nuxt'
import SignIcon from '@bitrix24/b24icons-vue/main/SignIcon'
import DotsIcon from '@bitrix24/b24icons-vue/button/DotsIcon'

const action = (color: string): ButtonProps[] => [
  {
    icon: DotsIcon,
    color: color as any,
    onClick() {
      console.log('Action clicked')
    }
  }
]

const multipleActions = (color: string): ButtonProps[] => [
  {
    label: 'Action',
    color: color as any,
    onClick() {
      console.log('Action clicked')
    }
  },
  {
    label: 'Another action',
    color: color as any,
    onClick() {
      console.log('Another action clicked')
    }
  },
  {
    label: 'One more action',
    color: color as any,
    onClick() {
      console.log('One more action clicked')
    }
  },
  {
    label: 'And one more',
    color: color as any,
    icon: SignIcon,
    onClick() {
      console.log('And one more clicked')
    }
  },
  {
    label: 'Last one',
    color: color as any,
    icon: DotsIcon,
    onClick() {
      console.log('Last one clicked')
    }
  }
]

const items = ref([
  {
    label: 'Line 1.1',
    description: 'Description 1.1',
    actions: action('air-secondary-no-accent'),
    orientation: 'horizontal' as DescriptionListItem['orientation']
  },
  {
    label: 'Line 1.2',
    description: 'Description 1.2',
    actions: action('air-primary'),
    orientation: 'horizontal' as DescriptionListItem['orientation']
  },
  {
    label: 'Line 1.3',
    description: 'Description 1.3',
    actions: action('air-tertiary-no-accent'),
    orientation: 'horizontal' as DescriptionListItem['orientation']
  },
  {
    description: 'Fugiat ipsum ipsum deserunt culpa aute sint do nostrud anim incididunt cillum culpa consequat. Excepteur qui ipsum aliquip consequat sint. Sit id mollit nulla mollit nostrud in ea officia proident. Irure nostrud pariatur mollit ad adipisicing reprehenderit deserunt qui eu.',
    actions: multipleActions('default'),
    orientation: 'vertical' as DescriptionListItem['orientation']
  }
] satisfies DescriptionListItem[])
</script>

<template>
  <B24DescriptionList
    legend="Applicant Information"
    text="Personal details and application."
    :items="items"
  />
</template>

With custom slot

Use the slot property to customize a specific item.

You will have access to the following slots:

  • #{{ item.slot }}

Applicant Information

Personal details and application.

Amount

$10,560.00
Paid
Client
Employee Name
Due date
Tue Jan 31 2023
Payment method
Paid with MasterCard
<script setup lang="ts">
import type { DescriptionListItem } from '@bitrix24/b24ui-nuxt'
import DownloadDoubleIcon from '@bitrix24/b24icons-vue/actions/DownloadDoubleIcon'
import PersonIcon from '@bitrix24/b24icons-vue/main/PersonIcon'
import Calendar1Icon from '@bitrix24/b24icons-vue/main/Calendar1Icon'
import CreditDebitCardIcon from '@bitrix24/b24icons-vue/main/CreditDebitCardIcon'

const items = ref([
  {
    id: 'amount',
    slot: 'amount',
    label: 'Amount',
    value: '$10,560.00',
    description: 'Paid',
    b24ui: {
      label: 'font-(--ui-font-weight-semi-bold) text-(length:--ui-font-size-md)/(--ui-font-line-height-md)',
      description: 'font-(--ui-font-weight-semi-bold) text-(length:--ui-font-size-lg) block w-full'
    }
  },
  {
    id: 'client',
    label: 'Client',
    avatar: {
      icon: PersonIcon
    },
    description: 'Employee Name',
    b24ui: {
      description: 'font-(--ui-font-weight-semi-bold)'
    }
  },
  {
    id: 'date',
    label: 'Due date',
    icon: Calendar1Icon,
    value: new Date('2023-01-31T03:24:00')
  },
  {
    id: 'payment',
    label: 'Payment method',
    icon: CreditDebitCardIcon,
    description: 'Paid with MasterCard'
  }
] satisfies (DescriptionListItem & { id: string, value?: Date | string })[])
</script>

<template>
  <B24Card variant="tinted-success" class="w-full">
    <B24DescriptionList
      legend="Applicant Information"
      text="Personal details and application."
      class="light"
      :items="items"
      :b24ui="{
        legend: 'sr-only',
        text: 'sr-only',
        labelWrapper: 'px-4',
        container: 'mt-0',
        descriptionWrapper: 'px-4',
        footer: 'mt-4 px-0 py-4 pb-0 flex flex-row flex-nowrap justify-end items-center'
      }"
    >
      <template #amount="{ index }">
        <dt class="col-start-1 flex flex-nowrap flex-row items-center justify-start gap-1.5 pt-2 sm:py-1 px-4">
          <ProseH4 class="mb-0">
            Amount
          </ProseH4>
        </dt>
        <dd class="pb-3 pt-1 sm:py-3 px-4">
          <div class="flex flex-wrap flex-row items-center justify-start gap-4">
            <div>
              {{ items[index]?.value }}
            </div>
            <B24Badge
              :label="items[index]?.description"
              class="font-(--ui-font-weight-semi-bold)"
              color="air-primary-success"
            />
          </div>
        </dd>
      </template>
      <template #description="{ item }">
        <template v-if="item.id === 'date'">
          <time :datetime="(item?.value as Date)?.toISOString()">{{ (item?.value as Date)?.toDateString() }}</time>
        </template>
        <template v-else>
          {{ item.description }}
        </template>
      </template>
      <template #footer>
        <B24Button
          color="air-primary"
          label="Download receipt"
          :icon="DownloadDoubleIcon"
          rounded
        />
      </template>
    </B24DescriptionList>
  </B24Card>
</template>

API

Props

Prop Default Type
legend string
text string
labelKey'label' string

The key used to get the label from the item.

descriptionKey'description' string

The key used to get the description from the item.

items DescriptionListItem[]
  • label?: string
  • icon?: IconComponent

    Display an icon on the left side.

  • avatar?: AvatarProps
  • slot?: string
  • description?: string
  • orientation?: "horizontal" | "vertical"

    The orientation between the content and the actions. Defaults to 'vertical'.

  • actions?: ButtonProps[]

    Display a list of actions:

    • under the description when orientation is vertical
    • next to the description when orientation is horizontal{ size: 'xs' }
  • class?: any
  • b24ui?: Pick<{ root?: ClassNameValue; legend?: ClassNameValue; text?: ClassNameValue; container?: ClassNameValue; labelWrapper?: ClassNameValue; icon?: ClassNameValue; avatar?: ClassNameValue; avatarSize?: ClassNameValue; label?: ClassNameValue; descriptionWrapper?: ClassNameValue; description?: ClassNameValue; actions?: ClassNameValue; footer?: ClassNameValue; }, "labelWrapper" | "icon" | "avatar" | "label" | "descriptionWrapper" | "description" | "actions">
size'md' "md" | "sm"
b24ui { root?: ClassNameValue; legend?: ClassNameValue; text?: ClassNameValue; container?: ClassNameValue; labelWrapper?: ClassNameValue; icon?: ClassNameValue; avatar?: ClassNameValue; avatarSize?: ClassNameValue; label?: ClassNameValue; descriptionWrapper?: ClassNameValue; description?: ClassNameValue; actions?: ClassNameValue; footer?: ClassNameValue; }

Slots

Slot Type
legend{}
text{}
leading{ item: DescriptionListItem; index: number; b24ui: object; }
label{ item: DescriptionListItem; index: number; }
description{ item: DescriptionListItem; index: number; }
actions{ item: DescriptionListItem; index: number; b24ui: object; }
content-top{ item: DescriptionListItem; index: number; b24ui: object; }
content{ item: DescriptionListItem; index: number; b24ui: object; }
content-bottom{ item: DescriptionListItem; index: number; b24ui: object; }
footer{ b24ui: object; }

Theme

app.config.ts
export default defineAppConfig({
  b24ui: {
    descriptionList: {
      slots: {
        root: 'w-full shrink-0',
        legend: 'font-(--ui-font-weight-semi-bold) text-(--b24ui-typography-label-color)',
        text: 'text-(--b24ui-typography-description-color)',
        container: 'grid grid-cols-1 sm:grid-cols-[min(50%,theme(spacing.80))_auto]',
        labelWrapper: 'col-start-1 border-t first:border-none sm:border-t flex flex-nowrap flex-row items-center justify-start gap-1.5 border-(--ui-color-divider-vibrant-default) sm:border-(--ui-color-divider-vibrant-default) text-(--b24ui-typography-description-color)',
        icon: 'shrink-0 size-6 text-(--b24ui-typography-description-color)',
        avatar: 'shrink-0',
        avatarSize: '',
        label: '',
        descriptionWrapper: 'sm:border-t sm:[&:nth-child(2)]:border-none sm:border-(--ui-color-divider-vibrant-default) text-(--b24ui-typography-label-color)',
        description: '',
        actions: 'flex flex-wrap gap-1.5 shrink-0',
        footer: 'border-t border-(--ui-color-divider-vibrant-default)'
      },
      variants: {
        size: {
          sm: {
            legend: 'text-md',
            text: 'mt-1 max-w-2/3 text-(length:--ui-font-size-sm)',
            container: 'mt-2.5 text-md',
            labelWrapper: 'pt-3 sm:py-3',
            avatarSize: 'xs',
            label: '',
            descriptionWrapper: 'pb-3 pt-1 sm:py-3',
            description: '',
            footer: 'mt-2 p-2'
          },
          md: {
            legend: 'text-xl',
            text: 'mt-2 max-w-2/3 text-(length:--ui-font-size-lg) leading-5',
            container: 'mt-3 text-(length:--ui-font-size-lg)',
            labelWrapper: 'pt-3 sm:py-3',
            avatarSize: 'xs',
            label: '',
            descriptionWrapper: 'pb-3 pt-1 sm:py-3',
            description: '',
            footer: 'mt-4 p-4'
          }
        },
        orientation: {
          horizontal: {
            descriptionWrapper: 'w-full flex flex-row items-center justify-between gap-4',
            actions: 'items-center'
          },
          vertical: {
            descriptionWrapper: '',
            actions: 'items-start mt-2.5'
          }
        },
        title: {
          true: {
            description: 'mt-1'
          }
        }
      },
      compoundVariants: [],
      defaultVariants: {
        size: 'md'
      }
    }
  }
})
vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import bitrix24UIPluginVite from '@bitrix24/b24ui-nuxt/vite'

export default defineConfig({
  plugins: [
    vue(),
    bitrix24UIPluginVite({
      b24ui: {
        descriptionList: {
          slots: {
            root: 'w-full shrink-0',
            legend: 'font-(--ui-font-weight-semi-bold) text-(--b24ui-typography-label-color)',
            text: 'text-(--b24ui-typography-description-color)',
            container: 'grid grid-cols-1 sm:grid-cols-[min(50%,theme(spacing.80))_auto]',
            labelWrapper: 'col-start-1 border-t first:border-none sm:border-t flex flex-nowrap flex-row items-center justify-start gap-1.5 border-(--ui-color-divider-vibrant-default) sm:border-(--ui-color-divider-vibrant-default) text-(--b24ui-typography-description-color)',
            icon: 'shrink-0 size-6 text-(--b24ui-typography-description-color)',
            avatar: 'shrink-0',
            avatarSize: '',
            label: '',
            descriptionWrapper: 'sm:border-t sm:[&:nth-child(2)]:border-none sm:border-(--ui-color-divider-vibrant-default) text-(--b24ui-typography-label-color)',
            description: '',
            actions: 'flex flex-wrap gap-1.5 shrink-0',
            footer: 'border-t border-(--ui-color-divider-vibrant-default)'
          },
          variants: {
            size: {
              sm: {
                legend: 'text-md',
                text: 'mt-1 max-w-2/3 text-(length:--ui-font-size-sm)',
                container: 'mt-2.5 text-md',
                labelWrapper: 'pt-3 sm:py-3',
                avatarSize: 'xs',
                label: '',
                descriptionWrapper: 'pb-3 pt-1 sm:py-3',
                description: '',
                footer: 'mt-2 p-2'
              },
              md: {
                legend: 'text-xl',
                text: 'mt-2 max-w-2/3 text-(length:--ui-font-size-lg) leading-5',
                container: 'mt-3 text-(length:--ui-font-size-lg)',
                labelWrapper: 'pt-3 sm:py-3',
                avatarSize: 'xs',
                label: '',
                descriptionWrapper: 'pb-3 pt-1 sm:py-3',
                description: '',
                footer: 'mt-4 p-4'
              }
            },
            orientation: {
              horizontal: {
                descriptionWrapper: 'w-full flex flex-row items-center justify-between gap-4',
                actions: 'items-center'
              },
              vertical: {
                descriptionWrapper: '',
                actions: 'items-start mt-2.5'
              }
            },
            title: {
              true: {
                description: 'mt-1'
              }
            }
          },
          compoundVariants: [],
          defaultVariants: {
            size: 'md'
          }
        }
      }
    })
  ]
})

Accordion

This is a stacked set of collapsible panels

Empty

An empty state component.

On this page

  • Usage
    • Legend
    • Text
    • Label Key
    • Description Key
    • Size
  • Examples
    • With icon in items
    • With avatar in items
    • With actions in items
    • With custom slot
  • API
    • Props
    • Slots
  • Theme
Releases
Published under MIT License.

Copyright © 2024-present Bitrix24