<!--
  GENERATED FILE - do not edit by hand.
  Source of truth: src/components/mds-book/usage/ in the magma monorepo.
-->

# mds-book - mistakes

> The API of this component: [`AGENTS.md`](AGENTS.md).

Common incorrect uses of `<mds-book>`. Each entry pairs the wrong form with the right one and a one-line reason. System-wide rules (boolean-as-string, shadow piercing, Tailwind color utilities, raw native event listening) live in [`agents/mistakes.md`](../../../../agents/mistakes.md) - they apply here too but are not repeated.

#### Do Not Use the `title` Attribute for the Title

`title` is the native tooltip of every element: it shows a tooltip and prints nothing on the book. The title of the book is `name`.

```html
<!-- INCORRECT -->
<mds-book src="/covers/manuale.webp" title="Manuale"></mds-book>

<!-- CORRECT -->
<mds-book src="/covers/manuale.webp" name="Manuale"></mds-book>
```

#### Do Not Draw the 3D With `<mds-img>` and CSS Transforms

A transformed `<mds-img>` is a tilted flat picture: no spine, no pages, no drawn cover when the image fails, no reduced-motion handling.

```html
<!-- INCORRECT -->
<mds-img src="/covers/manuale.webp" alt="Manuale" style="transform: perspective(600px) rotateY(25deg)"></mds-img>

<!-- CORRECT -->
<mds-book src="/covers/manuale.webp" name="Manuale"></mds-book>
```

#### Do Not Turn the Book With a Transform

A transform on the host turns the flat box the book is drawn in: the light on the faces, the shadow and the drag still work from the pose, which no longer matches. Pick a `pose`.

```html
<!-- INCORRECT -->
<mds-book src="/covers/manuale.webp" name="Manuale" style="transform: rotateX(60deg)"></mds-book>

<!-- CORRECT -->
<mds-book src="/covers/manuale.webp" name="Manuale" pose="lying"></mds-book>
```

#### Do Not Set Both a Width and a Height

The book keeps the proportions of its format, as an image does: one dimension sets the other. Two that disagree leave the book as wide as its box and the box with a gap or an overflow.

```html
<!-- INCORRECT -->
<mds-book src="/covers/manuale.webp" name="Manuale" style="width: 220px; height: 220px"></mds-book>

<!-- CORRECT -->
<mds-book src="/covers/manuale.webp" name="Manuale" style="height: 320px"></mds-book>
```

#### Do Not Write a Landscape Format as a Separate Orientation

There is no orientation prop: the order of the two numbers of `format` is the orientation.

```html
<!-- INCORRECT -->
<mds-book name="Atlante" format="a4" orientation="landscape"></mds-book>

<!-- CORRECT -->
<mds-book name="Atlante" format="29.7x21"></mds-book>
```

#### Do Not Repeat the Name Next to the Book for Assistive Technologies

The book is already named after `name` and `author`. A visible caption that repeats them makes screen readers read the title twice: mark the book decorative with `alt=""` when a caption names it.

```html
<!-- INCORRECT -->
<figure>
  <mds-book src="/covers/manuale.webp" name="Manuale"></mds-book>
  <figcaption>Manuale</figcaption>
</figure>

<!-- CORRECT -->
<figure>
  <mds-book src="/covers/manuale.webp" name="Manuale" alt=""></mds-book>
  <figcaption>Manuale</figcaption>
</figure>
```
