---
title: "How It Works"
description: "What happens between the HTML and the content appearing."
canonical_url: "https://kukson777.github.io/boneprint/docs/guide/under-the-hood"
---
# How It Works

> What happens between the HTML and the content appearing.

1. The server sends the slot's markup rendered with the sample, with its text transparent.
2. A script in `<head>` finds skeletons as the page is parsed. There's one per page, and components render no `<script>` tags.
3. Before the first paint, the script measures lines with `Range.getClientRects` and draws the bones. If memory has a shape for this window width, it uses that instead.
4. After hydration, the component redraws the bones when the width changes and when fonts and images load.
5. When the data arrives, content fades in over the skeleton, and the height animates if it differs.

Change the width below and turn on the hidden markup to see the bars follow the real lines of text:

<code-preview>
<measure-demo>



</measure-demo>

<template v-slot:code="">

```vue
<template>
  <div :style="{ width: `${width}%` }">
    <Skeleton :loading="true">
      <h4>The bars are measured, not guessed</h4>

      <p>Narrow this block and watch the text wrap.</p>
    </Skeleton>
  </div>
</template>
```

</template>
</code-preview>

All measuring happens before any writing, so skeletons don't force layout on each other. The shimmer animates with `transform` and stays off the main thread.


## Sitemap

See the full [sitemap](https://kukson777.github.io/boneprint/sitemap.md) for all pages.
