Section
A part of a page with a name: a title, a line about it, its actions, then its content. Sections follow each other separated by a rule; unlike a Panel they have no frame.
import { Section, SectionSkeleton } from '@sypnia/ui/react'
Parts of a settings page, and loading
Members
Who can see and change this project.
Ana Castaño, Diego Ruiz and 4 more.
Danger zone
Things that cannot be undone.
Code
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>
);
} When to use it
Use it when
- Long pages made of named parts: settings, a profile, a landing.
Do not use it when
- A framed region with its own actions and foot: that is a Panel.
For everyone
- It is a
sectionwith a real heading, so people can jump between parts.
Props
| Section | Type | Default |
|---|---|---|
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 | Type | Default |
|---|---|---|
lead | boolean | true |