v2.1.8
/
  • 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
  • Content
  • ContentSearch
  • ContentSearchButton
  • ContentSurround
  • ContentToc
  • Color Mode
  • ColorModeAvatar
  • ColorModeButton
  • ColorModeImage
  • ColorModeSelect
  • ColorModeSwitch
  • i18n
  • LocaleSelect
  • b24icons
  • b24jssdk
Use our Nuxt starter
v2.1.8
  • Docs
  • Components
  • Composables
  • Typography

User

A component to display user details, including their name, bio, and profile picture.
GitHub
Demo
Nuxt UI

Usage

Name

Use the name prop to display a name for the user.

John Doe

{
  "wait": "Loading client-side content..."
}

Description

Use the description prop to display a description for the user.

John Doe

Software Engineer

{
  "wait": "Loading client-side content..."
}

Avatar

Use the avatar prop to display an Avatar component.

John Doe

John Doe

Software Engineer

{
  "wait": "Loading client-side content..."
}
Prop Default Type
src string
alt string
iconIconComponent

Display an icon on the left side.

text string
chipboolean | ChipProps
  • text?: string | number

    Display some text inside the chip.

  • trailingIcon?: IconComponent

    The icon displayed on the right side of the chip.

  • color?: "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-warning" | "air-primary-copilot" | "air-secondary" | "air-secondary-accent" | "air-secondary-accent-1" | "air-tertiary"

    Defaults to 'danger'.

  • inverted?: boolean

    If set to true the color is inverted. Used for 'air-primary', 'air-primary-success', 'air-primary-alert', 'air-primary-copilot' and 'air-primary-warning' colors. Defaults to false.

  • position?: "top-left" | "top-right" | "bottom-left" | "bottom-right"

    The position of the chip. Defaults to 'top-right'.

  • inset?: boolean

    When true, keep the chip inside the component for rounded elements Defaults to false.

  • standalone?: boolean

    When true, render the chip relatively to the parent. Defaults to false.

  • hideZero?: boolean

    When true, hide chip if value='0' Defaults to false.

  • class?: any
  • b24ui?: { root?: ClassNameValue; base?: ClassNameValue; trailingIcon?: ClassNameValue; }
crossorigin "" | "anonymous" | "use-credentials"
decoding "async" | "auto" | "sync"
height string | number
loading "lazy" | "eager"
referrerpolicy "" | "no-referrer" | "no-referrer-when-downgrade" | "origin" | "origin-when-cross-origin" | "same-origin" | "strict-origin" | "strict-origin-when-cross-origin" | "unsafe-url"
sizes string
srcset string
usemap string
width string | number
b24ui { root?: ClassNameValue; image?: ClassNameValue; fallback?: ClassNameValue; icon?: ClassNameValue; }

Chip

Use the chip prop to display a Chip component.

John Doe

John Doe

Software Engineer

{
  "wait": "Loading client-side content..."
}
Prop Default Type
text string | number

Display some text inside the chip.

trailingIconIconComponent

The icon displayed on the right side of the chip.

color'danger'"air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-warning" | "air-primary-copilot" | "air-secondary" | "air-secondary-accent" | "air-secondary-accent-1" | "air-tertiary"
invertedfalseboolean

If set to true the color is inverted. Used for 'air-primary', 'air-primary-success', 'air-primary-alert', 'air-primary-copilot' and 'air-primary-warning' colors.

position'top-right' "top-right" | "bottom-right" | "top-left" | "bottom-left"

The position of the chip.

insetfalseboolean

When true, keep the chip inside the component for rounded elements

hideZerofalseboolean

When true, hide chip if value='0'

showtrueboolean
b24ui { root?: ClassNameValue; base?: ClassNameValue; trailingIcon?: ClassNameValue; }

Size

Use the size prop to change the size of the user avatar and text.

John Doe

John Doe

Software Engineer

{
  "wait": "Loading client-side content..."
}

Orientation

Use the orientation prop to change the orientation. Defaults to horizontal.

John Doe

John Doe

Software Engineer

