Ir al contenido

Panel

Una región enmarcada de una página con nombre: reúne lo que va junto, con espacio para sus acciones arriba y una nota abajo.

import { Panel, PanelSkeleton } from '@sypnia/ui/react'

En esta página
  1. Título, acción y pie
  2. Con una tabla
  3. Cargando, vacío y con falla
  4. Skeleton
  5. Cuándo usarlo
  6. Para todos
  7. Props

Título, acción y pie

La acción pertenece al panel; el pie lleva una nota discreta.

Project

Name
Storefront
Region
Frankfurt
Plan
Team
Created on November 3, 2026 by Laura Méndez
Código
import { Button, KeyValue, Panel } from '@sypnia/ui/react';

export default function Basic() {
  return (
    <Panel title="Project" actions={<Button size="sm" icon="edit">Rename</Button>} footer="Created on November 3, 2026 by Laura Méndez">
      <KeyValue items={[['Name', 'Storefront'], ['Region', 'Frankfurt'], ['Plan', 'Team']]} />
    </Panel>
  );
}

Con una tabla

flush deja que la tabla llegue a los bordes.

API keys

NameKindLast used
Back officeSecretToday
Mobile appPublicToday
Old websitePublicMarch 2
3 keys
Código
import { Badge, Panel, Table } from '@sypnia/ui/react';

const keys = [
  { name: 'Back office', kind: 'Secret', used: 'Today' },
  { name: 'Mobile app', kind: 'Public', used: 'Today' },
  { name: 'Old website', kind: 'Public', used: 'March 2' },
];
// `flush` removes the padding, so a table or a list reaches the edges of the panel.
export default function Flush() {
  return (
    <Panel flush title="API keys" footer="3 keys">
      <Table label="API keys" rows={keys} rowKey={(k) => k.name} columns={[
        { id: 'name', header: 'Name', cell: (k) => k.name },
        { id: 'kind', header: 'Kind', cell: (k) => <Badge outline>{k.kind}</Badge> },
        { id: 'used', header: 'Last used', cell: (k) => k.used },
      ]} />
    </Panel>
  );
}

Cargando, vacío y con falla

El marco es el mismo en los tres estados.

Activity

Activity

Nothing has happened today

Activity

Código
import { Button, EmptyState, Panel, SkeletonText } from '@sypnia/ui/react';

// The same panel while it loads, when it has nothing, and when it failed.
export default function States() {
  return (
    <div className="sy-grid">
      <Panel title="Activity"><div aria-busy="true"><SkeletonText lines={4} /></div></Panel>
      <Panel title="Activity"><EmptyState compact icon="clock" title="Nothing has happened today" /></Panel>
      <Panel title="Activity"><EmptyState compact tone="fail" title="The activity could not be loaded" actions={<Button size="sm">Try again</Button>} /></Panel>
    </div>
  );
}

Skeleton

La pieza real y su skeleton: la misma caja, así nada se mueve cuando llegan los datos.

Usage this month

Requests: 1.2 million of 5 million. Storage: 18 GB of 50 GB. You are well within your plan.
Código
import type { CSSProperties } from 'react';
import { Panel, PanelSkeleton } from '@sypnia/ui/react';

// Usage panel, loaded and loading. The skeleton has the same box as the real one, so nothing moves when the data arrives.
export default function Skeleton() {
  return (
    <div className="sy-grid" style={{ '--min': '16rem' } as CSSProperties}>
      <Panel title="Usage this month">Requests: 1.2 million of 5 million. Storage: 18 GB of 50 GB. You are well within your plan.</Panel>
      <PanelSkeleton lines={2} />
    </div>
  );
}

Cuándo usarlo

Úsalo cuando

  • Una página tiene varias regiones y cada una necesita título: ajustes, una lista, un resumen.
  • La región tiene acciones propias: van en la cabeza, al final.
  • Tiene una tabla o una lista que debe llegar a los bordes: agrega flush.

No lo uses cuando

  • Es un elemento entre varios iguales, o lleva a otro lugar: eso es una Card.
  • La página tiene una sola región: el PageHeader basta como título.
  • Pondrías un panel dentro de otro. Usa un Fieldset o títulos simples adentro.

Para todos

  • Es una section con un título de verdad (nivel 2), así quien usa lector de pantalla salta de panel en panel.
  • Los estados de carga, vacío y error van dentro del cuerpo, así el marco y el título nunca se mueven.
  • En el celular conserva su marco y su relleno; su contenido se apila.

Props

PanelTipoPor defecto
actions ReactNode
className string
flush boolean
footer ReactNode
loading

The panel is waiting for its content: it is marked busy and draws the body you pass, which is the real body with its values not here yet as `SkeletonWords` and its pieces as `SkeletonOf` (or the pieces' own `loading`). It never draws generic bars: a loading panel has the shape of the loaded one.

boolean
title ReactNode
PanelSkeletonTipoPor defecto
actions boolean
lines number 3
  1. Título, acción y pie
  2. Con una tabla
  3. Cargando, vacío y con falla
  4. Skeleton
  5. Cuándo usarlo
  6. Para todos
  7. Props

    Busca páginas, secciones y términos