Skip to content

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'

On this page
  1. Parts of a settings page, and loading
  2. When to use it
  3. For everyone
  4. Props

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 section with a real heading, so people can jump between parts.

Props

SectionTypeDefault
actions

One or two buttons that act on the whole section, at the end of the title.

ReactNode
className string
gap Gap
id string
lead

One sentence about it.

ReactNode
level

Heading level of the title.

2 | 3 2
title

The name of this part of the page. A level 2 heading by default.

ReactNode
SectionSkeletonTypeDefault
lead boolean true
  1. Parts of a settings page, and loading
  2. When to use it
  3. For everyone
  4. Props

    Search pages, sections and terms