<section class="overview">

## Overview

The Cardinal system page heros are made up of different components that can be easily customized.
</section>

<section class="usage-guides">

<hr>

## Usage

<section class="usage-guides">

### Installation

<hr class="ta-shortDivider">

 Consult the <a href="http://dds.us.aegon.com/implementation" target="_blank" rel="noopener noreferrer">Implementation</a> section before continuing with component specific instructions.

Install @cardinal/hero with:

`$ npm install --save @cardinal/hero`

</section>

<section class="usage-guides">

### Implementation

<hr class="ta-shortDivider">

Import the Cardinal Hero element into an existing Angular project by adding a link to the `hero.js` file in the `scripts` section of the `angular.json` file.

```json
"scripts": [
  "node_modules/@cardinal/hero/hero.js",
]
```

To include the Cardinal button element in a non-Angular project, point to the `js` file of the element with a `script` tag in your `index.html` file.

```html
<body>
  <script src="node_modules/@cardinal/hero/hero.js"></script>
</body>
```

#### Polyfills
Please refer to the Support for Angular Elements section of the <a href="implementation">Implementation</a> page for documentation on required polyfills for Angular elements.

</section>

<section class="usage-guides">

<h4 class="-mt-2xl">Primary</h4>

<div>
  <ta-hero
    title="Lorem impsum dolar"
    img-src="https://www.okhumane.org/wp-content/uploads/2015/12/Kitten-Hero-Background-1.png"
    img-alt="Kitten background"
    focal-point="right">
  </ta-hero>
</div>

```html
  <ta-hero
    title="Lorem impsum dolar"
    img-src="https://www.okhumane.org/wp-content/uploads/2015/12/Kitten-Hero-Background-1.png"
    img-alt="Kitten background"
    focal-point="right">
  </ta-hero>
```

<h4 class="-mt-2xl">Secondary</h4>

The Secondary Hero variant is used for Child pages, and can take in an optional link in the form of a Cardinal <a href="/buttons/developer-reference">Button</a>.

<div>
  <ta-hero
    variant="secondary"
    title="Lorem impsum component dolor"
    subtitle="subtitle dolor">
    <ta-button class-list="-m-md" icon="ta-arrow-right" icon-pos="right">Optional Link</ta-button>
  </ta-hero>
</div>

```html
  <ta-hero
    variant="secondary"
    title="Lorem impsum component dolor"
    subtitle="subtitle dolor">
    <ta-button class-list="-m-md" icon="ta-arrow-right" icon-pos="right">Optional Link</ta-button>
  </ta-hero>
```

</section>

<section class="usage-guides">

<h4 class="-mt-2xl section-h4">Accesibility</h4>

The Cardinal Hero element primary variant requires the `img-alt` input in order to adhere to WCAG AA accessibility standards for Discernable Alt Text. Failing to include the input for `img-alt` on Primary Hero variants will result in a console error.

Hero images should have meaningful, general-purpose alt text that describes the depicted image or its purpose. Descriptive alt text is vital for screenreader users to understand a hero image's purpose.

While Primary Variant image is added via CSS as a background-image, an `<img>` tag is supplied and hidden from view and given the proper accessibility attributes.

<div>
  <ta-hero
    title="Lorem impsum dolar"
    img-src="https://www.trafalgar.com/~/media/images/website-refresh/hero/capecodhighlights-hero-835007464.jpg?mw=1200&"
    img-alt="A Cape Cod dune trail arching upwards towards the blue sky quilted with clouds."
    focal-point="center bottom">
  </ta-hero>
</div>

```html
  <ta-hero
    title="Lorem impsum dolar"
    img-src="https://www.trafalgar.com/~/media/images/website-refresh/hero/capecodhighlights-hero-835007464.jpg?mw=1200&"
    img-alt="A Cape Cod dune trail arching upwards towards the blue sky quilted with clouds."
    focal-point="center bottom">
  </ta-hero>
```
</section>

<section class="usage-guides">

#### Parameters

<div class="table">
<table style="width: 100%;">
  <thead>
    <th>Input Name</td>
    <th>Type</td>
    <th>Options</td>
    <th>Default</th>
    <th>Required</th>
    <th>Description</td>
  </thead>
    <tr>
      <td class="label -initialText">title</td>
      <td>string</td>
      <td class="-initialText">Any string</td>
      <td class="-initialText">undefined</td>
      <td>No</td>
      <td>Adds hero title text</td>
    </tr>
    <tr>
      <td class="label -initialText">subtitle</td>
      <td>string</td>
      <td class="-initialText">Any string</td>
      <td class="-initialText">undefined</td>
      <td>No</td>
      <td>Adds hero subtitle text on Secondary variants</td>
    </tr>
    <tr>
      <td class="label -initialText">variant</td>
      <td>string</td>
      <td class="-initialText">primary, secondary</td>
      <td class="-initialText">primary</td>
      <td>No</td>
      <td>Sets base hero style</td>
    </tr>
    <tr>
      <td class="label -initialText">img-src</td>
      <td>string</td>
      <td class="-initialText">Any string pointing to an internal or external url</td>
      <td class="-initialText">undefined</td>
      <td>Yes (On Primary variant)</td>
      <td>Adds background image to Primary hero</td>
    </tr>
    <tr>
      <td class="label -initialText">img-alt</td>
      <td>string</td>
      <td class="-initialText">Any descriptive string</td>
      <td class="-initialText">undefined</td>
      <td>Yes (On Primary variant)</td>
      <td>Adds Discernable alt text to hero image</td>
    </tr>
    <tr>
      <td class="label -initialText">focal-point</td>
      <td>string</td>
      <td class="-initialText">Values for the CSS <a href="https://www.w3schools.com/cssref/pr_background-position.asp" target="_blank">Background Position</a> property</td>
      <td class="-initialText">center</td>
      <td>Yes (On Primary variant)</td>
      <td>Adds Discernable alt text to hero image</td>
    </tr>
  <tbody>
</table>
</div>

</section>

</section>
