Skip to content

Commit adbcbd7

Browse files
committed
add docs
1 parent 0934e36 commit adbcbd7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

documentation/docs/02-runes/05-$props.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,3 +199,10 @@ You can, of course, separate the type declaration from the annotation:
199199
> [!NOTE] Interfaces for native DOM elements are provided in the `svelte/elements` module (see [Typing wrapper components](typescript#Typing-wrapper-components))
200200
201201
Adding types is recommended, as it ensures that people using your component can easily discover which props they should provide.
202+
203+
204+
## `$props.id()`
205+
206+
This rune, added in version 5.20.0, generates an ID that is unique to the current component instance. When hydrating a server-rendered a component, the value will be consistent between server and client.
207+
208+
This is useful for linking elements via attributes like `for` and `aria-labelledby`.

0 commit comments

Comments
 (0)