Skip to content

Search Feitio

↵ opens the first↑↓ chooseEsc closes

CodeBlock

Code with colors and the Copy button, in its own bar that names the language.

On this page

Playground

HTML
<button type="button" class="feitio-button" data-variant="primary">
  Salvar alterações
</button>
Language
Background
HTML
<div class="feitio-code" data-lang="html"><div class="bar"><span>HTML</span><button type="button" class="feitio-button copy" data-size="small" data-done-label="Copied">Copy</button></div><pre tabindex="0"><code>&lt;button type=&quot;button&quot; class=&quot;feitio-button&quot; data-variant=&quot;primary&quot;&gt;
  Salvar alterações
&lt;/button&gt;</code></pre></div>

When to use

When not to use

Examples

HTML
<button type="submit" class="feitio-button" data-variant="primary">
  Salvar alterações
</button>

HTML

Colors come from Feitio’s roles: the tag in text orange, the attribute in moss, the value in ink. Copy says "Copied" on the button itself and copies plain text.

Show code
HTML
<div class="feitio-code" data-lang="html">
  <div class="bar"><span>HTML</span><button type="button" class="feitio-button copy" data-size="small">Copiar</button></div>
  <pre><code>…</code></pre>
</div>
npm install @made-by-maid/feitio

With the package manager

For install commands, the bar offers npm, pnpm, yarn and bun; the choice applies site-wide and is remembered.

Show code
HTML
<div class="feitio-code" data-lang="shell">
  <div class="bar"><span class="feitio-segmented" role="group" aria-label="Gerenciador de pacotes">…</span>…</div>
  <pre data-pm="npm"><code>npm install @made-by-maid/feitio</code></pre>
  <pre data-pm="pnpm" hidden>…</pre>
</div>

Anatomy

HTML
<a href="/">
  1. Bar: the language, or the package manager choice.
  2. Copy: small, at the end of the bar; says "Copied" in place.
  3. The code, in the role colors.

Accessibility

Attributes

AttributeValuesWhat for
class="feitio-code"requiredThe block.
data-lang"html", "jsx", "css", "shell"Which colors; HTML and JSX get tag colors.
class="copy"the buttonCopies plain text.
data-pmon each <pre>One command per package manager.
Top