Display

Counter Badge Tile

A tile with a corner counter: the badge is cut out of the tile by a ring in the surface colour, and the number is capped at "99+" so the corner never sprawls.

  • icontile
  • badge
  • counter
  • notification

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-005?lang=en

12Inbox
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-005" (Counter Badge Tile) 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-005.json

Registry item: https://vibeui.ru/r/icontile-005.json
Installs to: components/vibeui/icontile-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 tile with a corner counter: the badge is cut out of the tile by a ring in the surface colour, and the number is capped at "99+" so the corner never sprawls.

A counter tile: a corner badge with a surface-coloured ring, a "99+" cap and an accessible label. Zero dependencies, one file, no client JS.

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

<Icontile005 glyph="✉" count={12} label="Inbox" max={99} />

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-005-* palette — do not swap it for your theme tokens
- the badge ring in the surface colour: with a plain gap the badge drifts off the corner
- the "99+" cap — a three-digit number stretches the badge and breaks the tile corner
- hiding the badge at zero: an empty circle is worse than no badge at all
- the aria-label on the badge so "12" is read as "12 unread" rather than a bare number
- the component's own light surface: the caption is dark and disappears on a dark catalog background

## 6. You may change
- the number in the badge through count
- the cap threshold through max
- the tile glyph through glyph and the caption text
- the badge colour through the --vibeui-icontile-005-badge variable

## 7. Rules
- The badge ring must match the real background: change --vibeui-icontile-005-surface on a coloured panel.
- The counter is not live: updating the number is the parent's job, the component holds no state.
- Negative values are not handled: clamp them to zero on the data side.
- 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-005.json
https://vibeui.ru/r/icontile-005.json

Серверный компонент, хуков нет. Бейдж позиционирован absolute относительно плитки и вырезан из неё кольцом box-shadow цвета подложки — отступом такого разделения не добиться, бейдж отъезжает от угла. Порог задаётся пропом max: всё, что больше, показывается как «99+», иначе трёхзначное число растягивает бейдж. Нулевой счётчик прячет бейдж целиком: пустой кружок сообщает «непрочитанных нет» хуже, чем его отсутствие. У бейджа есть aria-label, поэтому «12» читается как «12 непрочитанных». Подложка светлая, подпись тёмная.

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 Icontile005Props = Omit<
  ComponentPropsWithoutRef<"span">,
  "children"
> & {
  glyph?: string
  count?: number
  label?: string
  max?: number
}

// Идея компонента: плитка со счётчиком в углу. Счётчик отделён от плитки
// кольцом цвета подложки, а не отступом: кольцо режет плитку и бейдж читается
// на любом фоне, не отъезжая от угла. Число обрезано порогом «99+» — трёхзначный
// счётчик растягивает бейдж и ломает угол. Ноль прячет бейдж: пустой кружок
// сообщает «непрочитанных нет» хуже, чем его отсутствие.
const STYLES = `
:where([data-vibeui-block="icontile-005"]){
--vibeui-icontile-005-size:2.5rem;
--vibeui-icontile-005-hue:262;
--vibeui-icontile-005-surface:oklch(1 0 0);
--vibeui-icontile-005-border:oklch(0.9 0.006 265);
--vibeui-icontile-005-fg:oklch(0.26 0.014 265);
--vibeui-icontile-005-badge:oklch(0.56 0.2 25);
--vibeui-icontile-005-font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
}
/* Своя светлая подложка: подпись тёмная, а кольцо бейджа берёт её цвет. */
[data-vibeui-block="icontile-005"]{
display:inline-flex;align-items:center;gap:0.625rem;
box-sizing:border-box;padding:0.5rem 0.875rem 0.5rem 0.5rem;
background:var(--vibeui-icontile-005-surface);
border:1px solid var(--vibeui-icontile-005-border);border-radius:0.875rem;
font-family:var(--vibeui-icontile-005-font);color:var(--vibeui-icontile-005-fg);
font-size:0.8125rem;
}
[data-vibeui-block="icontile-005"] [data-part="tile"]{
position:relative;display:grid;place-items:center;flex:none;
width:var(--vibeui-icontile-005-size);height:var(--vibeui-icontile-005-size);
border-radius:0.75rem;
background:oklch(0.93 0.04 var(--vibeui-icontile-005-hue));
color:oklch(0.44 0.16 var(--vibeui-icontile-005-hue));
font-size:calc(var(--vibeui-icontile-005-size) * 0.44);line-height:1;
}
/* Кольцо цвета подложки режет плитку: бейдж читается на любом фоне. */
[data-vibeui-block="icontile-005"] [data-part="badge"]{
position:absolute;top:-0.3125rem;right:-0.3125rem;
display:inline-flex;align-items:center;justify-content:center;
min-width:1.125rem;height:1.125rem;padding:0 0.25rem;box-sizing:border-box;
border-radius:9999px;
background:var(--vibeui-icontile-005-badge);
color:oklch(0.99 0 0);
box-shadow:0 0 0 2px var(--vibeui-icontile-005-surface);
font-size:0.625rem;font-weight:700;line-height:1;
font-variant-numeric:tabular-nums;
}
[data-vibeui-block="icontile-005"] [data-part="label"]{font-weight:600}
@media (prefers-reduced-motion:reduce){[data-vibeui-block="icontile-005"] *{animation:none!important;transition:none!important}}
`

/**
 * Плитка со счётчиком в углу: кольцо подложки и порог «99+».
 * Один файл, ноль зависимостей, собственная палитра.
 */
export function Icontile005({
  glyph = "✉",
  count = 12,
  label = "Входящие",
  max = 99,
  className,
  style,
  ...props
}: Icontile005Props) {
  const shown = count > max ? `${max}+` : String(count)

  return (
    <>
      <style href="vibeui-icontile-005" precedence="medium">
        {STYLES}
      </style>
      <span
        {...props}
        data-vibeui-block="icontile-005"
        className={className}
        style={style as CSSProperties}
      >
        <span data-part="tile">
          <span aria-hidden="true">{glyph}</span>
          {count > 0 ? (
            <span data-part="badge" aria-label={`${shown} непрочитанных`}>
              {shown}
            </span>
          ) : null}
        </span>
        <span data-part="label">{label}</span>
      </span>
    </>
  )
}