Aspect Ratio

Cinematic Banner

A 21:9 band that becomes 4:3 on a phone: at 360 pixels the cinematic ratio collapses into a 154-pixel slot.

  • aspect ratio
  • banner
  • hero
  • responsive

Preview

1440pxHost theme

Use it with AI

  1. 1. Copy the link.
  2. 2. Write to your agent in your own words and drop the link into the sentence.
  3. 3. The agent opens the link and installs the component from the registry.

put this in the header: https://vibeui.ru/c/aspect-005?lang=en

Build a page in an eveningReady-made blocks, one-command install and instructions your agent can follow.Open the catalog
Show the full instructions

What the link says, spelled out. Use it when your agent cannot open links — paste this text instead.

# Install and place "aspect-005" (Cinematic Banner) from VibeUI

## 1. Install first — do not skip, do not recreate
Run this exact command before writing any code:
npx shadcn@latest add https://vibeui.ru/r/aspect-005.json

Registry item: https://vibeui.ru/r/aspect-005.json
Installs to: components/vibeui/aspect-005.tsx (the exact path follows this project's components.json aliases).
npm dependencies: none.
Registry dependencies: none.

Install it from the registry. Do not recreate it from the description,
do not substitute a similar component from another library, and do not
rewrite it to match the project's existing style.

## 2. What it is
A 21:9 band that becomes 4:3 on a phone: at 360 pixels the cinematic ratio collapses into a 154-pixel slot.

A wide 21:9 band with a heading, description and button on the left. In a narrow column it switches itself to 4:3, because the cinematic ratio degenerates into a slot on a phone. Zero dependencies, one file, its own palette, no client JS.

## 3. How to use it
import { Aspect005 } from "@/components/vibeui/aspect-005"

<Aspect005
  title="Build a page in an evening"
  actionLabel="Open the catalog"
  actionHref="/components"
/>

Read the installed file for the full prop list.

## 4. Where to place it
This is a small inline component. Put it exactly where the user asked,
inside the existing markup. Do not create a new page, section or
wrapper for it. If a similar control already sits in that spot,
replace it instead of adding a second one.

Placement: ___
(The user fills this line in. If it is still blank, ask where to put it
instead of guessing.)

## 5. Keep exactly as installed
- the local --vibeui-aspect-005-* palette — do not swap it for your theme tokens
- the ratio switch in a narrow column: 21:9 on a phone leaves a band a line and a half tall
- the layout on the inner frame: a container query does not apply to the container itself
- the cqi-based type and padding — measured against the band, not the window
- the text width limit: a line spanning the whole banner does not read
- the text contrast: a gradient sits beneath it, not a flat fill

## 6. You may change
- the title and description copy
- actionLabel and actionHref — the band's action
- the accent through the accent prop — the glow and the button
- the photo: put an <img> inside the frame and it sits under the text

## 7. Rules
- The band expects the full page width. In a 20rem column it becomes an ordinary card — that is fine.
- Do not add a second button: a banner has one action, otherwise it stops being a banner.
- A photo inside needs an alt — or aria-hidden if it is purely decorative.
- Do not lift the CSS variables into globals.css: the component has to stay a single file.

## 8. Verify
- it renders with no console errors;
- it looks like the preview on the VibeUI page you copied this from;
- if it does not, you changed something listed in section 5 — put it back.

For developers

npx shadcn@latest add https://vibeui.ru/r/aspect-005.json
https://vibeui.ru/r/aspect-005.json

Компонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-aspect-005-*. Соотношение и вся раскладка живут на внутренней рамке, а не на корне: корень объявлен контейнером, а контейнерный запрос применяется только к потомкам. От 30rem собственной ширины пропорция переключается с 21:9 на 4:3. Кегль и отступы считаются в cqi.

Component source

The same file your agent installs. Here in case you would rather copy it by hand.

import type { ComponentPropsWithoutRef, CSSProperties } from "react"

export type Aspect005Props = Omit<
  ComponentPropsWithoutRef<"div">,
  "title" | "children"
> & {
  title?: string
  description?: string
  actionLabel?: string
  actionHref?: string
  accent?: string
}

// Идея компонента: широкая полоса 21:9 — киношная пропорция для баннера во
// всю ширину страницы. Такая полоса не должна становиться высокой на телефоне,
// поэтому на узкой ширине соотношение переключается на 4:3 через container:
// 21:9 в 360 пикселях превратилось бы в щель высотой 154 пикселя.
const STYLES = `
:where([data-vibeui-block="aspect-005"]){
--vibeui-aspect-005-ink:oklch(0.2 0.02 265);
--vibeui-aspect-005-fg:oklch(0.99 0.003 265);
--vibeui-aspect-005-muted:oklch(0.84 0.012 265);
--vibeui-aspect-005-accent:oklch(0.72 0.16 195);
--vibeui-aspect-005-radius:1rem;
--vibeui-aspect-005-ratio:21 / 9;
--vibeui-aspect-005-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
container-type:inline-size;
}
[data-vibeui-block="aspect-005"]{display:block;width:100%;box-sizing:border-box}
/* Раскладка живёт на внутренней рамке, а не на корне: контейнерный запрос
   применяется к потомкам контейнера, но не к нему самому. */
[data-vibeui-block="aspect-005"] [data-part="frame"]{
position:relative;display:flex;align-items:center;
width:100%;box-sizing:border-box;overflow:hidden;
aspect-ratio:var(--vibeui-aspect-005-ratio);
border-radius:var(--vibeui-aspect-005-radius);
background:
radial-gradient(80% 140% at 12% 50%,color-mix(in oklab,var(--vibeui-aspect-005-accent) 40%,transparent),transparent 60%),
linear-gradient(120deg,var(--vibeui-aspect-005-ink),oklch(0.3 0.05 285));
color:var(--vibeui-aspect-005-fg);font-family:var(--vibeui-aspect-005-font);
}
[data-vibeui-block="aspect-005"] [data-part="frame"] img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
[data-vibeui-block="aspect-005"] [data-part="text"]{
position:relative;display:flex;flex-direction:column;gap:0.375rem;
max-width:32rem;padding:0 clamp(1rem,4cqi,3rem);
}
[data-vibeui-block="aspect-005"] [data-part="title"]{
margin:0;font-size:clamp(1.125rem,3.4cqi,2rem);line-height:1.15;letter-spacing:-0.02em;font-weight:670;
}
[data-vibeui-block="aspect-005"] [data-part="description"]{
margin:0;font-size:clamp(0.8125rem,1.5cqi,1rem);line-height:1.5;color:var(--vibeui-aspect-005-muted);
}
[data-vibeui-block="aspect-005"] [data-part="action"]{
align-self:flex-start;margin-top:0.5rem;
display:inline-flex;align-items:center;height:2.25rem;padding:0 1rem;
border-radius:0.5rem;text-decoration:none;
background:var(--vibeui-aspect-005-accent);color:oklch(0.18 0.02 195);
font-size:0.875rem;font-weight:650;
}
[data-vibeui-block="aspect-005"] [data-part="action"]:hover{filter:brightness(0.95)}
[data-vibeui-block="aspect-005"] [data-part="action"]:focus-visible{outline:2px solid var(--vibeui-aspect-005-accent);outline-offset:3px}
/* Узкая полоса: 21:9 на телефоне превращается в щель, поэтому 4:3. */
@container (max-width: 30rem){
[data-vibeui-block="aspect-005"] [data-part="frame"]{--vibeui-aspect-005-ratio:4 / 3}
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="aspect-005"] *{animation:none!important;transition:none!important}}
`

/**
 * Широкая полоса 21:9, которая на телефоне становится 4:3.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Aspect005({
  title = "Соберите страницу за вечер",
  description = "Готовые блоки, установка одной командой и инструкция для ИИ-агента.",
  actionLabel = "Открыть каталог",
  actionHref = "#",
  accent,
  className,
  style,
  ...props
}: Aspect005Props) {
  const palette = {
    ...(accent ? { "--vibeui-aspect-005-accent": accent } : null),
    ...style,
  } as CSSProperties

  return (
    <>
      <style href="vibeui-aspect-005" precedence="medium">
        {STYLES}
      </style>
      <div
        {...props}
        data-vibeui-block="aspect-005"
        className={className}
        style={palette}
      >
        <div data-part="frame">
          <span data-part="text">
            <span data-part="title">{title}</span>
            {description ? (
              <span data-part="description">{description}</span>
            ) : null}
            {actionLabel ? (
              <a data-part="action" href={actionHref}>
                {actionLabel}
              </a>
            ) : null}
          </span>
        </div>
      </div>
    </>
  )
}