Aspect Ratio
Embed Frame
A frame for third-party embeds: without a src it stays a grid placeholder — someone else's iframe loads on click, not on page open.
- aspect ratio
- embed
- map
- iframe
Preview
Use it with AI
- 1. Copy the link.
- 2. Write to your agent in your own words and drop the link into the sentence.
- 3. The agent opens the link and installs the component from the registry.
put this in the header: https://vibeui.ru/c/aspect-007?lang=en
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-007" (Embed Frame) 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-007.json
Registry item: https://vibeui.ru/r/aspect-007.json
Installs to: components/vibeui/aspect-007.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 frame for third-party embeds: without a src it stays a grid placeholder — someone else's iframe loads on click, not on page open.
A 16:10 embed frame: without src it shows a grid placeholder with a pin; with one it renders a lazy iframe carrying a title. A source line sits below the frame. Zero dependencies, one file, its own palette.
## 3. How to use it
import { Aspect007 } from "@/components/vibeui/aspect-007"
<Aspect007
title="Directions map"
src="https://maps.example.com/embed"
source="Source: OpenStreetMap"
/>
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-007-* palette — do not swap it for your theme tokens
- loading="lazy" and title on the iframe: without a title the embed is nameless to a screen reader
- the grid placeholder: an empty rectangle in place of a map reads as broken
- the source line under the frame — third-party content should name its author
- the 16:10 ratio: maps and slides arrive in it
- the figure/figcaption pairing: a frame with a caption is an illustration
## 6. You may change
- src — the embedded document
- title — what is embedded; it also becomes the iframe's title
- source — the attribution line
- the accent through the accent prop — the placeholder pin
## 7. Rules
- A third-party iframe pulls in scripts and cookies: load it after consent where the law requires it.
- Do not pass an unvetted user-supplied URL into src.
- The placeholder imitates no particular map: it is a diagram, not a screenshot of a service.
- 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-007.jsonhttps://vibeui.ru/r/aspect-007.jsonКомпонент самодостаточен: один файл, без зависимостей, собственная палитра в локальных переменных --vibeui-aspect-007-*. Кадр держит 16:10 — привычную пропорцию карты и презентации. У iframe проставлены loading="lazy" и title: без title скринридер называет вставку просто «frame». Заглушка нарисована сеткой из двух градиентов и меткой-каплей, поэтому пустая рамка читается как карта.
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 Aspect007Props = Omit<
ComponentPropsWithoutRef<"div">,
"title" | "children"
> & {
title?: string
/** Адрес встраиваемого документа: карта, таблица, презентация. */
src?: string
/** Подпись под кадром: что именно встроено и откуда. */
source?: string
accent?: string
}
// Идея компонента: рамка для чужого встраиваемого содержимого — карты,
// презентации, таблицы. Пока src не передан, кадр остаётся заглушкой с
// сеткой: чужой iframe грузится по клику, а не при открытии страницы, и
// пустая рамка не должна выглядеть поломкой. У iframe стоит loading="lazy"
// и title — без него скринридер называет вставку «frame».
const STYLES = `
:where([data-vibeui-block="aspect-007"]){
--vibeui-aspect-007-fg:oklch(0.24 0.014 265);
--vibeui-aspect-007-muted:oklch(0.52 0.014 265);
--vibeui-aspect-007-bg:oklch(0.965 0.005 265);
--vibeui-aspect-007-line:oklch(0.9 0.008 265);
--vibeui-aspect-007-border:oklch(0.89 0.006 265);
--vibeui-aspect-007-accent:oklch(0.55 0.2 262);
--vibeui-aspect-007-radius:0.875rem;
--vibeui-aspect-007-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
[data-vibeui-block="aspect-007"]{
display:flex;flex-direction:column;gap:0.5rem;
width:100%;box-sizing:border-box;
color:var(--vibeui-aspect-007-fg);font-family:var(--vibeui-aspect-007-font);
}
[data-vibeui-block="aspect-007"] [data-part="frame"]{
position:relative;aspect-ratio:16 / 10;overflow:hidden;
border:1px solid var(--vibeui-aspect-007-border);
border-radius:var(--vibeui-aspect-007-radius);
background:var(--vibeui-aspect-007-bg);
}
[data-vibeui-block="aspect-007"] iframe{position:absolute;inset:0;width:100%;height:100%;border:0}
/* Сетка-заглушка: пустая рамка карты должна читаться как карта. */
[data-vibeui-block="aspect-007"] [data-part="grid"]{
position:absolute;inset:0;
background-image:
linear-gradient(var(--vibeui-aspect-007-line) 1px,transparent 1px),
linear-gradient(90deg,var(--vibeui-aspect-007-line) 1px,transparent 1px);
background-size:2.5rem 2.5rem;
}
[data-vibeui-block="aspect-007"] [data-part="pin"]{
position:absolute;left:50%;top:50%;width:0.875rem;height:0.875rem;
margin:-0.9375rem 0 0 -0.4375rem;
border:2px solid var(--vibeui-aspect-007-accent);border-radius:9999px 9999px 9999px 0;
transform:rotate(-45deg);background:oklch(1 0 0);
}
[data-vibeui-block="aspect-007"] [data-part="hint"]{
position:absolute;left:0;right:0;bottom:0.75rem;text-align:center;
font-size:0.75rem;color:var(--vibeui-aspect-007-muted);
}
[data-vibeui-block="aspect-007"] [data-part="source"]{
font-size:0.75rem;color:var(--vibeui-aspect-007-muted);
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="aspect-007"] *{animation:none!important;transition:none!important}}
`
/**
* Рамка для встраиваемого содержимого: заглушка до загрузки iframe.
* Один файл, ноль зависимостей, собственная палитра.
*/
export function Aspect007({
title = "Карта проезда к студии",
src,
source = "Источник: OpenStreetMap",
accent,
className,
style,
...props
}: Aspect007Props) {
const palette = {
...(accent ? { "--vibeui-aspect-007-accent": accent } : null),
...style,
} as CSSProperties
return (
<>
<style href="vibeui-aspect-007" precedence="medium">
{STYLES}
</style>
<figure
{...props}
data-vibeui-block="aspect-007"
className={className}
style={palette}
>
<div data-part="frame">
{src ? (
<iframe src={src} title={title} loading="lazy" />
) : (
<>
<span data-part="grid" aria-hidden="true" />
<span data-part="pin" aria-hidden="true" />
<span data-part="hint">{title}</span>
</>
)}
</div>
{source ? <figcaption data-part="source">{source}</figcaption> : null}
</figure>
</>
)
}