webcomponents / webcomponents/custom-elements-manifest
Allowed children for slots
- Dominant language
- TypeScript
- Stars
- 502
- Forks
- 27
- PR merge metrics
- No merged PRs in 30d
Description
Both standard components (e.g. `table`, `tr`, `td`, `dl`, `dd`) and web components (e.g. `tab-panels`, `tab-panel`) have implicit constraints on what elements are allowed as children, and also what are allowed as parents.
I would propose that a slot description should also include a way to codify this.
For example:
```ts
export interface Slot {
/**
* The slot name, or the empty string for an unnamed slot.
*/
name: string;
/**
* A markdown summary suitable for display in a listing.
*/
summary?: string;
/**
* A markdown description.
*/
description?: string;
/**
* A set of CSS selectors for allowable children
*/
allowedChildren?: string[];
}
```
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.