Saltar al contenido
DS

Patrones

Valoración de Google <GoogleRating>

La línea de confianza de las landings: logo de Google, nota y cinco estrellas (sin número de opiniones).

import GoogleRating from '@vivla-cms/cms-blocks/renderers/parts/GoogleRating.astro'

Ejemplos

Los dos tamaños

md (logo de 40 px, texto de cuerpo) para el hero, «+400 propietarios» y el panel de gracias de las landings; sm (logo de 16 px, texto pequeño) para la barra fija. Siempre la nota y cinco estrellas, nunca un número de opiniones (diseño, 16/10). La nota la escribe el editor en la landing («Nota en Google»): sin nota, la línea no se pinta. La «G» es la marca de Google y conserva sus colores.

Estrellas sobre fondo oscuro y claro

tone="dark" (por defecto en md): estrellas en terracota 200, para la foto del hero y la banda oscura de opiniones. tone="light" (por defecto en sm): terracota 500, para la barra fija y la tarjeta del formulario.

Props

Props de GoogleRating
Prop Valores Por defecto Para qué
score * string — —
label * string — Accessible name of the whole line, e.g. «Valoración en Google».
size smmd 'md' —
tone darklight size === 'sm' ? 'light' : 'dark' —

Notas del código

El comentario de cabecera de GoogleRating.astro, tal cual (en inglés, como el código): si cambia el código, cambia esto.

«G 4,6 / 5 ★★★★★», the trust line of the performance landings (Figma Landings Performance: hero pill 409:1187, owners band 409:1235, fixed bar 216:3179, thank-you panel 201:4132).

size   md = 40 px logo, body text (hero, owners, thank-you) ·
       sm = 16 px logo, small text (fixed bar)
tone   the stars: terracotta 200 on dark grounds (hero photo, owners band,
       the md default), terracotta 500 on light ones (fixed bar, form card;
       the sm default) — Figma 16/10.

No review count: the «645 opiniones» was not true and design dropped it (Jaime, 16/10) — only the score and five stars. The score is data the editor types (the landing's «Nota en Google»), never a default: with no score the caller renders nothing. The «G» is Google's own mark, so it keeps its brand colours (inline SVG, the one place hex is allowed); the text follows the theme's roles. The line is ONE image to assistive tech (role="img" + the full sentence as its name, the visible pieces aria-hidden): a name on a bare <p> is ignored (axe aria-prohibited-attr).

Dónde se usa

3 veces en 3 archivos de la web y los bloques del CMS.

Ver los archivos
esc