Skip to content
AliasCSS Logo
v1.5.6

Examples /

Buttons and badges

Buttons in every variant and size, icon buttons, button groups, badges, avatars, tags and keyboard keys.

Button variants

Solid, soft, outline, ghost and destructive. Every state is a class: hover, press and keyboard focus.

<div class="d-flex flex-wrap-wrap aic g-12px">
  <button class="d-inline-flex aic jcc g-8px h-36px px-14px br-8px b-0 bgc-accentRA1000 c-white fs-14px fw-500 font-family-inherit cursor-pointer transition(background-color_.15s,transform_.1s) --hover-bgc-accentRA1100 --active-tf-scale-0.97 --focus-visible[outline-2px-solid-accentRATheme1000,outline-offset-2px]">Solid</button>
  <button class="d-inline-flex aic jcc g-8px h-36px px-14px br-8px b-0 bgc-accentRATheme200 c-accentRATheme1200 fs-14px fw-500 font-family-inherit cursor-pointer transition(background-color_.15s,transform_.1s) --hover-bgc-accentRATheme300 --active-tf-scale-0.97 --focus-visible[outline-2px-solid-accentRATheme1000,outline-offset-2px]">Soft</button>
  <button class="d-inline-flex aic jcc g-8px h-36px px-14px br-8px b-1px-solid-slateTheme7 bgc-slateTheme1 c-slateTheme12 fs-14px fw-500 font-family-inherit cursor-pointer transition(background-color_.15s,transform_.1s) --hover[bgc-slateTheme3,bc-slateTheme8] --active-tf-scale-0.97 --focus-visible[outline-2px-solid-accentRATheme1000,outline-offset-2px]">Outline</button>
  <button class="d-inline-flex aic jcc g-8px h-36px px-14px br-8px b-0 bgc-transparent c-slateTheme12 fs-14px fw-500 font-family-inherit cursor-pointer transition(background-color_.15s) --hover-bgc-slateTheme4 --focus-visible[outline-2px-solid-accentRATheme1000,outline-offset-2px]">Ghost</button>
  <button class="d-inline-flex aic jcc g-8px h-36px px-14px br-8px b-0 bgc-red9 c-white fs-14px fw-500 font-family-inherit cursor-pointer transition(background-color_.15s,transform_.1s) --hover-bgc-red10 --active-tf-scale-0.97 --focus-visible[outline-2px-solid-red9,outline-offset-2px]"><svg class="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M3 6h18M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"/></svg>Delete</button>
  <button disabled class="d-inline-flex aic jcc g-8px h-36px px-14px br-8px b-0 bgc-slateTheme4 c-slateTheme9 fs-14px fw-500 font-family-inherit cursor-not-allowed">Disabled</button>
</div>

Sizes and icons

Three heights, an icon on either side, a square icon button and a loading button with a spinner made from a border.

<div class="d-flex flex-wrap-wrap aic g-12px">
  <button class="d-inline-flex aic g-6px h-28px px-10px br-6px b-0 bgc-accentRA1000 c-white fs-13px fw-500 font-family-inherit cursor-pointer --hover-bgc-accentRA1100">Small</button>
  <button class="d-inline-flex aic g-8px h-36px px-14px br-8px b-0 bgc-accentRA1000 c-white fs-14px fw-500 font-family-inherit cursor-pointer --hover-bgc-accentRA1100"><svg class="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg>New project</button>
  <button class="d-inline-flex aic g-8px h-44px px-20px br-10px b-0 bgc-accentRA1000 c-white fs-16px fw-500 font-family-inherit cursor-pointer --hover-bgc-accentRA1100">Continue<svg class="w-18px h-18px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M5 12h14M13 5l7 7-7 7"/></svg></button>
  <button aria-label="Settings" class="d-inline-grid place-items-center w-36px h-36px br-8px b-1px-solid-slateTheme7 bgc-slateTheme1 c-slateTheme11 cursor-pointer --hover[bgc-slateTheme3,c-slateTheme12] --focus-visible[outline-2px-solid-accentRATheme1000,outline-offset-2px]"><svg class="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 21v-7M4 10V3M12 21v-9M12 8V3M20 21v-5M20 12V3M1 14h6M9 8h6M17 16h6"/></svg></button>
  <button aria-label="Notifications" class="position-relative d-inline-grid place-items-center w-36px h-36px br-999px b-0 bgc-slateTheme3 c-slateTheme11 cursor-pointer --hover[bgc-slateTheme4,c-slateTheme12]"><svg class="w-16px h-16px flex-shrink-0" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"/></svg><span class="position-absolute t-6px r-7px w-8px h-8px br-999px bgc-red9 box-shadow(0_0_0_2px_var(--x-page-bg,white))"></span></button>
  <button disabled class="d-inline-flex aic g-8px h-36px px-14px br-8px b-0 bgc-accentRA1000 c-white fs-14px fw-500 font-family-inherit o-0.7 cursor-wait">
    <span class="w-14px h-14px br-999px b-2px-solid-white/0.35 border-top-color-white animation(spin_.7s_linear_infinite)"></span>
    Saving…
  </button>
  <i class="d-none" keyframes-spin="@100-[tf-rotate(360deg)]"></i>
