## class: `WyPreviewText`, `wy-preview-text`

Text / code / HTML preview component used in file previews.

**Used sub components:**

*   [`<wy-empty>`](./wy-empty)
*   [`<wy-progress-circular>`](./ui/wy-progress-circular)
*   [`<wy-container>`](./ui/wy-container)

### Fields

| Name   | Type      | Default | Description                                     | Inherited From |
| ------ | --------- | ------- | ----------------------------------------------- | -------------- |
| `src`  | `string`  |         | Source URL of the text asset to preview.        |                |
| `html` | `boolean` | `false` | Render the response as HTML.                    |                |
| `code` | `boolean` | `false` | Apply code styling when rendering text or HTML. |                |

### Events

| Name                  | Type                         | Description                            | Inherited From |
| --------------------- | ---------------------------- | -------------------------------------- | -------------- |
| `file-preview-loaded` | `FilePreviewLoadedEventType` | The file preview is considered loaded. |                |

### Attributes

| Name   | Field | Inherited From |
| ------ | ----- | -------------- |
| `src`  | src   |                |
| `html` | html  |                |
| `code` | code  |                |

### CSS Parts

| Name                  | Description                                    |
| --------------------- | ---------------------------------------------- |
| `wy-content-progress` | Progress indicator shown while loading.        |
| `wy-content-code`     | Container for rendered code content.           |
| `wy-code`             | Modifier for code styling.                     |
| `wy-document`         | Document wrapper used for HTML/text rendering. |
| `wy-content-html`     | Container for rendered HTML.                   |
| `wy-content-text`     | Container for plain text content.              |

<details><summary>Private API</summary>

### Fields

| Name          | Privacy   | Type | Default                           | Description | Inherited From |
| ------------- | --------- | ---- | --------------------------------- | ----------- | -------------- |
| `exportParts` | protected |      | `new ShadowPartsController(this)` |             |                |

</details>

<hr/>

## Exports

| Kind                        | Name              | Declaration   | Module                            | Package |
| --------------------------- | ----------------- | ------------- | --------------------------------- | ------- |
| `js`                        | `WyPreviewText`   | WyPreviewText | lib/components/wy-preview-text.ts |         |
| `custom-element-definition` | `wy-preview-text` | WyPreviewText | lib/components/wy-preview-text.ts |         |
