summaryrefslogtreecommitdiff
path: root/examples/component/packages/my-component/Heading.astro
blob: 00f8926cc73fcff644ed2c6e1c28eb2aa432efbb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
---
export interface Props extends Record<any, any> {
	level?: number | string;
	role?: string;
}

const { level, role, ...props } = {
	...Astro.props,
} as Props;

props.role = role || "heading";
props["aria-level"] = level || "1";
---

<h {...props}><slot /></h>