1 estrella en GitHub = 1 componente nuevo.

Portfolio de desarrollador

Dev Contact

Bloque de contacto con una cápsula de tarjetas (email, GitHub, LinkedIn…) y un CTA opcional a la página de contacto.

contactctaportfolio
Vista Previa en Vivo

Uso

Copia y pega este código directamente en tu página de Astro:

astro
---
import { DevContact } from 'astro-component-kit/sections';
---

<DevContact contacts={[{ kind: 'email', label: 'Email', value: 'hi@you.dev', href: 'mailto:hi@you.dev' }]} cta={{ label: 'Start a project', href: '/contact/' }} />
--- import { DevContact } from 'astro-component-kit/sections'; --- <DevContact contacts={[{ kind: 'email', label: 'Email', value: 'hi@you.dev', href: 'mailto:hi@you.dev' }]} cta={{ label: 'Start a project', href: '/contact/' }} />

Ejemplos en contexto

Código real del kit: cómo se usa esta pieza dentro de plantillas, secciones y otros componentes.

Plantilla Portfolio de desarrollador PortfolioHomePage.astro
astro
<DevContact
  text={`${site.status}. Tell me what you are building — I usually reply within a day.`}
  contacts={site.contacts.slice(0, 2)}
  cta={{ label: 'Start a project', href: routes.contact }}
/>
<DevContact text={`${site.status}. Tell me what you are building — I usually reply within a day.`} contacts={site.contacts.slice(0, 2)} cta={{ label: 'Start a project', href: routes.contact }} />

Instalación Manual

Si no estás usando el paquete npm, crea un archivo nuevo y pega el siguiente código: src/components/sections/DevContact.astro:

astro
---
/**
 * DevContact — Contact block for developer portfolios ("Keycap" design): label, title, optional
 * text and a glass capsule of contact cards (email, GitHub, LinkedIn…) with an icon, type, value
 * and an arrow that nudges on hover. An optional CTA links to a full contact page.
 *
 * @param {string} eyebrow - Small mono label. Default 'Contact'.
 * @param {string} title - Heading. Default "Let's talk".
 * @param {string} text - Optional intro.
 * @param {Array<{kind: 'email'|'github'|'linkedin'|'x'|'web', label: string, value: string, href: string}>} contacts - Contact cards.
 * @param {{label: string, href: string}} cta - Optional button.
 * @param {string} className - Extra class.
 *
 * Accessibility: cards are links with visible text; external links open in a new tab with
 * rel="noopener"; focus ring on every card.
 */
interface Contact { kind: 'email' | 'github' | 'linkedin' | 'x' | 'web'; label: string; value: string; href: string }
interface Props {
  eyebrow?: string;
  title?: string;
  text?: string;
  contacts: Contact[];
  cta?: { label: string; href: string };
  className?: string;
}

const { eyebrow = 'Contact', title = "Let's talk", text, contacts = [
  { kind: 'email', label: 'Email', value: 'hello@you.dev', href: 'mailto:hello@you.dev' },
  { kind: 'github', label: 'GitHub', value: 'github.com/you', href: '#' },
], cta, className = '' } = Astro.props;
const icons: Record<Contact['kind'], string> = {
  email: '<rect x="3" y="5" width="18" height="14" rx="2"/><path d="m3 7 9 6 9-6"/>',
  github: '<path d="M9 19c-4.3 1.4-4.3-2.5-6-3m12 5v-3.5c0-1 .1-1.4-.5-2 2.8-.3 5.5-1.4 5.5-6a4.6 4.6 0 0 0-1.3-3.2 4.2 4.2 0 0 0-.1-3.2s-1.1-.3-3.5 1.3a12.3 12.3 0 0 0-6.2 0C6.5 2.8 5.4 3.1 5.4 3.1a4.2 4.2 0 0 0-.1 3.2A4.6 4.6 0 0 0 4 9.5c0 4.6 2.7 5.7 5.5 6-.6.6-.6 1.2-.5 2V21"/>',
  linkedin: '<path d="M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-4 0v7h-4v-7a6 6 0 0 1 6-6zM2 9h4v12H2z"/><circle cx="4" cy="4" r="2"/>',
  x: '<path d="M4 4l16 16M20 4 4 20"/>',
  web: '<circle cx="12" cy="12" r="10"/><path d="M2 12h20M12 2a15 15 0 0 1 0 20 15 15 0 0 1 0-20"/>',
};
---

<section class:list={['dvcn', className]}>
  <div class="dvcn__wrap">
    <p class="dvcn__eyebrow">{eyebrow}</p>
    <h2 class="dvcn__title">{title}</h2>
    {text && <p class="dvcn__text">{text}</p>}
    <ul class="dvcn__grid">
      {contacts.map((c) => {
        const external = !c.href.startsWith('mailto:') && !c.href.startsWith('tel:');
        return (
          <li>
            <a class="dvcn__card" href={c.href} target={external ? '_blank' : undefined} rel={external ? 'noopener noreferrer' : undefined}>
              <span class="dvcn__icon" aria-hidden="true">
                <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" set:html={icons[c.kind] ?? icons.web} />
              </span>
              <span class="dvcn__info">
                <span class="dvcn__type">{c.label}</span>
                <span class="dvcn__value">{c.value}</span>
              </span>
              <span class="dvcn__arrow" aria-hidden="true">{external ? '↗' : '→'}</span>
            </a>
          </li>
        );
      })}
    </ul>
    {cta && <a class="dvcn__cta" href={cta.href}>{cta.label} <span aria-hidden="true">→</span></a>}
  </div>
