autofocus.svelte.ts view source
(options?: FocusOptions | undefined): Attachment<HTMLElement | SVGElement> Creates an attachment that focuses the element on mount.
Use this instead of the HTML autofocus attribute for elements
that mount dynamically from reactive conditionals like {#if}.
options?
focus options forwarded to element.focus(); defaults to {focusVisible: true} to show focus indicators on programmatic focus
type
FocusOptions | undefinedoptional
returns
Attachment<HTMLElement | SVGElement>