</div>

Button group and segmented control

Joined buttons share borders with child selectors. The segmented control is three radio buttons: the checked one is styled with :has(), so it works without JavaScript.

<div class="d-grid g-20px justify-items-center">
  <div class="d-inline-flex br-8px b-1px-solid-slateTheme7 overflow-hidden __button[h-34px,px-14px,b-0,bgc-slateTheme1,c-slateTheme12,fs-14px,font-family-inherit,cursor-pointer] __button--hover-bgc-slateTheme3 __button--not(--first-child)-border-left-1px-solid-slateTheme7">
    <button>Day</button>
    <button>Week</button>
    <button>Month</button>
  </div>

  <div role="radiogroup" aria-label="View" class="d-inline-flex p-3px br-10px bgc-slateTheme3 g-2px">
    <label class="d-inline-flex aic h-30px px-12px br-7px fs-14px c-slateTheme11 cursor-pointer --hover-c-slateTheme12 --has(--checked)[bgc-slateTheme1,c-slateTheme12,box-shadow(0_1px_2px_rgb(0_0_0_/_0.12))] --has(--focus-visible)[outline-2px-solid-accentRATheme1000]">
      <input type="radio" name="view" value="list" checked class="position-absolute o-0 pointer-events-none">List
    </label>
    <label class="d-inline-flex aic h-30px px-12px br-7px fs-14px c-slateTheme11 cursor-pointer --hover-c-slateTheme12 --has(--checked)[bgc-slateTheme1,c-slateTheme12,box-shadow(0_1px_2px_rgb(0_0_0_/_0.12))] --has(--focus-visible)[outline-2px-solid-accentRATheme1000]">
      <input type="radio" name="view" value="board" class="position-absolute o-0 pointer-events-none">Board
    </label>
    <label class="d-inline-flex aic h-30px px-12px br-7px fs-14px c-slateTheme11 cursor-pointer --hover-c-slateTheme12 --has(--checked)[bgc-slateTheme1,c-slateTheme12,box-shadow(0_1px_2px_rgb(0_0_0_/_0.12))] --has(--focus-visible)[outline-2px-solid-accentRATheme1000]">
      <input type="radio" name="view" value="calendar" class="position-absolute o-0 pointer-events-none">Calendar
    </label>
  </div>
</div>

Badges

Status badges in the Radix color scales: step 3 for the fill, 11 for the text, 9 for the dot. They follow light and dark on their own.

<div class="d-flex flex-wrap-wrap aic g-8px">
  <span class="d-inline-flex aic g-6px h-22px px-8px br-999px bgc-greenTheme3 c-greenTheme11 fs-12px fw-500"><span class="w-6px h-6px br-999px bgc-greenTheme9"></span>Active</span>
  <span class="d-inline-flex aic g-6px h-22px px-8px br-999px bgc-amberTheme3 c-amberTheme11 fs-12px fw-500"><span class="w-6px h-6px br-999px bgc-amberTheme9"></span>Pending</span>
  <span class="d-inline-flex aic g-6px h-22px px-8px br-999px bgc-redTheme3 c-redTheme11 fs-12px fw-500"><span class="w-6px h-6px br-999px bgc-redTheme9"></span>Failed</span>
  <span class="d-inline-flex aic g-6px h-22px px-8px br-999px bgc-blueTheme3 c-blueTheme11 fs-12px fw-500"><span class="w-6px h-6px br-999px bgc-blueTheme9"></span>In review</span>
  <span class="d-inline-flex aic h-22px px-8px br-6px b-1px-solid-slateTheme6 c-slateTheme11 fs-12px fw-500">Draft</span>
  <span class="d-inline-flex aic h-22px px-8px br-6px bgc-accentRA1000 c-white fs-12px fw-600">New</span>
  <span class="d-inline-grid place-items-center mw-20px h-20px px-6px br-999px bgc-red9 c-white fs-11px fw-600 font-variant-numeric(tabular-nums)">12</span>
</div>

Avatars

Initials on a tinted circle, a presence dot, and a stacked group where each avatar overlaps the one before it.

<div class="d-flex flex-wrap-wrap aic g-24px">
  <span class="d-inline-grid place-items-center w-40px h-40px br-999px bgc-violetTheme4 c-violetTheme11 fs-14px fw-600">AK</span>
  <span class="position-relative d-inline-grid place-items-center w-40px h-40px br-999px bgc-tealTheme4 c-tealTheme11 fs-14px fw-600">
    MR
    <span class="position-absolute bottom-0 r-0 w-11px h-11px br-999px bgc-greenTheme9 b-2px-solid-slateTheme1"></span>
  </span>
  <span class="d-inline-grid place-items-center w-48px h-48px br-12px bgc-amberTheme4 c-amberTheme11 fs-16px fw-600">JD</span>

  <div class="d-flex aic __span[w-36px,h-36px,br-999px,b-2px-solid-slateTheme1,d-inline-grid,place-items-center,fs-13px,fw-600] __span--not(--first-child)-ml--10px">
    <span class="bgc-pinkTheme4 c-pinkTheme11">SL</span>
    <span class="bgc-blueTheme4 c-blueTheme11">TB</span>
    <span class="bgc-greenTheme4 c-greenTheme11">EN</span>
    <span class="bgc-orangeTheme4 c-orangeTheme11">PW</span>
    <span class="bgc-slateTheme4 c-slateTheme11 fs-12px">+8</span>
  </div>
