heading

Information

Folder
src/components/patterns/heading

Files

Schema
// src/components/patterns/heading/schema.yaml

$schema: http://json-schema.org/draft-07/schema
$id: /patterns/heading
additionalProperties: false
type: object
required:
  - heading
  - heading_tag
properties:
  heading:
    type: string
    format: html
  heading_tag:
    type: string
    enum:
      - h1
      - h2
      - h3
      - h4
      - h5
      - h6
  id:
    type: string
Mocks
// src/components/patterns/heading/mocks.yaml

$variants:
  - $name: h1
    heading_tag: h1
    heading: H1 The quick brown fox jumps over the lazy dog
  - $name: h2
    heading_tag: h2
    heading: H2 The quick brown fox jumps over the lazy dog
  - $name: h3
    heading_tag: h3
    heading: H3 The quick brown fox jumps over the lazy dog
  - $name: h4
    heading_tag: h4
    heading: H4 The quick brown fox jumps over the lazy dog
  - $name: h5
    heading_tag: h5
    heading: H5 The quick brown fox jumps over the lazy dog
  - $name: h6
    heading_tag: h6
    heading: H6 The quick brown fox jumps over the lazy dog
Template
// src/components/patterns/heading/heading.twig

<{{ heading_tag }}{{ id is not empty ? ' id="' ~ id ~ '"' : '' }}>
	{{ heading }}
</{{ heading_tag }}>

Variants

h1
Open

H1 The quick brown fox jumps over the lazy dog

h2
Open

H2 The quick brown fox jumps over the lazy dog

h3
Open

H3 The quick brown fox jumps over the lazy dog

h4
Open

H4 The quick brown fox jumps over the lazy dog

h5
Open
H5 The quick brown fox jumps over the lazy dog
h6
Open
H6 The quick brown fox jumps over the lazy dog