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

ColorModeAvatar

An Avatar that automatically switches its image based on the current theme (light/dark).
GitHub
Avatar
Demo
Nuxt UI

Usage

The ColorModeAvatar component extends the Avatar component, so you can pass any property such as size, icon, etc.

Use the light and dark props to define the source for light and dark mode.

{
  "wait": "Loading client-side content..."
}
Switch between light and dark mode:
to see the different images

API

Props

Prop Default Type
as'span'any

The element or component this component should render as.

lightstring
darkstring
alt string
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
iconIconComponent

Display an icon on the left side.

text string
size'md' "md" | "3xs" | "2xs" | "xs" | "sm" | "lg" | "xl" | "2xl" | "3xl"
chipboolean | ChipProps
  • as?: any

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

  • 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.

  • size?: "md" | "sm" | "lg"

    Defaults to 'sm'.

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

    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; }
b24ui { root?: ClassNameValue; image?: ClassNameValue; fallback?: ClassNameValue; icon?: ClassNameValue; }
This component also supports all native <img> HTML attributes.

ContentToc

A sticky table of contents component with dynamic active section highlighting.

ColorModeButton

A button to toggle between light and dark themes.

On this page

  • Usage
  • API
    • Props
Releases
Published under MIT License.

Copyright © 2024-present Bitrix24