Patrones
Tarjeta
La tarjeta agrupa información en contenedores flexibles para permitir explorar una colección de elementos y acciones relacionadas.
Cuándo utilizar
Utilizar
- Para agrupar información relacionada, como servicios, productos o características
- Si se necesita incluir botones de acción, como “Ver más” o “Leer”, las tarjetas son efectivas para concentrar acciones específicas en un solo lugar.
- En casos de listas extensas (productos, artículos, etc.), las tarjetas permiten dividir la información en partes más manejables y legibles.
Anatomía
- Imagen (opcional): suele ser una imagen que contextualiza el contenido al que da acceso la propia Card.
- Encabezado o título: es el texto que identifica el contenido de la propia Card.
- Descripción: es un texto de apoyo a modo de breve descripción o resumen.
- Llamadas a la acción: botones o CTA.
- Subtítulo. Suele ser texto, como por ejemplo, la categoría a la que pertenece el artículo, una fecha, etc.
- Íconos: Las Cards también pueden incluir iconografía para ejecutar acciones.
Pautas
Tipos
Existen muchas combinaciones de contenido para una tarjeta, lo que permite diversas aplicaciones del componente. Es posible incluir contenido multimedia, contenido del cuerpo y pie de página.
Mejores prácticas
- Mantener un diseño coherente entre las tarjetas para que se puedan reconocer fácilmente.
- Asegurarse de que el texto y los elementos dentro de las tarjetas sean legibles y accesibles.
- Utilizar un espaciado adecuado entre las tarjetas para evitar que se vean abarrotadas.
Códigos CSS
Copiar Código CSS/* ============================================
TARJETA (Card) — Sistema de Diseno UDP
============================================ *//* — Base Card — */
.tarjeta {
background-color: #ffffff;
border: 0.77px solid transparent;
padding: 20px;
display: flex;
flex-direction: column;
font-family: ‘Work Sans’, sans-serif;
color: #1c1c1c;
width: 308px;
box-sizing: border-box;
cursor: pointer;
transition: background-color 0.2s ease;
}.tarjeta__contenido {
display: flex;
flex-direction: column;
gap: 40px;
flex: 1;
}.tarjeta__cuerpo {
display: flex;
flex-direction: column;
gap: 16px;
}.tarjeta__info {
display: flex;
flex-direction: column;
gap: 12px;
}.tarjeta__titulo {
font-family: ‘ABC Arizona Flare’, serif;
font-weight: 500;
font-size: 20px;
line-height: 1.3;
color: #1c1c1c;
margin: 0;
}.tarjeta__subtitulo {
font-family: ‘Work Sans’, sans-serif;
font-weight: 400;
font-size: 16px;
line-height: 1.5;
color: #1c1c1c;
}.tarjeta__meta {
display: flex;
flex-direction: column;
gap: 8px;
}.tarjeta__meta-item {
font-family: ‘Work Sans’, sans-serif;
font-weight: 400;
font-size: 14px;
line-height: 20px;
color: #1c1c1c;
}/* — Type Label (icon + text) — */
.tarjeta__tipo {
display: flex;
flex-direction: row;
align-items: center;
gap: 6px;
}.tarjeta__tipo-icono {
width: 16px;
height: 16px;
flex-shrink: 0;
}.tarjeta__tipo-icono svg {
width: 16px;
height: 16px;
stroke: #1c1c1c;
stroke-width: 1.33;
fill: none;
}.tarjeta__tipo-texto {
font-family: ‘Work Sans’, sans-serif;
font-weight: 500;
font-size: 14px;
line-height: 20px;
color: #1c1c1c;
}/* — Image — */
.tarjeta__imagen {
width: 100%;
height: 196px;
object-fit: cover;
display: block;
}.tarjeta__imagen–circular {
width: 128px;
height: 128px;
border-radius: 50%;
object-fit: cover;
}/* — Fecha (Date Badge) Sub-component — */
.tarjeta-fecha {
width: 56px;
height: 72px;
background-color: #1c1c1c;
border: 1.04px solid #1c1c1c;
padding: 4px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
box-sizing: border-box;
flex-shrink: 0;
}.tarjeta-fecha__dia {
font-family: ‘Work Sans’, sans-serif;
font-weight: 600;
font-size: 20px;
line-height: 28px;
color: #ffffff;
}.tarjeta-fecha__mes {
font-family: ‘Necto Mono’, monospace;
font-weight: 400;
font-size: 12px;
line-height: 1.45;
color: #ffffff;
text-transform: uppercase;
}.tarjeta-fecha__anio {
font-family: ‘Work Sans’, sans-serif;
font-weight: 400;
font-size: 12px;
line-height: 18px;
color: #ffffff;
}/* — Card Type: Agenda — */
.tarjeta–agenda .tarjeta__cuerpo {
gap: 16px;
}.tarjeta–agenda .tarjeta__cabecera {
display: flex;
flex-direction: row;
gap: 24px;
align-items: flex-start;
}.tarjeta–agenda .tarjeta__cabecera-texto {
display: flex;
flex-direction: column;
gap: 16px;
flex: 1;
}.tarjeta–agenda .tarjeta__ubicacion,
.tarjeta–agenda .tarjeta__hora {
font-family: ‘Work Sans’, sans-serif;
font-weight: 400;
font-size: 14px;
line-height: 20px;
color: #1c1c1c;
}/* — Card Type: Noticia — */
.tarjeta–noticia .tarjeta__cuerpo {
gap: 16px;
}/* — Card Type: Equipo — */
.tarjeta–equipo {
gap: 16px;
}.tarjeta–equipo .tarjeta__contenido {
gap: 16px;
}/* — Card Type: Programa — */
.tarjeta–programa .tarjeta__imagen-wrapper {
width: 268px;
height: 196px;
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
}/* — Card Type: Video — */
.tarjeta–video {
gap: 40px;
}.tarjeta–video .tarjeta__imagen-wrapper {
position: relative;
width: 268px;
height: 196px;
display: flex;
align-items: center;
justify-content: center;
}.tarjeta–video .tarjeta__play-btn {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 72px;
height: 36px;
background-color: #1c1c1c;
border-radius: 9999px;
border: none;
display: flex;
align-items: center;
justify-content: center;
padding: 0 24px;
cursor: pointer;
}.tarjeta–video .tarjeta__play-btn svg {
width: 16px;
height: 16px;
stroke: #ffffff;
stroke-width: 1.6;
fill: none;
}.tarjeta–video .tarjeta__facultad {
font-family: ‘Work Sans’, sans-serif;
font-weight: 400;
font-size: 14px;
line-height: 20px;
color: #1c1c1c;
}/* — Card Type: Entrevista — */
.tarjeta–entrevista .tarjeta__imagen {
width: 128px;
height: 128px;
border-radius: 50%;
object-fit: cover;
}/* — Card Type: Podcast — */
.tarjeta–podcast .tarjeta__reproductor {
display: flex;
flex-direction: column;
gap: 20px;
}.tarjeta–podcast .tarjeta__progreso {
display: flex;
flex-direction: row;
align-items: center;
gap: 8px;
height: 20px;
}.tarjeta–podcast .tarjeta__tiempo {
font-family: ‘Work Sans’, sans-serif;
font-weight: 400;
font-size: 12px;
line-height: 16px;
color: #1c1c1c;
}.tarjeta–podcast .tarjeta__barra {
flex: 1;
height: 4px;
background-color: #e7e7e7;
border-radius: 2px;
position: relative;
}.tarjeta–podcast .tarjeta__barra-progreso {
height: 100%;
background-color: #1c1c1c;
border-radius: 2px;
}.tarjeta–podcast .tarjeta__controles {
display: flex;
flex-direction: row;
align-items: center;
gap: 16px;
}.tarjeta–podcast .tarjeta__play-btn {
width: 72px;
height: 36px;
background-color: #1c1c1c;
border-radius: 9999px;
border: none;
display: flex;
align-items: center;
justify-content: center;
padding: 0 24px;
cursor: pointer;
}.tarjeta–podcast .tarjeta__play-btn svg {
width: 16px;
height: 16px;
stroke: #ffffff;
stroke-width: 1.6;
fill: none;
}.tarjeta–podcast .tarjeta__volumen svg {
width: 20px;
height: 20px;
stroke: #1c1c1c;
stroke-width: 1.38;
fill: none;
}/* — Card Type: Relacionado — */
.tarjeta–relacionado .tarjeta__titulo {
font-size: 20px;
line-height: 1.3;
}.tarjeta–relacionado .tarjeta__enlace {
width: 24px;
height: 24px;
border-radius: 9999px;
display: flex;
align-items: center;
justify-content: center;
}.tarjeta–relacionado .tarjeta__enlace svg {
width: 16px;
height: 16px;
stroke-width: 1.34;
fill: none;
}/* — Card Type: Publicacion — */
.tarjeta–publicacion .tarjeta__cuerpo {
gap: 16px;
}/* — Card Type: Convocatoria — */
.tarjeta–convocatoria .tarjeta__detalle {
display: flex;
flex-direction: column;
gap: 8px;
}.tarjeta–convocatoria .tarjeta__detalle-item {
font-family: ‘Work Sans’, sans-serif;
font-weight: 400;
font-size: 14px;
line-height: 20px;
color: #1c1c1c;
}/* — Card Type: Boletin — */
.tarjeta–boletin .tarjeta__descarga-btn {
width: 72px;
height: 36px;
background-color: #1c1c1c;
border-radius: 9999px;
border: none;
display: flex;
align-items: center;
justify-content: center;
padding: 0 24px;
cursor: pointer;
}.tarjeta–boletin .tarjeta__descarga-btn svg {
width: 16px;
height: 16px;
stroke: #ffffff;
stroke-width: 1.34;
fill: none;
}/* — Card Type: Academico — */
.tarjeta–academico .tarjeta__contenido {
gap: 16px;
}.tarjeta–academico .tarjeta__datos {
display: flex;
flex-direction: column;
gap: 40px;
}.tarjeta–academico .tarjeta__bio {
display: flex;
flex-direction: column;
gap: 16px;
}.tarjeta–academico .tarjeta__nombre {
font-family: ‘ABC Arizona Flare’, serif;
font-weight: 500;
font-size: 20px;
line-height: 1.3;
color: #1c1c1c;
}.tarjeta–academico .tarjeta__descripcion {
font-family: ‘Work Sans’, sans-serif;
font-weight: 400;
font-size: 16px;
line-height: 1.5;
color: #1c1c1c;
}.tarjeta–academico .tarjeta__etiquetas {
display: flex;
flex-direction: column;
gap: 8px;
}/* ============================================
STATES
============================================ *//* — Hover — */
.tarjeta:hover {
background-color: var(–tarjeta-color-hover, #e2c1e6);
}/* — Pressed / Active — */
.tarjeta:active {
background-color: var(–tarjeta-color-pressed, #d29cd6);
}/* — Focus — */
.tarjeta:focus,
.tarjeta:focus-visible {
background-color: var(–tarjeta-color-hover, #e2c1e6);
outline: 2px solid #3c7af6;
outline-offset: -2px;
}/* — Disabled — */
.tarjeta–disabled,
.tarjeta:disabled {
background-color: #e7e7e7;
pointer-events: none;
cursor: default;
}.tarjeta–disabled .tarjeta__imagen {
filter: grayscale(100%);
background-color: #1c1c1c;
}.tarjeta–disabled .tarjeta__etiqueta {
background-color: #6d6d6d;
border-color: #6d6d6d;
}.tarjeta–disabled .tarjeta__etiqueta-texto {
color: #e7e7e7;
}/* ============================================
FACULTY COLOR VARIANTS (CSS Custom Properties)
============================================ *//* Derecho */
.tarjeta–derecho {
–tarjeta-color-hover: #e2c1e6;
–tarjeta-color-pressed: #d29cd6;
–tarjeta-color-accent: #854487;
}/* Comunicacion y Letras */
.tarjeta–comunicacion {
–tarjeta-color-hover: #79cfcb;
–tarjeta-color-pressed: #4db4b2;
–tarjeta-color-accent: #2a8a87;
}/* Ciencias Sociales e Historia */
.tarjeta–ciencias-sociales {
–tarjeta-color-hover: #edb4b8;
–tarjeta-color-pressed: #e28a92;
–tarjeta-color-accent: #c0525e;
}/* Carreras Vespertinas */
.tarjeta–vespertinas {
–tarjeta-color-hover: #91bdff;
–tarjeta-color-pressed: #5d99fd;
–tarjeta-color-accent: #3370d6;
}/* Arquitectura, Arte y Diseno */
.tarjeta–arquitectura {
–tarjeta-color-hover: #ffaf9f;
–tarjeta-color-pressed: #ff8167;
–tarjeta-color-accent: #e05a3d;
}/* Administracion y Economia */
.tarjeta–administracion {
–tarjeta-color-hover: #a0c0ff;
–tarjeta-color-pressed: #7a9bff;
–tarjeta-color-accent: #4a6fd6;
}/* Azul UDP */
.tarjeta–azul-udp {
–tarjeta-color-hover: #95b6fb;
–tarjeta-color-pressed: #638ff7;
–tarjeta-color-accent: #3366cc;
}/* Amarillo UDP */
.tarjeta–amarillo-udp {
–tarjeta-color-hover: #f8ff41;
–tarjeta-color-pressed: #fffc0d;
–tarjeta-color-accent: #c4a800;
}/* Rojo UDP */
.tarjeta–rojo-udp {
–tarjeta-color-hover: #ffa59d;
–tarjeta-color-pressed: #ff7064;
–tarjeta-color-accent: #d94030;
}/* Educacion */
.tarjeta–educacion {
–tarjeta-color-hover: #fec973;
–tarjeta-color-pressed: #fca73b;
–tarjeta-color-accent: #d08020;
}/* Ingenieria y Ciencias */
.tarjeta–ingenieria {
–tarjeta-color-hover: #6ce9b1;
–tarjeta-color-pressed: #31d692;
–tarjeta-color-accent: #1aaa6e;
}/* Medicina */
.tarjeta–medicina {
–tarjeta-color-hover: #93cdfd;
–tarjeta-color-pressed: #60b0fa;
–tarjeta-color-accent: #3088d0;
}/* Psicologia */
.tarjeta–psicologia {
–tarjeta-color-hover: #f2d952;
–tarjeta-color-pressed: #ecc623;
–tarjeta-color-accent: #b89a10;
}/* Salud y Odontologia */
.tarjeta–salud {
–tarjeta-color-hover: #75daff;
–tarjeta-color-pressed: #2cc8ff;
–tarjeta-color-accent: #0098cc;
}/* — Arrow color uses accent — */
.tarjeta–relacionado .tarjeta__enlace svg {
stroke: var(–tarjeta-color-accent, #854487);
}