v2.1.8
  • Get Started
  • Components
  • Composables
  • Typography
  • GitHub
  • Overview
  • Introduction
  • Headers and text
  • Lists and tables
  • Images and embeds
  • Code
  • Components
  • Accordion
  • Badge
  • Callout
  • Card
  • CardGroup
  • CodeCollapse
  • CodeGroup
  • CodePreview
  • Collapsible
  • Field
  • FieldGroup
  • Kbd
  • Steps
  • Tabs
  • b24icons
  • b24jssdk
Use our Nuxt starter
v2.1.8
  • Docs
  • Components
  • Composables
  • Typography

Images and embeds

Flexible visuals and interactive content to make your documentation clearer and more engaging.
Nuxt UI

Images

Responsive images with automatic optimization and interactive zoom functionality.

Image

![Image](/b24ui/assets/demo/b24rich_new.png)
app.config.ts
export default defineAppConfig({
  b24ui: {
    prose: {
      img: {
        slots: {
          base: 'rounded-md',
          overlay: 'fixed inset-0 bg-[#003366]/20 motion-safe:backdrop-blur-[2px] will-change-opacity',
          content: 'fixed inset-0 flex items-center justify-center cursor-zoom-out focus:outline-none p-4 sm:p-8',
          zoomedImage: 'w-full h-auto max-w-[95vw] max-h-[95vh] object-contain rounded-md'
        },
        variants: {
          zoom: {
            true: 'will-change-transform'
          },
          open: {
            true: ''
          }
        },
        compoundVariants: [
          {
            zoom: true,
            open: false,
            class: 'cursor-zoom-in'
          }
        ]
      }
    }
  }
})
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: {
        prose: {
          img: {
            slots: {
              base: 'rounded-md',
              overlay: 'fixed inset-0 bg-[#003366]/20 motion-safe:backdrop-blur-[2px] will-change-opacity',
              content: 'fixed inset-0 flex items-center justify-center cursor-zoom-out focus:outline-none p-4 sm:p-8',
              zoomedImage: 'w-full h-auto max-w-[95vw] max-h-[95vh] object-contain rounded-md'
            },
            variants: {
              zoom: {
                true: 'will-change-transform'
              },
              open: {
                true: ''
              }
            },
            compoundVariants: [
              {
                zoom: true,
                open: false,
                class: 'cursor-zoom-in'
              }
            ]
          }
        }
      }
    })
  ]
})
If @nuxt/image is installed, the <NuxtImg> component will be used instead of the native img tag for enhanced performance and optimization.

Zoom

By default, images support interactive zoom: clicking an image opens it in a modal overlay with smooth transitions, allowing users to examine details more closely.

To prevent zoom on a specific image, add the :zoom="false" attribute.

Image without zoom

![Image without zoom](/b24ui/assets/demo/b24rich_new.png){:zoom="false"}

Size

Images automatically adapt to their container while maintaining aspect ratio. You can control sizing through markdown or HTML attributes when needed.

Small Image

![Small Image](/assets/demo/b24rich_new.png){width="300"}

Iframes

Easily embed interactive content like CodeSandbox, Figma, or YouTube.

YouTube

<iframe src="https://www.youtube-nocookie.com/embed/PH59xb36_hM?si=VyiXBmDzsAUb-pXT" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen style="aspect-ratio: 16/9; width: 100%;"></iframe>

CodeSandbox

<iframe src="https://codesandbox.io/p/devbox/nuxt-ui-xgrzw5" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen style="aspect-ratio: 16/9; width: 100%;"></iframe>

Figma

<iframe style="border: 1px solid rgba(0, 0, 0, 0.1); width: 100%; height: 450px;" src="https://embed.figma.com/file/1544369209862884086/hf_embed?community_viewer=true&embed_host=fastma&fuid=960610330589944894&kind=file&page-selector=0&viewer=1" allowfullscreen></iframe>

Lists and tables

Structure data effectively using designed lists and adaptive tables for better readability.

Code

Render code snippets and highlighted code blocks, complete with clipboard copying.

On this page

  • Images
    • Zoom
    • Size
  • Iframes
    • YouTube
    • CodeSandbox
    • Figma
Releases
Published under MIT License.

Copyright © 2024-present Bitrix24