carbon-design-system / carbon-components-svelte

Svelte implementation of the Carbon Design System
https://svelte.carbondesignsystem.com
Apache License 2.0
2.71k stars 261 forks source link

feat(heading): add `Heading` and `Section` components #1961

Closed metonym closed 6 months ago

metonym commented 6 months ago

v11 has a new Heading and Section component.

It automatically sets the heading level based on the nesting of sections.

<Section>
  <Heading>Heading 1</Heading>
  <Section>
    <Heading>Heading 2</Heading>
    <Section>
      <Heading>Heading 3</Heading>
      <Section>
        <Heading>Heading 4</Heading>
        <Section>
          <Heading>Heading 5</Heading>
          <Section>
            <Heading>Heading 6</Heading>
            <Section>
              <Heading>Capped at Heading 6</Heading>
            </Section>
          </Section>
        </Section>
      </Section>
    </Section>
  </Section>
  <Section>
    <Heading>Heading 2</Heading>
  </Section>
</Section>