{
  "wait": "Loading client-side content..."
}

Link

You can pass any property from the <NuxtLink> component such as to, target, rel, etc.

Username

Username

User description

{
  "wait": "Loading client-side content..."
}
The NuxtLink component will inherit all other attributes you pass to the User component.

API

Props

Prop Default Type
as'div'any

The element or component this component should render as.

name string
description string
avatar Omit<AvatarProps, "size"> & { [key: string]: any; }
  • as?: any

    The element or component this component should render as. Defaults to 'span'.

  • chip?: boolean | ChipProps
  • class?: any
  • b24ui?: { root?: ClassNameValue; image?: ClassNameValue; fallback?: ClassNameValue; icon?: ClassNameValue; }
  • alt?: string
  • crossorigin?: "" | "anonymous" | "use-credentials"
  • decoding?: "async" | "auto" | "sync"
  • height?: Numberish
  • loading?: "lazy" | "eager"
  • referrerpolicy?: HTMLAttributeReferrerPolicy
  • sizes?: string
  • src?: string
  • srcset?: string
  • usemap?: string
  • width?: Numberish
  • icon?: IconComponent

    Display an icon on the left side.

  • text?: string
  • style?: any
chipboolean | Omit<ChipProps, "size" | "inset">
size'md' "md" | "3xs" | "2xs" | "xs" | "sm" | "lg" | "xl" | "2xl" | "3xl"
orientation'horizontal' "horizontal" | "vertical"

The orientation of the user.

to string | RouteLocationAsRelativeGeneric | RouteLocationAsPathGeneric
  • name?: RouteRecordNameGeneric
  • params?: RouteParamsRawGeneric
  • path?: undefined

    A relative path to the current location. This property should be removed

  • query?: LocationQueryRaw
  • hash?: string
  • force?: boolean

    Triggers the navigation even if the location is the same as the current one. Note this will also add a new entry to the history unless replace: true is passed.

  • state?: HistoryState

    State to save using the History API. This cannot contain any reactive values and some primitives like Symbols are forbidden. More info at https://developer.mozilla.org/en-US/docs/Web/API/History/state

target null | "_blank" | "_parent" | "_self" | "_top" | string & {}
b24ui { root?: ClassNameValue; wrapper?: ClassNameValue; name?: ClassNameValue; description?: ClassNameValue; avatar?: ClassNameValue; }

Slots

Slot Type
avatar{ b24ui: object; }
name{}
description{}
default{}

Theme

