Icon buttons
Square icon-only buttons with real labels for screen readers, next to one labelled action.
The code
Plain HTML and CSS on your kit's variables. Put it next to tokens/variables.css from your kit's files and it draws in your look.
<div class="ukc-button-icon-buttons">
<div class="row">
<button class="icon" type="button" aria-label="Search"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="11" cy="11" r="6.5"/><path d="M16 16l4.5 4.5"/></svg></button>
<button class="icon" type="button" aria-label="Notifications"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M6 16V11a6 6 0 0 1 12 0v5l1.5 2h-15z"/><path d="M10 20.5h4"/></svg></button>
<button class="icon" type="button" aria-label="More"><svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="5" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/></svg></button>
<button class="icon round accent" type="button" aria-label="New item"><svg width="18" height="18" 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></button>
<button class="labelled" type="button"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 16V4M7 9l5-5 5 5M4 20h16"/></svg> Upload</button>
</div>
</div>
.ukc-button-icon-buttons { position: relative; font-family: var(--uk-font-body, system-ui, sans-serif); color: var(--uk-ink); font-size: 15px; line-height: 1.5;
--tint: color-mix(in srgb, var(--uk-accent) 12%, var(--uk-paper));
--tint-strong: color-mix(in srgb, var(--uk-accent) 22%, var(--uk-paper));
--accent-deep: color-mix(in srgb, var(--uk-accent) 72%, black);
--ink-soft: color-mix(in srgb, var(--uk-ink) 8%, var(--uk-paper));
--line-strong: color-mix(in srgb, var(--uk-ink) 32%, var(--uk-paper));
--danger-tint: color-mix(in srgb, var(--uk-danger) 12%, var(--uk-paper));
--high-tint: color-mix(in srgb, var(--uk-highlight) 28%, var(--uk-paper)); }
.ukc-button-icon-buttons *, .ukc-button-icon-buttons *::before, .ukc-button-icon-buttons *::after { box-sizing: border-box; }
.ukc-button-icon-buttons :where(h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote) { margin: 0; }
.ukc-button-icon-buttons :where(ul, ol) { padding: 0; list-style: none; }
.ukc-button-icon-buttons :where(button, input, select, textarea) { font: inherit; color: inherit; }
.ukc-button-icon-buttons :where(a) { color: inherit; }
.ukc-button-icon-buttons svg { flex: none; }
.ukc-button-icon-buttons .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ukc-button-icon-buttons .icon { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--uk-line); border-radius: var(--uk-radius-md); background: var(--uk-surface); color: var(--uk-ink); cursor: pointer; }
.ukc-button-icon-buttons .icon:hover { background: var(--ink-soft); }
.ukc-button-icon-buttons .icon.round { border-radius: 999px; }
.ukc-button-icon-buttons .icon.accent { background: var(--uk-accent); color: var(--uk-accent-ink); border-color: transparent; }
.ukc-button-icon-buttons .labelled { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 0; border-radius: var(--uk-radius-md); background: var(--uk-ink); color: var(--uk-paper); cursor: pointer; }