Close menu

Pattern Library

Prose

Window sizes

Prose

A container that applies USWDS typography styling to nested content. Use for long-form text content like articles, documentation, and body copy.

Props

Prop Default Description
extra_classes Additional CSS classes (e.g., measure-3)

Slots

Slot Description
(default) Content to style (headings, paragraphs, lists, tables)

Example Usage

Basic Prose

<c-prose>
    <h1>Page heading</h1>
    <p class="usa-intro">Introduction paragraph with larger text.</p>
    <h2>Section heading</h2>
    <p>Body text with proper typography styling applied automatically.</p>
</c-prose>

Prose with Lists

<c-prose>
    <h2>Features</h2>
    <ul>
        <li>Unordered list item</li>
        <li>Unordered list item</li>
        <li>Nested list
            <ul>
                <li>Nested item</li>
                <li>Nested item</li>
            </ul>
        </li>
    </ul>
    <ol>
        <li>Ordered list item</li>
        <li>Ordered list item</li>
    </ol>
</c-prose>

Prose with Measure Constraint

<c-prose extra_classes="measure-4">
    <h2>Constrained line length</h2>
    <p>This prose block uses the measure-4 utility class to constrain the line length for better readability.</p>
</c-prose>

Prose with Table

<c-prose>
    <table>
        <caption>Document list</caption>
        <thead>
            <tr>
                <th scope="col">Title</th>
                <th scope="col">Year</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <th scope="row">Declaration of Independence</th>
                <td>1776</td>
            </tr>
            <tr>
                <th scope="row">Bill of Rights</th>
                <td>1791</td>
            </tr>
        </tbody>
    </table>
</c-prose>
{% load cotton %}

<div class="component-variants">
    <h1>Prose Component</h1>
    
    {% for variant in variants %}
    <div class="component-variant">
        <h2 class="variant-title">{{ variant.title }}</h2>

        {% cotton prose extra_classes="{{ variant.extra_classes }}" %}
            {{ variant.content|safe }}
        {% endcotton %}
    </div>
    {% endfor %}
</div>
name: Prose
context:
  variants:
    - title: "Line Length"
      content: |
        <p><strong>75 characters (68ex) max-width:</strong> Yosemite National Park is set within California's Sierra Nevada mountains. It's famed for its giant, ancient sequoias, and for Tunnel View, the iconic vista of towering Bridalveil Fall and the granite cliffs of El Capitan and Half Dome.</p>
    - title: "Spacing"
      extra_classes: "margin-top-1 font-sans-sm measure-3 bg-primary-lighter"
      content: |
        <h1>Page heading</h1>
        <p class="usa-intro">Great Smoky Mountains National Park straddles the border of North Carolina and Tennessee.</p>
        <h2>Section heading</h2>
        <h3>Section of the page</h3>
        <p>The sprawling landscape encompasses lush forests and an abundance of wildflowers that bloom year-round. Streams, rivers and waterfalls appear along hiking routes that include a segment of the Appalachian Trail.</p>
        <h4>Subsection of the page</h4>
        <p>World renowned for its diversity of plant and animal life, the beauty of its ancient mountains, and the quality of its remnants of Southern Appalachian mountain culture, this is America's most visited national park.</p>
        <p>Right now scientists think that we only know about 17 percent of the plants and animals that live in the park, or about 17,000 species of a probable 100,000 different organisms.</p>
        <h5>Subsection of the page</h5>
        <p>Entrance to Great Smoky Mountains National Park is free. The park is one of the few national parks where no entrance fees are charged.</p>
        <ul>
          <li>Unordered list item</li>
          <li>Unordered list item</li>
          <li>Unordered list item
            <ul>
              <li>Nested unordered list item</li>
              <li>Nested unordered list item
                <ul>
                  <li>3rd level nesting</li>
                  <li>3rd level nesting</li>
                  <li>3rd level nesting</li>
                </ul>
              </li>
              <li>Nested unordered list item</li>
              <li>Nested unordered list item</li>
            </ul>
          </li>
        </ul>
        <p>Right now scientists think that we only know about 17 percent of the plants and animals that live in the park, or about 17,000 species of a probable 100,000 different organisms.</p>
        <ol>
          <li>Ordered list item</li>
          <li>Ordered list item
            <ol>
              <li>Nested ordered list item</li>
              <li>Nested ordered list item</li>
              <li>Nested ordered list item</li>
              <li>Nested ordered list item</li>
            </ol>
          </li>
          <li>Ordered list item</li>
        </ol>
        <table>
          <caption>Bordered table</caption>
          <thead>
            <tr>
              <th scope="col">Document title</th>
              <th scope="col">Description</th>
              <th scope="col">Year</th>
            </tr>
          </thead>
          <tbody>
            <tr>
              <th scope="row">Declaration of Independence</th>
              <td>Statement adopted by the Continental Congress declaring independence from the British Empire.</td>
              <td>1776</td>
            </tr>
            <tr>
              <th scope="row">Bill of Rights</th>
              <td>The first ten amendments of the U.S. Constitution guaranteeing rights and freedoms.</td>
              <td>1791</td>
            </tr>
            <tr>
              <th scope="row">Declaration of Sentiments</th>
              <td>A document written during the Seneca Falls Convention outlining the rights that American women should be entitled to as citizens.</td>
              <td>1848</td>
            </tr>
            <tr>
              <th scope="row">Emancipation Proclamation</th>
              <td>An executive order granting freedom to slaves in designated southern states.</td>
              <td>1863</td>
            </tr>
          </tbody>
        </table>