Przejdź do treści
Biblioteka skilli
Programowanie · Nauka i wyjaśnianie

codex-icons

/codex-icons

Opisuje użycie biblioteki ikon Codex (@wikimedia/codex-icons): import stałej cdxIcon, renderowanie przez CdxIcon, wyszukiwanie nazwy ikony, ikony dwukierunkowe i dostępność.

Repozytorium
protowiki ↗
Licencja
LGPL
Ostatnia zmiana repozytorium
26.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
2
Skrypty
0
Komentarze HTML
2
Adresy URL w SKILL.md
1
Przestarzałość

Brak sygnałów. Repozytorium zmienione 26.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

LGPL, otwarta.

Co sprawdzić przed instalacją
  • SKILL.md zawiera komentarze HTML (2). Nie widać ich w podglądzie Markdown, a model je czyta.

Co robi i kiedy

Opisuje użycie biblioteki ikon Codex (@wikimedia/codex-icons): import stałej cdxIcon, renderowanie przez CdxIcon, wyszukiwanie nazwy ikony, ikony dwukierunkowe i dostępność.

Oryginalny opis (EN)

How to use the Codex icon library (@wikimedia/codex-icons) — import a `cdxIcon…` constant, render it through CdxIcon, and look up the right name in the full icon list (references/icons.md) or the upstream catalogue. Covers bidi-aware icons, the langCodeMap variants (e.g., bold-x), and accessibility. Use when adding a glyph anywhere — toolbar buttons, actions, menus, pills.

Jak działa

  1. Importing
  2. Finding an icon
  3. Naming convention
  4. Accessibility
  5. Bidi-aware icons
  6. Lang-code-aware icons
  7. Choosing or designing an icon
  8. Custom icons
  9. Don't
  10. Inside ProtoWiki
Sekcje z nagłówków SKILL.md, w oryginale · 132 linii, 494 słów
Podgląd SKILL.md
---
name: codex-icons
description: How to use the Codex icon library (@wikimedia/codex-icons) — import a `cdxIcon…` constant, render it through CdxIcon, and look up the right name in the full icon list (references/icons.md) or the upstream catalogue. Covers bidi-aware icons, the langCodeMap variants (e.g., bold-x), and accessibility. Use when adding a glyph anywhere — toolbar buttons, actions, menus, pills.
---

# Codex icons

The Codex icon library ships separately as `@wikimedia/codex-icons`.
**Use it instead of inline SVG, font icons, or unicode glyphs.**

## Importing

```ts
import { CdxIcon } from '@wikimedia/codex'
import { cdxIconEdit, cdxIconBold, cdxIconLink } from '@wikimedia/codex-icons'
```

Then render through `CdxIcon`:

```vue
<CdxIcon :icon="cdxIconEdit" />
<CdxIcon :icon="cdxIconBold" size="small" />
```

Valid `size` values are `x-small`, `small`, and `medium` (the default).
There is no `large` icon size — for a bigger glyph, size the container
(e.g. a `CdxButton` or a wrapper) rather than the icon.

## Finding an icon

There are hundreds of icons — **look one up, don't guess the name.** Two
sources:

- [`references/icons.md`](references/icons.md) — the full list of
  every importable constant, generated from the installed package. Grep it
  offline instead of opening `node_modules`. It also flags which icons flip
  in RTL, have distinct LTR/RTL glyphs, or vary by `langCode`.
- <https://doc.wikimedia.org/codex/latest/icons/all-icons.html> — the
  canonical catalogue with visual previews, best for finding an icon by
  what it depicts.

To search the installed package directly:

```bash
node -e "const i = require('@wikimedia/codex-icons'); console.log(Object.keys(i).filter(n => /search/i.test(n)))"
```

Always confirm a constant exists in the full list (or the package) before
importing it.

## Naming convention

`cdxIcon` + PascalCase of the icon name. So:

