Skip to content

Search Feitio

↵ opens the first↑↓ chooseEsc closes

DocPage

The documentation page template: the site header, the area navigation, the content and the page index, ready. Whoever uses it only fills in the regions.

On this page

When to use

When not to use

The regions

The template only divides the page. What goes in each region comes in as a property; it builds the rest by itself.

RegionTakesWhat for
area"design", "dev", "comp"The site area. Marks the current area in the header.
sideNavthe area navigationThe groups and pages of the area, with the current one marked. On the left on wide screens; in the Drawer on mobile.
crumbshort textWhere the page sits: the area and the group.
titletextThe page title, the only h1.
ledeone or two sentencesWhat it is, in one sentence, right below the title.
childrenthe sectionsThe content: sections with h2 and, inside, h3, each with an id. The Anchor comes from them.
toctrue (default), falseShows the Anchor. Turn it off only on short, single-section pages.

What comes built in

Widths

Content rules

Code

React

JSX
<DocPage
  area="comp"
  sideNav={componentsNav}
  crumb="Componentes, base"
  title="Button"
  lede="Um botão faz uma ação na tela onde está."
>
  <Section id="quando" title="Quando usar">…</Section>
  <Section id="exemplos" title="Exemplos">
    <Example id="ex-principal" title="Principal" code={primarySource}>
      <Button variant="primary">Salvar alterações</Button>
    </Example>
  </Section>
</DocPage>

The HTML it produces

HTML
<header class="site-header">…</header>          <!-- automático -->
<div class="site-body has-side has-toc">
  <aside class="site-side">                   <!-- a coluna, até o rodapé -->
    <div class="side-inner">…sideNav…<span class="feitio-scroll-fade" aria-hidden="true"></span></div>
  </aside>
  <main class="site-main" id="conteudo" tabindex="-1">
    <p class="crumb">…crumb…</p>
    <h1>…title…</h1>
    <p class="lede">…lede…</p>
    <details class="toc-mobile">…</details>    <!-- automático, dos h2 e h3 -->
    …children…
  </main>
  <aside class="site-toc">                    <!-- automático, dos h2 e h3 -->
    <div class="side-inner">…Anchor…<span class="feitio-scroll-fade" aria-hidden="true"></span></div>
  </aside>
</div>
<a class="feitio-button feitio-back-to-top" …>Topo</a>   <!-- automático -->
<span class="feitio-scroll-fade" aria-hidden="true"></span>   <!-- automático -->
<footer class="site-footer">…</footer>       <!-- automático -->

The Button page is a page built with this template.

Top