Skip to content
npm ↗ GitHub ↗

Documentation

19/Actions and labels

Buttons

Four main variants, three sizes, icons, and disabled and loading states.

Variants

Enlace
HTML
<button class="cb-btn cb-btn--primary" type="button">Primario ↗</button>
<button class="cb-btn cb-btn--outline" type="button">Outline</button>
<button class="cb-btn cb-btn--ghost" type="button">Ghost</button>
<button class="cb-btn cb-btn--soft" type="button">Soft</button>
<button class="cb-btn cb-btn--danger" type="button">Eliminar</button>
<a class="cb-btn cb-btn--link" href="#">Enlace</a>

Sizes

HTML
<button class="cb-btn cb-btn--primary cb-btn--sm" type="button">Pequeño</button>
<button class="cb-btn cb-btn--primary" type="button">Mediano</button>
<button class="cb-btn cb-btn--primary cb-btn--lg" type="button">Grande</button>

With icon

HTML
<button class="cb-btn cb-btn--primary" type="button"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg>Nuevo</button>
<button class="cb-btn cb-btn--outline" type="button">Descargar<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M12 4v12m0 0-5-5m5 5 5-5M4 20h16"/></svg></button>
<button class="cb-btn cb-btn--outline cb-btn--icon" type="button" aria-label="Más opciones"><svg viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><circle cx="5" cy="12" r="1.6"/><circle cx="12" cy="12" r="1.6"/><circle cx="19" cy="12" r="1.6"/></svg></button>
<button class="cb-icon-btn" type="button" aria-label="Editar"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" aria-hidden="true"><path d="M4 20h4L19 9l-4-4L4 16z"/></svg></button>

Disabled and loading

For a disabled link use aria-disabled="true". The loading state keeps the width and shows a spinner; use aria-busy="true" or the is-loading class.

Enlace inactivo
HTML
<button class="cb-btn cb-btn--primary" type="button" disabled>Deshabilitado</button>
<a class="cb-btn cb-btn--outline" aria-disabled="true">Enlace inactivo</a>
<button class="cb-btn cb-btn--primary" type="button" aria-busy="true"><span>Guardando</span></button>
<button class="cb-btn cb-btn--outline" type="button" aria-busy="true"><span>Cargando</span></button>

Action group

cb-actions spaces the buttons apart and stretches them to full width on mobile.

HTML
<div class="cb-actions mt-0">
  <a href="#" class="cb-btn cb-btn--primary">Cotizar ↗</a>
  <a href="#" class="cb-btn cb-btn--outline">Ver servicios</a>
</div>

Classes and modifiers

ClassDescription
.cb-btnBase: 38px tall, 13px, semibold.
.cb-btn--primaryAccent fill with --cb-accent-bg and --cb-accent-ink text.
.cb-btn--outlineThin border (the "ghost" of the original design).
.cb-btn--ghostNo border, background only on hover.
.cb-btn--softSoft accent background.
.cb-btn--dangerDestructive action.
.cb-btn--linkLooks like an underlined link.
.cb-btn--sm, .cb-btn--lg30px and 44px sizes.
.cb-btn--iconSquare icon-only button.
.cb-btn--blockFull width.
.is-loadingLoading state (equivalent to aria-busy="true").
.cb-icon-btn36px icon button with a border.
.cb-actionsRow of buttons; --center centers them.

Accessibility

  • Icon-only buttons need aria-label.
  • Use button for actions and a for navigation.
  • aria-busy="true" signals that the action is in progress.
  • The visible focus ring uses the accent color with a 2px outline.