DIANA

Diseño Aplicaciones Navarra

Back button

Control de navegación para volver a la pantalla o nivel anterior.

Estado: review

1. Estado Default: Semántica de Enlace

Mostrar HTML
<a href="#" class="gn-back-button">
  <svg class="gn-back-button__icon" aria-hidden="true" viewBox="0 0 24 24" focusable="false">
    <path fill="currentColor" d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" />
  </svg>
  <span class="gn-back-button__text">Volver a inicio</span>
</a>

2. Estado Hover

Mostrar HTML
<a href="#" class="gn-back-button is-hover">
  <svg class="gn-back-button__icon" aria-hidden="true" viewBox="0 0 24 24" focusable="false">
    <path fill="currentColor" d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" />
  </svg>
  <span class="gn-back-button__text">Volver</span>
</a>

3. Estado Focus

Mostrar HTML
<a href="#" class="gn-back-button is-focus">
  <svg class="gn-back-button__icon" aria-hidden="true" viewBox="0 0 24 24" focusable="false">
    <path fill="currentColor" d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" />
  </svg>
  <span class="gn-back-button__text">Volver al listado</span>
</a>

4. Alternativa: Semántica de Botón

Usar cuando el control de navegación requiera JavaScript o dependa del historial del navegador (ej: history.back()).

Mostrar HTML
<button type="button" class="gn-back-button" onclick="history.back()">
  <svg class="gn-back-button__icon" aria-hidden="true" viewBox="0 0 24 24" focusable="false">
    <path fill="currentColor" d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z" />
  </svg>
  <span class="gn-back-button__text">Volver atrás</span>
</button>