# Structure

To use the `AlertMessage` css as a standalone, without the accompanying React component, please use the following HTML structure.

Class names in brackets [] are optional-/togglable-/decorator- or state dependant classes.

See [Storybook](https://miljodir.github.io/md-components) for examples and more info.

```html
<div
  class="md-alert-message
    [md-alert-message--success]
    [md-alert-message--warning]
    [md-alert-message--error]
    [md-alert-message--info-box]
    [md-alert-message--fullWidth]"
>
  <!-- Theme icon, e.g. from Material Symbols. Omit to hide icon. -->
  <div class="md-alert-message__icon">
    {icon}
  </div>

  <div class="md-alert-message__content [md-alert-message__content--center] [md-alert-message__content--end]">

    <!-- Optional label -->
    <div class="md-alert-message__label">Label text</div>

    <!-- Optional description -->
    <div class="md-alert-message__description [md-alert-message__description--collapsed]" id="description-id">
      Description text
    </div>
    <!-- Rich content (e.g. <p>, <strong>, links) is supported. -->
    <!-- In collapsed state, first text line is shown and ends with ... -->

    <!-- Expand/collapse button — only when expandable -->
    <button
      type="button"
      class="md-alert-message__expand-button"
      aria-expanded="false"
      aria-controled="description-id"
    >
      <span class="md-alert-message__expand-icon" aria-hidden="true">
        <!-- Up arrow icon (shown when expanded) -->
        <div class="md-alert-message__expand-icon__open"><!-- KeyboardArrowUpIcon --></div>
        <!-- Down arrow icon (shown when collapsed) -->
        <div class="md-alert-message__expand-icon__close"><!-- KeyboardArrowDownIcon --></div>
      </span>
      Vis mer
    </button>

  </div>

  <!-- Close button — only when closable. Use html/css from MdIconButton for this button -->
  <div class="md-alert-message__button-wrapper">
    <button class="md-alert-message__button md-icon-button md-icon-button--plain" aria-label="Lukk">
      <!-- Close icon -->
    </button>
  </div>
</div>
```