</section>

<style>
  .dvcn { padding: clamp(2.5rem, 6vw, 4rem) 0; color: var(--c-text-1); }
  .dvcn__wrap { max-width: 1040px; margin: 0 auto; padding: 0 clamp(1rem, 3vw, 1.5rem); }
  .dvcn__eyebrow { margin: 0 0 0.5rem; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--c-text-3); }
  .dvcn__title { margin: 0 0 1rem; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -0.03em; }
  .dvcn__text { margin: 0 0 1.5rem; max-width: 560px; font-size: 0.98rem; line-height: 1.7; color: var(--c-text-2); }
  .dvcn__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; }
  .dvcn__card {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 84px;
    padding: 1.1rem 1.4rem;
    border-radius: 16px;
    background: rgb(var(--ink-rgb, 0 0 0) / 0.035);
    border: 1px solid rgb(var(--ink-rgb, 0 0 0) / 0.07);
    color: var(--c-text-1);
    text-decoration: none;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  }
  .dvcn__card:hover { transform: translateY(-2px); background: var(--c-bg); border-color: rgb(var(--ink-rgb, 0 0 0) / 0.16); box-shadow: 0 14px 30px -12px rgb(var(--ink-rgb, 0 0 0) / 0.2); }
  .dvcn__card:focus-visible { outline: 2px solid var(--c-text-1); outline-offset: 3px; }
  .dvcn__icon { width: 44px; height: 44px; display: grid; place-items: center; flex-shrink: 0; border-radius: 12px; background: var(--c-bg); border: 1px solid rgb(var(--ink-rgb, 0 0 0) / 0.08); }
  .dvcn__info { display: flex; flex-direction: column; min-width: 0; flex: 1; }
  .dvcn__type { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-text-3); }
  .dvcn__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; font-weight: 500; }
  .dvcn__arrow { color: var(--c-text-3); transition: transform 0.25s ease, color 0.25s ease; }
  .dvcn__card:hover .dvcn__arrow { color: var(--c-text-1); transform: translate(3px, -1px); }
  .dvcn__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    margin-top: 1.5rem;
    padding: 0 1.25rem;
    border: 1.5px solid var(--c-text-1);
    border-radius: 2px;
    color: var(--c-text-1);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 2px 2px 0 var(--c-text-1);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }
  .dvcn__cta:hover { transform: translateY(-1px); box-shadow: 3px 3px 0 var(--c-text-1); }
  @media (prefers-reduced-motion: reduce) { .dvcn__card, .dvcn__arrow { transition: none; } }
