Skip to content

Panel

Section component with optional label, title, description, and subtle box shadow.

Also known as: section, content section, titled container, card with title

View in Storybook

When to use

  • Titled content sections. Use for organizing page sections with headings and descriptions.
  • For simple containers, use Card. For full-page wrapper, use Container.

Import

tsx
import { Panel } from '@vacano/ui'

Usage

tsx
<Panel>
  <p>Panel content goes here.</p>
</Panel>

With Title

tsx
<Panel title="Settings">
  <p>Configure your preferences below.</p>
</Panel>

With Title and Description

tsx
<Panel
  title="Account Settings"
  description="Manage your account preferences and security options."
>
  <p>Settings form here...</p>
</Panel>

With Label

The label prop renders a ReactNode above the title/description header.

tsx
<Panel label={<span>Step 1</span>} title="Personal Info">
  <p>Enter your personal details.</p>
</Panel>

Variants

tsx
<Panel variant="light" title="Light Panel">
  <p>Light background</p>
</Panel>

<Panel variant="dark" title="Dark Panel">
  <p>Dark background</p>
</Panel>

Props

PropTypeDefaultDescription
childrenReactNoderequiredPanel content
titlestring-Panel title text
descriptionstring-Panel description text below the title
labelReactNode-Label element rendered above the header
variant'light' | 'dark''light'Color variant
classNamestring-CSS class name for the root element
classnamesPanelClassNames-Custom class names for inner elements
refRef<HTMLDivElement>-Ref forwarded to the root div element
data-test-idstring-Test identifier attribute

All standard HTML div attributes (except className and title) are also supported.

ClassNames

KeyDescription
labelLabel element above the header
titleTitle text element
descriptionDescription text element
contentContent container wrapping children
  • Card - Generic content container
  • Container - Responsive page wrapper

Released under the MIT License.