docs: create-and-check-documentation

This commit is contained in:
Arthur van Assenbergh
2025-11-26 14:41:18 +01:00
committed by Gerla, J. (Justin)
parent f87c7fed03
commit 10a2c0c3cd
18 changed files with 625 additions and 97 deletions

View File

@@ -1,9 +1,17 @@
import {useEffect, useRef} from "react";
/**
* An element that always scrolls into view when it is rendered. When added to a list, the entire list will scroll to show this element.
* A React component that automatically scrolls itself into view whenever rendered.
*
* This component is especially useful in scrollable containers to keep the most
* recent content visible (e.g., chat applications, live logs, or notifications).
*
* It uses the browser's `Element.scrollIntoView()` API with smooth scrolling behavior.
*
* @returns A `<div>` element that scrolls into view when mounted or updated.
*/
export default function ScrollIntoView() {
/** Ref to the DOM element that will be scrolled into view. */
const elementRef = useRef<HTMLDivElement>(null);
useEffect(() => {