templ-components
/templ-components
Tworzy wielokrotnego użytku komponenty UI w templ z właściwościami, dziećmi i wzorcami kompozycji.
Ocena i bezpieczeństwo
- Pliki w paczce
- 4
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 2
Brak sygnałów. Repozytorium zmienione 13.11.2026, bez odwołań do wycofanych modeli i API.
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
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
- Level 1: Component Checklist
- Level 2: API Design Rules
- Level 3: Reusable Patterns
- Escalate to Other Skills
- References
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.