| Icon name | Import |
| --- | --- |
| `edit` | `cdxIconEdit` |
| `link` | `cdxIconLink` |
| `bold` | `cdxIconBold` |
| `bold-x` | `cdxIconBoldX` (langCodeMap-aware) |
| `arrow-next` | `cdxIconArrowNext` (bidi-aware) |
| `draggable-vertical` | `cdxIconDraggableVertical` (`cdxIconDraggable` is a deprecated alias) |
| `reference` | `cdxIconReference` |

## Accessibility

`CdxIcon` doesn't make a button accessible on its own. Two patterns:

```vue
<!-- Inside a button with a label -->
<CdxButton aria-label="Edit">
  <CdxIcon :icon="cdxIconEdit" />
</CdxButton>

<!-- Decorative — paired with visible text -->
<CdxButton>
  <CdxIcon :icon="cdxIconEdit" /> Edit
</CdxButton>
```

For standalone informational icons, set `iconLabel`:

```vue
<CdxIcon :icon="cdxIconAlert" iconLabel="Warning" />
```

## Bidi-aware icons

Some icons (arrows, e.g. `cdxIconArrowNext`) automatically flip in RTL.
You can also pin direction:

```vue
<CdxIcon :icon="cdxIconArrowNext" dir="rtl" />
```

## Lang-code-aware icons

Some icons (e.g. `cdxIconBoldX`) render different glyphs depending on
language. Pass `langCode`:

```vue
<CdxIcon :icon="cdxIconBoldX" langCode="ar" />
```

## Choosing or designing an icon

This skill is the lookup (which constant, how to render). For the *design
principles* — reduce to the essential form, universal not
culturally-specific, neutral, geometric, the 20 dp canvas, RTL
mirroring — see
[`codex-style-guide` → icon design](../codex-style-guide/references/icons.md).

## Custom icons

For an icon that's not in the catalogue, define your own descriptor:

```ts
const myIcon = '<svg viewBox="0 0 20 20">…</svg>'
```

Then `<CdxIcon :icon="myIcon" />`. But — first check the catalogue.
There are hundreds of icons.

## Don't

- Don't paste `<svg>` markup directly into your template. Use `CdxIcon`.
- Don't use emoji as icons in product UI.
- Don't use font-awesome or material-icons. We have our own system.

## Inside ProtoWiki

`@wikimedia/codex-icons` is already a dependency — just import the
constants you need. See
[`protowiki-getting-started`](../protowiki-getting-started/SKILL.md)
for the wider stack.
Pliki w paczce (2)
  • SKILL.md 4 KB
  • references/icons.md 26 KB

Wersje

W bazie nie ma innych skilli o nazwie codex-icons.

Migawka bazy z 13.11.2026 · wersja paczki 5f9918afaae2 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100icon-system-stinger
    Projektuje system ikon w React: wybór biblioteki, rozmiar paczki, sprite'y SVG, ikony dynamiczne i dostępność.
  • 90cut-icon
    Projektuje specyfikację systemu ikon albo audytuje istniejące ikony pod kątem spójności i dostępności.
  • 100codex-usage
    Opisuje użycie systemu designu Wikimedia Codex w dowolnym froncie: komponenty Vue zamiast własnego DOM, tokeny, ikony i bazowy CSS oraz dopasowanie do projektów Figma.
  • 90fe-icons
    Dodaje i zmienia ikony zgodnie z zestawem projektu, generowanym z plików SVG przy budowaniu, bez wpisywania na sztywno ścieżek do ikon.
  • 100bestax-icons
    Pomaga używać ikon w aplikacji z @allxsmith/bestax-bulma: komponenty Icon i IconText, pięć obsługiwanych bibliotek ikon, konfiguracja globalna, naprawa pustych ikon i dostępność.
  • 100ios-icon-gen
    Generuje ikony aplikacji iOS jako imagesety PNG do katalogów zasobów Xcode z SF Symbols lub Iconify API, z ponad 275 tys. otwartych ikon.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.