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

VoltSidebar — volt-sidebar

EntradaTipoPor defecto
width string —
collapsedWidth string —
class string ''

VoltSidebarHeader — volt-sidebar-header

EntradaTipoPor defecto
class string ''

VoltSidebarContent — volt-sidebar-content

EntradaTipoPor defecto
class string ''

VoltSidebarGroup — volt-sidebar-group

EntradaTipoPor defecto
label string —
class string ''

VoltSidebarItem — volt-sidebar-item

EntradaTipoPor defecto
routerLink *string —
queryParams Record<string, string> | undefined undefined
label *string —
exact boolean false
class string ''

VoltSidebarFooter — volt-sidebar-footer

EntradaTipoPor defecto
class string ''

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.