summaryrefslogtreecommitdiff
path: root/examples/component/packages/my-component/Heading.astro
blob: 813c0c11ba030c71e50f32f448026ef262e58e1e (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>