Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

templ-components

/templ-components

Tworzy wielokrotnego użytku komponenty UI w templ z właściwościami, dziećmi i wzorcami kompozycji.

Autor
Xe ↗
Repozytorium
site ↗
Licencja
Zlib
Ostatnia zmiana repozytorium
13.11.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
4
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
2
Przestarzałość

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

Licencja

Zlib, otwarta.

Co robi i kiedy

Tworzy wielokrotnego użytku komponenty UI w templ z właściwościami, dziećmi i wzorcami kompozycji.

Wyzwalacze z opisu

button componentcard componentreusable templ components
Oryginalny opis (EN)

Create reusable templ UI components with props, children, and composition patterns. Use when building UI components, creating component libraries, mentions 'button component', 'card component', or 'reusable templ components'.

Jak działa

  1. Level 1: Component Checklist
  2. Level 2: API Design Rules
  3. Level 3: Reusable Patterns
  4. Escalate to Other Skills
  5. References
Sekcje z nagłówków SKILL.md, w oryginale · 70 linii, 246 słów
Podgląd SKILL.md
---
name: templ-components
description: Create reusable templ UI components with props, children, and composition patterns. Use when building UI components, creating component libraries, mentions 'button component', 'card component', or 'reusable templ components'.
---

# Templ Components

Use progressive disclosure: solve with Level 1 first, then pull deeper guidance only if complexity requires it.

## Level 1: Component Checklist

Use this skill for reusable templ UI components.

1. Define a small, single-purpose component.
2. Prefer typed props (structs for complex APIs).
3. Support composition with `{ children... }`.
4. Keep variants explicit and predictable.
5. Extract shared layout wrappers instead of duplicating markup.

```templ
type ButtonProps struct {
    Label    string
    Variant  string
    Disabled bool
}

templ Button(props ButtonProps) {
    <button class={ "btn btn-" + props.Variant } disabled?={ props.Disabled }>
        { props.Label }
    </button>
}
```

## Level 2: API Design Rules

- **Small surface area:** avoid giant prop lists.
- **Typed options:** enums/constants beat free-form strings for critical variants.
- **Composition first:** prefer wrappers (`Card`, `Modal`, `Layout`) over monolith components.
- **No hidden side effects:** components render; handlers/loaders do data work.
- **Stable contracts:** avoid breaking prop shape without migration.

## Level 3: Reusable Patterns

```templ
templ Card(title string) {
    <article class="card">
        <header><h3>{ title }</h3></header>
        <div class="card-body">{ children... }</div>
    </article>
}

templ WithError(err error) {
    if err != nil {
        <p class="error">{ err.Error() }</p>
    } else {
        { children... }
    }
}
```

## Escalate to Other Skills

- Need syntax details: use `templ-syntax`.
- Need HTTP routing/rendering: use `templ-http`.
- Need partial updates/interactions: use `templ-htmx`.

## References

- Foundations: `resources/foundations.md`
- Patterns: `resources/patterns.md`
- Testing and API notes: `resources/testing-and-api.md`
- templ component guide: https://templ.guide/component-composition/
- templ API docs: https://pkg.go.dev/github.com/a-h/templ
Pliki w paczce (4)
  • SKILL.md 2 KB
  • resources/foundations.md 1 KB
  • resources/patterns.md 1 KB
  • resources/testing-and-api.md 1 KB

Wersje

W bazie nie ma innych skilli o nazwie templ-components.

Migawka bazy z 13.11.2026 · wersja paczki 97c93afe9088 (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

  • 100templ-http
    Łączy komponenty templ z serwerem Go przez net/http: tworzy trasy, handlery i wyświetla widoki.
  • 100templ-syntax
    Uczy składni plików .templ: wyrażeń, warunków, pętli i integracji z kodem Go, z przykładami.
  • 100templ-to-gsx-migration
    Prowadzi migrację komponentów templ do gsx lub współistnienie obu w jednym module: deklaracje, dzieci, wywołania między pakietami.
  • 100component-system
    Pomaga budować komponenty wielokrotnego użytku dla węzłów: wzorce kompozycji, komunikacja między komponentami i projekt interfejsu.
  • 100component-system
    Pomaga budować wielokrotnego użytku komponenty węzłów: wzorce kompozycji, komunikację między komponentami i projektowanie interfejsów.
  • 100react-component-patterns
    Pomaga projektować architekturę komponentów React z wzorcami kompozycji, komponentami wielokrotnego użytku i hierarchiami komponentów.

Uwagi i zgłoszenia

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