</div>

Tags and chips

Removable tags and selectable filter chips. The chips are checkboxes, so they keep their state in a form and in React.

<div class="d-grid g-20px justify-items-center">
  <div class="d-flex flex-wrap-wrap g-8px">
    <span class="d-inline-flex aic g-4px h-28px pl-10px pr-4px br-6px bgc-slateTheme3 c-slateTheme12 fs-13px">Design
      <button aria-label="Remove Design" class="d-inline-grid place-items-center w-20px h-20px br-4px b-0 bgc-transparent c-slateTheme10 cursor-pointer --hover[bgc-slateTheme5,c-slateTheme12]"><svg class="w-12px h-12px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"/></svg></button>
    </span>
    <span class="d-inline-flex aic g-4px h-28px pl-10px pr-4px br-6px bgc-slateTheme3 c-slateTheme12 fs-13px">Engineering
      <button aria-label="Remove Engineering" class="d-inline-grid place-items-center w-20px h-20px br-4px b-0 bgc-transparent c-slateTheme10 cursor-pointer --hover[bgc-slateTheme5,c-slateTheme12]"><svg class="w-12px h-12px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"/></svg></button>
    </span>
  </div>
  <div class="d-flex flex-wrap-wrap g-8px">
    <label class="d-inline-flex aic g-6px h-32px px-12px br-999px b-1px-solid-slateTheme7 c-slateTheme11 fs-13px cursor-pointer user-select-none --hover-bgc-slateTheme3 --has(--checked)[bgc-accentRATheme100,bc-accentRATheme700,c-accentRATheme1100] _svg-d-none --has(--checked)_svg-d-block"><input type="checkbox" checked class="position-absolute o-0"><svg class="w-14px h-14px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg>Remote</label>
    <label class="d-inline-flex aic g-6px h-32px px-12px br-999px b-1px-solid-slateTheme7 c-slateTheme11 fs-13px cursor-pointer user-select-none --hover-bgc-slateTheme3 --has(--checked)[bgc-accentRATheme100,bc-accentRATheme700,c-accentRATheme1100] _svg-d-none --has(--checked)_svg-d-block"><input type="checkbox" class="position-absolute o-0"><svg class="w-14px h-14px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg>Full time</label>
    <label class="d-inline-flex aic g-6px h-32px px-12px br-999px b-1px-solid-slateTheme7 c-slateTheme11 fs-13px cursor-pointer user-select-none --hover-bgc-slateTheme3 --has(--checked)[bgc-accentRATheme100,bc-accentRATheme700,c-accentRATheme1100] _svg-d-none --has(--checked)_svg-d-block"><input type="checkbox" checked class="position-absolute o-0"><svg class="w-14px h-14px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg>Senior</label>
    <label class="d-inline-flex aic g-6px h-32px px-12px br-999px b-1px-solid-slateTheme7 c-slateTheme11 fs-13px cursor-pointer user-select-none --hover-bgc-slateTheme3 --has(--checked)[bgc-accentRATheme100,bc-accentRATheme700,c-accentRATheme1100] _svg-d-none --has(--checked)_svg-d-block"><input type="checkbox" class="position-absolute o-0"><svg class="w-14px h-14px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M20 6 9 17l-5-5"/></svg>Contract</label>
  </div>
</div>

Keyboard keys

Key caps for shortcuts in menus, tooltips and docs.

<p class="m-0 d-flex flex-wrap-wrap aic g-6px fs-14px c-slateTheme11">
  Press
  <kbd class="d-inline-grid place-items-center mw-24px h-24px px-6px br-6px b-1px-solid-slateTheme7 border-bottom-width-2px bgc-slateTheme2 c-slateTheme12 fs-12px font-family(ui-monospace,monospace)">⌘</kbd>
  <kbd class="d-inline-grid place-items-center mw-24px h-24px px-6px br-6px b-1px-solid-slateTheme7 border-bottom-width-2px bgc-slateTheme2 c-slateTheme12 fs-12px font-family(ui-monospace,monospace)">K</kbd>
  to search, or
  <kbd class="d-inline-grid place-items-center mw-24px h-24px px-6px br-6px b-1px-solid-slateTheme7 border-bottom-width-2px bgc-slateTheme2 c-slateTheme12 fs-12px font-family(ui-monospace,monospace)">Esc</kbd>
  to close.
</p>
NextForms