# Message

An inline message toned by severity, for alerts and context.

## Severities

`severity` sets the tone and the default icon: info and help to explain, success, warning and danger to report.

## Icon

`icon` replaces the default with any Phosphor icon component; `iconSize` takes an Icon size or a number of pixels.

## Content

Children can be any markup, such as a strong lead and a paragraph under it. In a card the message sits in the body's flow, under the prose it qualifies.

## Examples

```svelte
<script lang="ts">
  import SparkleIcon from 'phosphor-svelte/lib/SparkleIcon';
  import Card from '@qualia-studios/design-ui/components/Card.svelte';
  import Message from '@qualia-studios/design-ui/components/Message.svelte';
</script>
```

### Example 1: Severities that explain

```svelte
<div class="col">
  <Message severity="info">This is an informational message.</Message>
  <Message severity="help"
    >Need assistance? Check the documentation.</Message
  >
</div>
```

### Example 2: Severities that report

```svelte
<div class="col">
  <Message severity="success">Operation completed successfully.</Message>
  <Message severity="warning"
    >Proceed with caution — this action has side effects.</Message
  >
  <Message severity="danger"
    >Something went wrong. Please try again.</Message
  >
</div>
```

### Example 3: A custom icon

```svelte
<div class="col">
  <Message severity="info" icon={SparkleIcon}
    >Override the default icon by passing any Phosphor icon component.</Message
  >
</div>
```

### Example 4: Two icon sizes

```svelte
<div class="col">
  <Message severity="info" iconSize="lg">Smaller leading icon (lg).</Message
  >
  <Message severity="info" iconSize={40}>Custom pixel size (40).</Message>
</div>
```

### Example 5: A lead and detail

```svelte
<div class="col">
  <Message severity="danger">
    <strong>Validation failed</strong>
    <p>
      The dataset contains 3 invalid entries. Fix them before resubmitting.
    </p>
  </Message>
</div>
```

### Example 6: In a card body

```svelte
<div class="col">
  <Card header="Dataset upload">
    {#snippet body()}
      <p>
        Your dataset is ready to be processed. Review the summary below
        before continuing.
      </p>
      <Message severity="info">
        Large datasets may take several minutes to validate.
      </Message>
    {/snippet}
  </Card>
</div>
```

---

From the Qualia design guide: https://q-core-3b2732.gitlab.io/components/message. Every page as markdown: https://q-core-3b2732.gitlab.io/llms.txt
