---
title: "Advice"
description: "Пара строк текста и аватар"
canonical_url: "https://b24-ui.bx-shef.by/docs/components/advice"
---
# Advice

> Пара строк текста и аватар

## Использование

### Описание

Пропс `description` задаёт описание Advice.

```vue
<template>
  <B24Advice :description="{'Сообщим руководителю, что сделка не движется':'менеджер не перезванивает клиенту и не отвечает на его сообщения. Поставим менеджеру задачу от имени руководителя'}" />
</template>
```

### Иконка

Пропс `icon` показывает [иконку](https://bitrix24.github.io/b24icons/icons/).

```vue
<script setup lang="ts">
import RocketIcon from '@bitrix24/b24icons-vue/main/RocketIcon'
</script>

<template>
  <B24Advice :icon="RocketIcon" :description="{'Сообщим руководителю, что сделка не движется':'менеджер не перезванивает клиенту и не отвечает на его сообщения. Поставим менеджеру задачу от имени руководителя'}" />
</template>
```

### Аватар

Пропс `avatar` показывает [аватар](https://b24-ui.bx-shef.by/raw/docs/components/avatar.md).

```vue
<template>
  <B24Advice :avatar="{src:'/b24ui/avatar/employee.png',loading:'lazy'}" :description="{'Сообщим руководителю, что сделка не движется':'менеджер не перезванивает клиенту и не отвечает на его сообщения. Поставим менеджеру задачу от имени руководителя'}" />
</template>
```

### Угол

Пропс `angle` меняет положение уголка.

```vue
<template>
  <B24Advice angle="top" :avatar="{src:'/b24ui/avatar/employee.png',loading:'lazy'}" :description="{'Сообщим руководителю, что сделка не движется':'менеджер не перезванивает клиенту и не отвечает на его сообщения. Поставим менеджеру задачу от имени руководителя'}" />
</template>
```

### С пользовательским слотом

Слот позволяет настроить описание.

```vue [AdviceExample.vue]
<script setup lang="ts">
import DotsIcon from '@bitrix24/b24icons-vue/button/DotsIcon'
</script>

<template>
  <div class="mb-4 flex flex-wrap items-center justify-start gap-4">
    <B24Advice
      :avatar="{
        src: '/b24ui/avatar/assistant.png',
        loading: 'lazy' as const
      }"
    >
      <span>Как правило, инструкции по добавлению SAML-приложения и указанию ACS URL и SP Entity ID есть в технической документации Microsoft Azure. </span>
      <B24Link to="https://github.com/bitrix24/b24ui/" target="_blank" is-action>
        Подробнее
      </B24Link>
    </B24Advice>
    <B24Advice
      angle="top"
      :avatar="{
        src: '/b24ui/avatar/employee.png',
        loading: 'lazy' as const
      }"
    >
      <div class="flex flex-col items-start justify-between gap-1.5">
        <div class="font-(--ui-font-weight-bold)">
          Справочная информация
        </div>
        <div>Как правило, инструкции по добавлению SAML-приложения и указанию ACS URL и SP Entity ID есть в технической документации Microsoft Azure.</div>
        <div class="mt-2 flex flex-row flex-wrap items-start justify-between gap-2">
          <B24Button size="xs" color="air-primary" label="Действие 1" />
          <B24Button size="xs" color="air-secondary-accent-2" label="Действие 2" />
          <B24Button size="xs" color="air-tertiary" :icon="DotsIcon" />
        </div>
      </div>
    </B24Advice>
  </div>
</template>
```

## API

### Пропсы

```ts
/**
 * Props for the Advice component
 */
interface AdviceProps {
  /**
   * The element or component this component should render as.
   * @default 'div'
   */
  as?: any;
  description?: string | undefined;
  /**
   * @default 'bottom'
   */
  angle?: "bottom" | "top" | undefined;
  b24ui?: { root?: SlotClass; descriptionWrapper?: SlotClass; descriptionBorder?: SlotClass; descriptionBg?: SlotClass; descriptionAngle?: SlotClass; description?: SlotClass; leading?: SlotClass; leadingIcon?: SlotClass; leadingAvatar?: SlotClass; leadingAvatarIcon?: SlotClass; leadingAvatarSize?: SlotClass; } | undefined;
  /**
   * Display an icon on the left side.
   */
  icon?: (props: HTMLAttributes & VNodeProps & {}, ctx: Omit<{ attrs: Attrs; slots: Readonly<InternalSlots>; emit: (event: string, ...args: any[]) => void; expose: <Exposed extends Record<string, any> = Record<...>>(exposed?: Exposed | undefined) => void; }, "expose">): any | undefined;
  /**
   * Display an avatar on the left side.
   */
  avatar?: AvatarProps | undefined;
}
```

### Слоты

```ts
/**
 * Slots for the Advice component
 */
interface AdviceSlots {
  default(): any;
  leading(): any;
}
```

## Тема

```ts [app.config.ts]
export default defineAppConfig({
  b24ui: {
    advice: {
      slots: {
        root: 'light style-outline-accent-1 flex items-end',
        descriptionWrapper: 'relative',
        descriptionBorder: 'fill-(--b24ui-border-color)',
        descriptionBg: 'fill-(--b24ui-background) dark:fill-(--ui-color-base-6)',
        descriptionAngle: 'absolute w-[14px] h-[12px]',
        description: 'grow w-11/12 py-3 px-md2 ms-2 rounded-[23px] font-[family-name:var(--ui-font-family-secondary)] text-(length:--ui-font-size-md)/(--ui-font-line-height-md) font-(--ui-font-weight-normal) border-1 border-(--b24ui-border-color) bg-(--b24ui-background) text-(--b24ui-color) dark:bg-(--ui-color-base-6)',
        leading: 'me-1.5 ms-2 font-(--ui-font-weight-medium) text-(--ui-color-design-plain-content-icon-secondary)',
        leadingIcon: 'shrink-0 size-[42px]',
        leadingAvatar: 'shrink-0',
        leadingAvatarIcon: 'text-label bg-(--ui-color-base-8)',
        leadingAvatarSize: 'lg'
      },
      variants: {
        angle: {
          top: {
            root: 'items-start',
            leading: 'mt-0.5',
            descriptionAngle: 'start-[0.8px] top-[9px] scale-x-100 -scale-y-100 rtl:-scale-x-100'
          },
          bottom: {
            root: 'items-end',
            descriptionAngle: 'start-[0.8px] bottom-[9px] rtl:-scale-x-100'
          }
        }
      },
      defaultVariants: {
        angle: 'bottom'
      }
    }
  }
})
```

## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
