astro/.changeset/dirty-cycles-lick.md
Nate Moore 0bf0758fb8
Add astro/types for common prop patterns (#5147)
* wip: add type-utils

* feat: update type-utils

* feat: RequireDefaultSlot => WithChildren

* chore: add changeset

* chore: move types to ./types

* chore: update changeset

* Update dirty-cycles-lick.md

Co-authored-by: Nate Moore <nate@astro.build>
2022-10-26 10:14:08 -05:00

16 lines
473 B
Markdown

---
'astro': minor
---
Add `astro/types` entrypoint. These utilities can be used for common prop type patterns.
## `HTMLAttributes`
If you would like to extend valid HTML attributes for a given HTML element, you may use the provided `HTMLAttributes` type—it accepts an element name and returns the valid HTML attributes for that element name.
```ts
import { HTMLAttributes } from 'astro/types';
interface Props extends HTMLAttributes<'a'> {
myProp?: string;
};
```