Section
Una parte de una página con nombre: un título, una línea sobre ella, sus acciones y luego su contenido. Las secciones se suceden separadas por una línea; a diferencia de un Panel no tienen marco.
import { Section, SectionSkeleton } from '@sypnia/ui/react'
Partes de una página de ajustes, y cargando
Members
Who can see and change this project.
Ana Castaño, Diego Ruiz and 4 more.
Danger zone
Things that cannot be undone.
Código
import { Button, Section, SectionSkeleton, Text } from '@sypnia/ui/react';
export default function Parts() {
return (
<div>
<Section title="Members" lead="Who can see and change this project." actions={<Button size="sm" icon="user-plus">Invite</Button>}>
<Text size="sm">Ana Castaño, Diego Ruiz and 4 more.</Text>
</Section>
<Section title="Danger zone" lead="Things that cannot be undone.">
<div><Button variant="danger" size="sm">Delete project</Button></div>
</Section>
<SectionSkeleton><span className="sy-skeleton sy-skeleton--text" style={{ '--w': '18rem' } as React.CSSProperties} /></SectionSkeleton>
</div>
);
} Cuándo usarlo
Úsalo cuando
- Páginas largas hechas de partes con nombre: ajustes, un perfil, una página de inicio.
No lo uses cuando
- Una región enmarcada con sus propias acciones y pie: eso es un Panel.
Para todos
- Es una
sectioncon un título de verdad, así se puede saltar entre partes.
Props
| Section | Tipo | Por defecto |
|---|---|---|
actionsOne or two buttons that act on the whole section, at the end of the title. | ReactNode | |
className | string | |
gap | Gap | |
id | string | |
leadOne sentence about it. | ReactNode | |
levelHeading level of the title. | 2 | 3 | 2 |
titleThe name of this part of the page. A level 2 heading by default. | ReactNode |
| SectionSkeleton | Tipo | Por defecto |
|---|---|---|
lead | boolean | true |