We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents df933b5 + a56b179 commit 10d20faCopy full SHA for 10d20fa
docs-app/public/docs/6-utils/get-section-heading-level.md
@@ -135,6 +135,25 @@ class Heading extends Component {
135
136
</section>
137
138
+<details><summary>using Svelte</summary>
139
+
140
+```svelte
141
+<script>
142
+ import { getSectionHeadingLevel } from "which-heading-do-i-need";
143
144
+ let { children } = $props();
145
146
+ let ref = $state();
147
+ const hLevel = $derived(ref ? `h${getSectionHeadingLevel(ref)}` : 'span');
148
+</script>
149
150
+<svelte:element this={hLevel} bind:this={ref}>
151
+ {@render children?.()}
152
+</svelte:element>
153
+```
154
155
+</details>
156
157
## API Reference
158
159
```gjs live no-shadow
0 commit comments