Sidebar Layout

A composable, responsive sidebar layout that you can copy and paste into your apps.

Dashboard
Widget 1
Widget 2
Widget 3
Main Content Plot

Uso

TypeScript
Cargando el editor…

La demo de arriba es la composición completa del shell de página; esto es la forma mínima.

Referencia de la API

EntradaTipoPor defecto
width string
collapsedWidth string
label string
routerLink *string
queryParams Record<string, string> | undefined undefined
exact boolean false

Width

The sidebar is 18rem expanded and 4rem collapsed by default. Override either one with the width / collapsedWidth inputs, or globally with the --volt-sidebar-width / --volt-sidebar-collapsed-width custom properties — useful for a resizable sidebar, where you drive the custom property from a drag handle. Inputs win over custom properties, and both accept any CSS length.

Configurar el ancho

TypeScript
Cargando el editor…

Recurre a la custom property cuando el ancho sea dinámico o se fije desde fuera de Angular.

Código del componente

Instalar por CLI:npx @voltui/cli add sidebar
TypeScript
Cargando el editor…

Copia este código en tu proyecto. VoltSidebarService guarda el estado plegado/abierto en móvil como signals; nada más en el layout depende de Angular Router más allá de routerLink.