Skip to content

NbPanel is a surface container that groups related content inside a styled card. It provides a consistent background, border, and spacing out of the box.

vue
<template>
  <NbPanel>
    <p>Simple panel with default styling.</p>
  </NbPanel>
</template>

Nesting content ​

Panels accept any slotted content, including other components.

Depth is derived from nesting ​

A panel inside a panel paints one layer deeper on its own. Nothing names a depth, and the count is clamped at layer 3.

Use the layer prop, or a .nb-layer-{0-3} class, only to pin or reset a level. See Theming, Layers for when that is worth doing.

vue
<NbPanel :layer="0" />

Panels are commonly used as a container for modal or form action buttons, keeping them visually separated from the main content.

vue
<template>
  <NbPanel>
    <NbGrid dir="row" gap="sm" justify="end">
      <NbButton variant="ghost">Cancel</NbButton>
      <NbButton variant="primary">Save</NbButton>
    </NbGrid>
  </NbPanel>
</template>

Slots ​

SlotDescription
defaultAny content to render inside Panel

Props ​

PropTypeDefaultDescription
layer0 | 1 | 2 | 3undefinedPins the panel to an absolute layer. Leave unset to derive the level from nesting.

Beyond the layer it paints, NbPanel is a layout container. Use CSS custom properties or inline styles to customize appearance.