1 estrella en GitHub = 1 componente nuevo.

Dar una estrella
Estructura & Layout layoutlandingmedia

Split Media Section

Sección dividida para páginas de inicio con texto argumental y elemento visual lateral.

Vista Previa en Vivo

Build Faster with Astro

Scale with pre-built accessible components and modular designs.

⚡ Interactive Preview

Uso

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

astro
---
import { SplitMediaSection } from 'astro-component-kit';
---

<LandingSectionSplit>Content</LandingSectionSplit>
--- import { SplitMediaSection } from 'astro-component-kit'; --- <LandingSectionSplit>Content</LandingSectionSplit>

Instalación Manual

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

astro
---
/**
 * LandingSectionSplit — Landing page section with text on one side and a media container on the other.
 */
interface Props {
  title?: string;
  subtitle?: string;
  className?: string;
}

const { 
  title = 'Build Faster with Astro', 
  subtitle = 'Scale with pre-built accessible components and modular designs.', 
  className = '' 
} = Astro.props;
---

<div class="cq-landing-section-split-cq">
<section class={`split-sec ${className}`}>
  <div class="split-sec-text">
    <h2>{title}</h2>
    <p>{subtitle}</p>
    <div class="split-sec-actions">
      <slot name="actions">
        <button class="split-demo-btn">Explore Docs</button>
      </slot>
    </div>
  </div>
  <div class="split-sec-media">
    <slot name="media">
      <div class="media-mockup">
        <span>⚡ Interactive Preview</span>
      </div>
    </slot>
  </div>
</section>
</div>
<style>
  .cq-landing-section-split-cq { container-type: inline-size; }
  .split-sec {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    padding: 2.5rem 1rem;
    width: 100%;
  }
  .split-sec-text h2 {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    margin: 0 0 1rem;
    line-height: 1.2;
  }
  .split-sec-text p {
    font-size: 1.05rem;
    color: #94a3b8;
    line-height: 1.6;
    margin: 0 0 1.5rem;
  }
  .split-demo-btn {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
  }
  .split-sec-media {
    width: 100%;
  }
  .media-mockup {
    height: 220px;
    background: rgba(15, 23, 42, 0.6);
    border-radius: 16px;
    border: 1px solid rgb(var(--ink-rgb, 255 255 255) / 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-weight: 600;
  }
  @container (max-width: 768px) {
    .split-sec {
      grid-template-columns: 1fr;
      gap: 2rem;
    }
  }
</style>
--- /** * LandingSectionSplit — Landing page section with text on one side and a media container on the other. */ interface Props { title?: string; subtitle?: string; className?: string; } const { title = 'Build Faster with Astro', subtitle = 'Scale with pre-built accessible components and modular designs.', className = '' } = Astro.props; --- <div class="cq-landing-section-split-cq"> <section class={`split-sec ${className}`}> <div class="split-sec-text"> <h2>{title}</h2> <p>{subtitle}</p> <div class="split-sec-actions"> <slot name="actions"> <button class="split-demo-btn">Explore Docs</button> </slot> </div> </div> <div class="split-sec-media"> <slot name="media"> <div class="media-mockup"> <span>⚡ Interactive Preview</span> </div> </slot> </div> </section> </div> <style> .cq-landing-section-split-cq { container-type: inline-size; } .split-sec { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; padding: 2.5rem 1rem; width: 100%; } .split-sec-text h2 { font-size: 2.2rem; font-weight: 800; color: #fff; margin: 0 0 1rem; line-height: 1.2; } .split-sec-text p { font-size: 1.05rem; color: #94a3b8; line-height: 1.6; margin: 0 0 1.5rem; } .split-demo-btn { padding: 0.75rem 1.5rem; background: linear-gradient(135deg, #6366f1, #8b5cf6); border: none; border-radius: 8px; color: #fff; font-weight: 600; cursor: pointer; } .split-sec-media { width: 100%; } .media-mockup { height: 220px; background: rgba(15, 23, 42, 0.6); border-radius: 16px; border: 1px solid rgb(var(--ink-rgb, 255 255 255) / 0.1); display: flex; align-items: center; justify-content: center; color: #94a3b8; font-weight: 600; } @container (max-width: 768px) { .split-sec { grid-template-columns: 1fr; gap: 2rem; } } </style>

Información Rápida

Categoría
Estructura & Layout
Nombre de archivo
SplitMediaSection.astro
Dependencias
Ninguna — Astro nativo + CSS puro
Etiquetas
layoutlandingmedia