docs: add TuonoScript component mention (#509)

Co-authored-by: Marco Pasqualetti <24919330+marcalexiei@users.noreply.github.com>
This commit is contained in:
Valerio Ageno
2025-02-05 16:44:43 +01:00
committed by GitHub
parent 7ea8414d6c
commit 79d4aff758
@@ -62,15 +62,29 @@ This file won't generate any route.
### Layout component for all routes
A file created in this location will wrap all project route.
`src/routes/__layout.tsx` is a required file that defines the layout component that wraps the entire application.
```tsx
// src/routes/__layout.tsx
import { TuonoScripts } from 'tuono'
export default function RootLayout({ children }) {
return <main>{children}</main>
return (
<html lang="en">
<body>
{children}
<TuonoScripts />
</body>
</html>
)
}
```
> ⚠️ This component is **not** optional and must include:
>
> - `<html>` and `body` HTML tags and the
> - `<TuonoScripts />` component.
### Layout component for specific routes
A file created in this location will wrap only the routes defined within the `src/routes/posts` folder.