ComponentesComponents

TarjetaCard

Contenedor con cabecera, contenido y acciones.Container with header, content and actions.

DiseñoDesign: coss ui (MIT) · card.tsxMITambos · densidaddensity media · sobriaMarkdownJSON

CódigoCode

<article class="c-card">
  <header class="c-card__header">
    <h3 class="c-card__title">Plan Pro</h3>
    <p class="c-card__description">Para equipos que publican cada semana.</p>
    <div class="c-card__action"><span class="c-badge c-badge--secondary">Popular</span></div>
  </header>
  <div class="c-card__panel">
    <p style="font-size:2rem;font-weight:600;letter-spacing:-.02em;line-height:1">S/ 49 <span style="font-size:.875rem;font-weight:400;color:var(--muted-foreground)">al mes</span></p>
  </div>
  <footer class="c-card__footer">
    <button class="c-btn c-btn--outline" type="button">Ver detalles</button>
    <button class="c-btn c-btn--primary" type="button">Elegir plan</button>
  </footer>
</article>

«Todo» trae tokens, dependencias y componente en un solo archivo, listo para abrir o dárselo a un agente.“All” bundles tokens, dependencies and the component in one file, ready to open or hand to an agent.

InstalaciónInstallation

  1. Agrega una vezAdd once tokens.css (colores, radios, tema oscuro).(colors, radii, dark theme).
  2. Agrega también:Also add: BotónButton, Badge.
  3. Copia los archivos:Copy the files: card.html, card.css.
  4. Para el tema oscuro, pon la claseFor the dark theme, add the class dark ento <html>.

Cuándo usarloWhen to use it

ÚsaloUse it

  • Para agrupar un resumen con sus acciones.
  • To group a summary with its actions.

Mejor noAvoid

  • Envolviendo todo en un enlace: enlaza desde el título.
  • Wrapping everything in a link: link from the title.

AccesibilidadAccessibility

article
TabRecorre las accionesMoves through the actions
  • <article> con título h3.
  • Si toda la tarjeta debe ser clicable, el enlace va en el título y se extiende con ::after.
  • <article> with an h3 title.
  • If the whole card must be clickable, the link sits on the title and stretches with ::after.

Cómo probarloHow to test it

  • Recorre con Tab: solo se detiene en los dos botones.
  • Tab through: it stops only on the two buttons.

CréditosCredits