Display

Tile Size Scale

A tile size scale as a single exhibit: three steps derived from a shared unit, with radius and glyph size taken as fractions of the size.

  • icontile
  • scale
  • sizes
  • design-system

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/icontile-004?lang=en

sm32px
md44px
lg56px
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 "icontile-004" (Tile Size Scale) 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/icontile-004.json

Registry item: https://vibeui.ru/r/icontile-004.json
Installs to: components/vibeui/icontile-004.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 tile size scale as a single exhibit: three steps derived from a shared unit, with radius and glyph size taken as fractions of the size.

A row of tiles in three sizes: the steps are multiples of a shared unit and every step keeps the same proportions. Zero dependencies, one file, no client JS.

## 3. How to use it
import { Icontile004 } from "@/components/vibeui/icontile-004"

<Icontile004 glyph="◆" shape="squircle" />

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-icontile-004-* palette — do not swap it for your theme tokens
- the steps as multiples of a shared unit: loose numbers drift apart at the first edit
- radius and glyph size as fractions of the size — otherwise the small tile looks chunkier than the large one
- the step captions: a scale without names is just three random squares
- the bottom alignment of the row so the captions sit on one line
- the component's own light surface: the step captions are dark and vanish on a dark background

## 6. You may change
- the glyph inside the tiles through glyph
- the shape of the whole row through shape: square, circle or squircle
- the scale unit through the --vibeui-icontile-004-step variable
- the tile hue through the --vibeui-icontile-004-hue variable

## 7. Rules
- There are exactly three steps: a fourth almost always means the scale was not thought through.
- The pixel captions assume a 16px root size; recalculate them for anything else.
- The row does not wrap: on very narrow widths shrink the unit rather than allowing a wrap.
- 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/icontile-004.json
https://vibeui.ru/r/icontile-004.json

Серверный компонент, хуков нет. Ступени sm, md и lg объявлены как кратные переменной --vibeui-icontile-004-step, поэтому шкала правится одним числом, а не тремя. Радиус и кегль знака вычисляются от размера ступени в calc, из-за чего пропорции плитки на всех ступенях одинаковые — это и есть смысл шкалы. Форма переключается на корне через data-shape и действует сразу на весь ряд. Каждая ступень подписана именем и значением в пикселях, поэтому размер выбирают глазами и не изобретают четвёртый. Подложка светлая: подписи ступеней тёмные.

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 Icontile004Props = Omit<
  ComponentPropsWithoutRef<"div">,
  "children"
> & {
  glyph?: string
  shape?: "square" | "circle" | "squircle"
}

// Идея компонента: размерная шкала плитки как один экспонат. Три ступени
// считаются от одного шага: 2rem → 2.75rem → 3.5rem, а радиус и кегль знака
// берутся долей от размера, поэтому пропорции на всех ступенях одинаковые.
// Такой ряд нужен, чтобы выбрать размер глазами и не изобретать четвёртый.
const STYLES = `
:where([data-vibeui-block="icontile-004"]){
--vibeui-icontile-004-step:0.75rem;
--vibeui-icontile-004-hue:262;
--vibeui-icontile-004-surface:oklch(1 0 0);
--vibeui-icontile-004-border:oklch(0.9 0.006 265);
--vibeui-icontile-004-fg:oklch(0.26 0.014 265);
--vibeui-icontile-004-muted:oklch(0.56 0.014 265);
--vibeui-icontile-004-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
/* Своя светлая подложка: подписи ступеней тёмные. */
[data-vibeui-block="icontile-004"]{
display:inline-flex;align-items:flex-end;gap:1.25rem;
box-sizing:border-box;padding:1rem 1.25rem;
background:var(--vibeui-icontile-004-surface);
border:1px solid var(--vibeui-icontile-004-border);border-radius:1rem;
font-family:var(--vibeui-icontile-004-font);color:var(--vibeui-icontile-004-fg);
}
[data-vibeui-block="icontile-004"] [data-part="step"]{
display:flex;flex-direction:column;align-items:center;gap:0.5rem;
}
/* Радиус и кегль — доли размера: пропорции одинаковы на всех ступенях. */
[data-vibeui-block="icontile-004"] [data-part="tile"]{
display:grid;place-items:center;flex:none;
width:var(--vibeui-icontile-004-size);height:var(--vibeui-icontile-004-size);
border-radius:calc(var(--vibeui-icontile-004-size) * 0.28);
background:oklch(0.93 0.04 var(--vibeui-icontile-004-hue));
color:oklch(0.44 0.16 var(--vibeui-icontile-004-hue));
font-size:calc(var(--vibeui-icontile-004-size) * 0.42);
font-weight:650;line-height:1;
}
[data-vibeui-block="icontile-004"] [data-part="step"][data-size="sm"]{--vibeui-icontile-004-size:calc(var(--vibeui-icontile-004-step) * 2.667)}
[data-vibeui-block="icontile-004"] [data-part="step"][data-size="md"]{--vibeui-icontile-004-size:calc(var(--vibeui-icontile-004-step) * 3.667)}
[data-vibeui-block="icontile-004"] [data-part="step"][data-size="lg"]{--vibeui-icontile-004-size:calc(var(--vibeui-icontile-004-step) * 4.667)}
[data-vibeui-block="icontile-004"][data-shape="circle"] [data-part="tile"]{border-radius:9999px}
[data-vibeui-block="icontile-004"][data-shape="squircle"] [data-part="tile"]{border-radius:calc(var(--vibeui-icontile-004-size) * 0.44)}
[data-vibeui-block="icontile-004"] [data-part="name"]{
font-size:0.75rem;font-weight:650;letter-spacing:0.02em;
}
[data-vibeui-block="icontile-004"] [data-part="value"]{
font-size:0.6875rem;color:var(--vibeui-icontile-004-muted);
font-variant-numeric:tabular-nums;
}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="icontile-004"] *{animation:none!important;transition:none!important}}
`

const STEPS = [
  { size: "sm", value: "32px" },
  { size: "md", value: "44px" },
  { size: "lg", value: "56px" },
] as const

/**
 * Размерная шкала плитки: три ступени от одного шага и общих пропорций.
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Icontile004({
  glyph = "◆",
  shape = "square",
  className,
  style,
  ...props
}: Icontile004Props) {
  return (
    <>
      <style href="vibeui-icontile-004" precedence="medium">
        {STYLES}
      </style>
      <div
        {...props}
        data-vibeui-block="icontile-004"
        data-shape={shape}
        className={className}
        style={style as CSSProperties}
      >
        {STEPS.map((step) => (
          <div key={step.size} data-part="step" data-size={step.size}>
            <span data-part="tile" aria-hidden="true">
              {glyph}
            </span>
            <span data-part="name">{step.size}</span>
            <span data-part="value">{step.value}</span>
          </div>
        ))}
      </div>
    </>
  )
}