</style>
--- /** * DevContact — Contact block for developer portfolios ("Keycap" design): label, title, optional * text and a glass capsule of contact cards (email, GitHub, LinkedIn…) with an icon, type, value * and an arrow that nudges on hover. An optional CTA links to a full contact page. * * @param {string} eyebrow - Small mono label. Default 'Contact'. * @param {string} title - Heading. Default "Let's talk". * @param {string} text - Optional intro. * @param {Array<{kind: 'email'|'github'|'linkedin'|'x'|'web', label: string, value: string, href: string}>} contacts - Contact cards. * @param {{label: string, href: string}} cta - Optional button. * @param {string} className - Extra class. * * Accessibility: cards are links with visible text; external links open in a new tab with * rel="noopener"; focus ring on every card. */ interface Contact { kind: 'email' | 'github' | 'linkedin' | 'x' | 'web'; label: string; value: string; href: string } interface Props { eyebrow?: string; title?: string; text?: string; contacts: Contact[]; cta?: { label: string; href: string }; className?: string; } const { eyebrow = 'Contact', title = "Let's talk", text, contacts = [ { kind: 'email', label: 'Email', value: 'hello@you.dev', href: 'mailto:hello@you.dev' }, { kind: 'github', label: 'GitHub', value: 'github.com/you', href: '#' }, ], cta, className = '' } = Astro.props; const icons: Record<Contact['kind'], string> = { email: '<rect x="3" y="5" width="18" height="14" rx="2"/><path d="m3 7 9 6 9-6"/>', github: '<path d="M9 19c-4.3 1.4-4.3-2.5-6-3m12 5v-3.5c0-1 .1-1.4-.5-2 2.8-.3 5.5-1.4 5.5-6a4.6 4.6 0 0 0-1.3-3.2 4.2 4.2 0 0 0-.1-3.2s-1.1-.3-3.5 1.3a12.3 12.3 0 0 0-6.2 0C6.5 2.8 5.4 3.1 5.4 3.1a4.2 4.2 0 0 0-.1 3.2A4.6 4.6 0 0 0 4 9.5c0 4.6 2.7 5.7 5.5 6-.6.6-.6 1.2-.5 2V21"/>', linkedin: '<path d="M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-4 0v7h-4v-7a6 6 0 0 1 6-6zM2 9h4v12H2z"/><circle cx="4" cy="4" r="2"/>', x: '<path d="M4 4l16 16M20 4 4 20"/>', web: '<circle cx="12" cy="12" r="10"/><path d="M2 12h20M12 2a15 15 0 0 1 0 20 15 15 0 0 1 0-20"/>', }; --- <section class:list={['dvcn', className]}> <div class="dvcn__wrap"> <p class="dvcn__eyebrow">{eyebrow}</p> <h2 class="dvcn__title">{title}</h2> {text && <p class="dvcn__text">{text}</p>} <ul class="dvcn__grid"> {contacts.map((c) => { const external = !c.href.startsWith('mailto:') && !c.href.startsWith('tel:'); return ( <li> <a class="dvcn__card" href={c.href} target={external ? '_blank' : undefined} rel={external ? 'noopener noreferrer' : undefined}> <span class="dvcn__icon" aria-hidden="true"> <svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" set:html={icons[c.kind] ?? icons.web} /> </span> <span class="dvcn__info"> <span class="dvcn__type">{c.label}</span> <span class="dvcn__value">{c.value}</span> </span> <span class="dvcn__arrow" aria-hidden="true">{external ? '↗' : '→'}</span> </a> </li> ); })} </ul> {cta && <a class="dvcn__cta" href={cta.href}>{cta.label} <span aria-hidden="true">→</span></a>} </div> </section> <style> .dvcn { padding: clamp(2.5rem, 6vw, 4rem) 0; color: var(--c-text-1); } .dvcn__wrap { max-width: 1040px; margin: 0 auto; padding: 0 clamp(1rem, 3vw, 1.5rem); } .dvcn__eyebrow { margin: 0 0 0.5rem; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--c-text-3); } .dvcn__title { margin: 0 0 1rem; font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 700; letter-spacing: -0.03em; } .dvcn__text { margin: 0 0 1.5rem; max-width: 560px; font-size: 0.98rem; line-height: 1.7; color: var(--c-text-2); } .dvcn__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; } .dvcn__card { display: flex; align-items: center; gap: 1rem; min-height: 84px; padding: 1.1rem 1.4rem; border-radius: 16px; background: rgb(var(--ink-rgb, 0 0 0) / 0.035); border: 1px solid rgb(var(--ink-rgb, 0 0 0) / 0.07); color: var(--c-text-1); text-decoration: none; transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease; } .dvcn__card:hover { transform: translateY(-2px); background: var(--c-bg); border-color: rgb(var(--ink-rgb, 0 0 0) / 0.16); box-shadow: 0 14px 30px -12px rgb(var(--ink-rgb, 0 0 0) / 0.2); } .dvcn__card:focus-visible { outline: 2px solid var(--c-text-1); outline-offset: 3px; } .dvcn__icon { width: 44px; height: 44px; display: grid; place-items: center; flex-shrink: 0; border-radius: 12px; background: var(--c-bg); border: 1px solid rgb(var(--ink-rgb, 0 0 0) / 0.08); } .dvcn__info { display: flex; flex-direction: column; min-width: 0; flex: 1; } .dvcn__type { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--c-text-3); } .dvcn__value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 1rem; font-weight: 500; } .dvcn__arrow { color: var(--c-text-3); transition: transform 0.25s ease, color 0.25s ease; } .dvcn__card:hover .dvcn__arrow { color: var(--c-text-1); transform: translate(3px, -1px); } .dvcn__cta { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; margin-top: 1.5rem; padding: 0 1.25rem; border: 1.5px solid var(--c-text-1); border-radius: 2px; color: var(--c-text-1); font-family: var(--font-mono); font-size: 0.85rem; font-weight: 700; text-decoration: none; box-shadow: 2px 2px 0 var(--c-text-1); transition: transform 0.15s ease, box-shadow 0.15s ease; } .dvcn__cta:hover { transform: translateY(-1px); box-shadow: 3px 3px 0 var(--c-text-1); } @media (prefers-reduced-motion: reduce) { .dvcn__card, .dvcn__arrow { transition: none; } } </style>
Forma parte de una plantilla

Esta sección fue diseñada como un bloque clave para la siguiente plantilla. Puedes ver la experiencia multipágina interactiva completa o explorar todos sus componentes.

Plantillas completas 6 páginas · 15 componentes

Portfolio de desarrollador

Un portfolio monocromo inspirado en un teclado, con proyectos en 3D, un teclado que escribe y una matriz de contribuciones de cubos que vuelan.

Más secciones para explorar

Descubre otros bloques para landing pages y secciones listas para producción de nuestra librería.

Todas las secciones