ComponentesComponents

Hero

La primera pantalla: anuncio, título, frase, dos botones y una vista del producto.The first screen: announcement, headline, subtitle, two buttons and a product view.

DiseñoDesign: Tailark mist (MIT) · hero-section/twoMITlanding · densidaddensity baja · editorialMarkdownJSON

CódigoCode

<section class="s-hero" aria-labelledby="hero-title">
  <div class="s-hero__inner">
    <div class="s-hero__copy">
      <a class="s-hero__badge" href="#novedades" data-parte="anuncio">
        <span class="s-hero__badge-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M12 2l2.4 7.6L22 12l-7.6 2.4L12 22l-2.4-7.6L2 12l7.6-2.4z"/></svg></span>
        <span class="s-hero__badge-text">Nuevo: tema oscuro automático</span>
      </a>
      <h1 class="s-hero__title" id="hero-title" data-parte="titulo">Construye tu web en una tarde</h1>
      <p class="s-hero__lead" data-parte="frase">Componentes listos para copiar, accesibles y sin dependencias.</p>
      <div class="s-hero__actions">
        <a class="c-btn c-btn--primary c-btn--lg" href="#empezar" data-parte="accion">Empezar</a>
        <a class="c-btn c-btn--outline c-btn--lg" href="#demo" data-parte="accion-2">Ver demo</a>
      </div>
    </div>
    <div class="s-hero__media" aria-hidden="true" data-parte="imagen">
      <div class="s-hero__frame">
        <div class="s-hero__bar"><i></i><i></i><i></i></div>
        <div class="s-hero__app">
          <div class="s-hero__side"><span class="s-hero__line" style="width:70%"></span><span class="s-hero__line"></span><span class="s-hero__line" style="width:85%"></span><span class="s-hero__line" style="width:60%"></span><span class="s-hero__line" style="width:75%"></span></div>
          <div class="s-hero__main">
            <div class="s-hero__cards">
              <div class="s-hero__card"><span class="s-hero__line" style="width:50%"></span><span class="s-hero__line" style="width:80%;height:.9rem"></span></div>
              <div class="s-hero__card"><span class="s-hero__line" style="width:40%"></span><span class="s-hero__line" style="width:70%;height:.9rem"></span></div>
              <div class="s-hero__card"><span class="s-hero__line" style="width:55%"></span><span class="s-hero__line" style="width:60%;height:.9rem"></span></div>
            </div>
            <div class="s-hero__chart"><svg viewBox="0 0 400 100" preserveAspectRatio="none" fill="none" stroke="currentColor" stroke-width="2"><path d="M0 80 C40 70 60 40 100 50 S160 85 200 60 S280 20 320 30 S380 10 400 15"/></svg></div>
          </div>
        </div>
      </div>
    </div>
  </div>
</section>

«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.
  3. Copia los archivos:Copy the files: hero.html, hero.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

  • Arriba de una landing, después de la barra de navegación.
  • At the top of a landing page, below the navigation bar.

Mejor noAvoid

  • Con más de dos botones: diluye la acción principal.
  • With more than two buttons: it dilutes the main action.

AccesibilidadAccessibility

region
  • Un solo h1 por página: el título del hero.
  • La ventana de la app es decorativa (aria-hidden), dibujada en HTML.
  • One h1 per page: the hero headline.
  • The app window is decorative (aria-hidden), drawn in HTML.

Cómo probarloHow to test it

  • El lector lee el anuncio, el título y los dos enlaces, y salta la ilustración.
  • Screen readers read the badge, headline and both links, and skip the illustration.

CréditosCredits