app.config.ts
export default defineAppConfig({
  b24ui: {
    user: {
      slots: {
        root: 'relative group/user',
        wrapper: '',
        name: 'font-(--ui-font-weight-medium)',
        description: 'text-(--b24ui-typography-description-color)',
        avatar: 'shrink-0'
      },
      variants: {
        orientation: {
          horizontal: {
            root: 'flex items-center'
          },
          vertical: {
            root: 'flex flex-col'
          }
        },
        to: {
          true: {
            name: 'text-(--b24ui-typography-label-color) peer-hover:text-(--ui-color-design-selection-content) transition-colors',
            description: 'peer-hover:text-(--ui-color-design-selection-content) transition-colors',
            avatar: 'transform transition-transform duration-200 group-hover/user:scale-115'
          },
          false: {
            name: 'text-(--b24ui-typography-label-color)',
            description: ''
          }
        },
        size: {
          '3xs': {
            root: 'gap-1',
            wrapper: 'flex items-center gap-1',
            name: 'text-(length:--ui-font-size-xs)',
            description: 'text-(length:--ui-font-size-xs)'
          },
          '2xs': {
            root: 'gap-1.5',
            wrapper: 'flex items-center gap-1.5',
            name: 'text-(length:--ui-font-size-xs)',
            description: 'text-(length:--ui-font-size-xs)'
          },
          xs: {
            root: 'gap-1.5',
            wrapper: 'flex items-center gap-1.5',
            name: 'text-(length:--ui-font-size-xs)',
            description: 'text-(length:--ui-font-size-xs)'
          },
          sm: {
            root: 'gap-2',
            name: 'text-(length:--ui-font-size-xs)',
            description: 'text-(length:--ui-font-size-xs)'
          },
          md: {
            root: 'gap-2',
            name: 'text-(length:--ui-font-size-sm)',
            description: 'text-(length:--ui-font-size-xs)'
          },
          lg: {
            root: 'gap-2.5',
            name: 'text-(length:--ui-font-size-sm)',
            description: 'text-(length:--ui-font-size-sm)'
          },
          xl: {
            root: 'gap-2.5',
            name: 'text-(length:--ui-font-size-md)',
            description: 'text-(length:--ui-font-size-sm)'
          },
          '2xl': {
            root: 'gap-3',
            name: 'text-(length:--ui-font-size-md)',
            description: 'text-(length:--ui-font-size-md)'
          },
          '3xl': {
            root: 'gap-3',
            name: 'text-(length:--ui-font-size-lg)',
            description: 'text-(length:--ui-font-size-md)'
          }
        }
      },
      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: {
        user: {
          slots: {
            root: 'relative group/user',
            wrapper: '',
            name: 'font-(--ui-font-weight-medium)',
            description: 'text-(--b24ui-typography-description-color)',
            avatar: 'shrink-0'
          },
          variants: {
            orientation: {
              horizontal: {
                root: 'flex items-center'
              },
              vertical: {
                root: 'flex flex-col'
              }
            },
            to: {
              true: {
                name: 'text-(--b24ui-typography-label-color) peer-hover:text-(--ui-color-design-selection-content) transition-colors',
                description: 'peer-hover:text-(--ui-color-design-selection-content) transition-colors',
                avatar: 'transform transition-transform duration-200 group-hover/user:scale-115'
              },
              false: {
                name: 'text-(--b24ui-typography-label-color)',
                description: ''
              }
            },
            size: {
              '3xs': {
                root: 'gap-1',
                wrapper: 'flex items-center gap-1',
                name: 'text-(length:--ui-font-size-xs)',
                description: 'text-(length:--ui-font-size-xs)'
              },
              '2xs': {
                root: 'gap-1.5',
                wrapper: 'flex items-center gap-1.5',
                name: 'text-(length:--ui-font-size-xs)',
                description: 'text-(length:--ui-font-size-xs)'
              },
              xs: {
                root: 'gap-1.5',
                wrapper: 'flex items-center gap-1.5',
                name: 'text-(length:--ui-font-size-xs)',
                description: 'text-(length:--ui-font-size-xs)'
              },
              sm: {
                root: 'gap-2',
                name: 'text-(length:--ui-font-size-xs)',
                description: 'text-(length:--ui-font-size-xs)'
              },
              md: {
                root: 'gap-2',
                name: 'text-(length:--ui-font-size-sm)',
                description: 'text-(length:--ui-font-size-xs)'
              },
              lg: {
                root: 'gap-2.5',
                name: 'text-(length:--ui-font-size-sm)',
                description: 'text-(length:--ui-font-size-sm)'
              },
              xl: {
                root: 'gap-2.5',
                name: 'text-(length:--ui-font-size-md)',
                description: 'text-(length:--ui-font-size-sm)'
              },
              '2xl': {
                root: 'gap-3',
                name: 'text-(length:--ui-font-size-md)',
                description: 'text-(length:--ui-font-size-md)'
              },
              '3xl': {
                root: 'gap-3',
                name: 'text-(length:--ui-font-size-lg)',
                description: 'text-(length:--ui-font-size-md)'
              }
            }
          },
          defaultVariants: {
            size: 'md'
          }
        }
      }
    })
  ]
})

Timeline

A component for displaying a chronological sequence of events, with dates, titles, and supporting icons or avatars.

Breadcrumb

A breadcrumb navigation component.

On this page

  • Usage
    • Name
    • Description
    • Avatar
    • Chip
    • Size
    • Orientation
    • Link
  • API
    • Props
    • Slots
  • Theme
Releases
Published under MIT License.

Copyright © 2024-present Bitrix24