> Markdown version of [Styling](https://vaadin.com/docs/next/components/pdf-viewer/styling). Section index: [llms.txt](https://vaadin.com/docs/next/components/llms.txt)

# PDF Viewer Styling

## <a id="style-properties"></a>Style Properties

The following style properties can be used in CSS stylesheets to customize the appearance of this component.

To apply values to these properties globally in your application UI, place them in a CSS block using the `html {…​}` selector. See [Component Style Properties](https://vaadin.com/docs/next/styling/styling-components.md#component-style-properties) for more information on style properties.

| Property                                 | Supported by |
| ---------------------------------------- | ------------ |
| `--vaadin-pdf-viewer-background`         | Aura, Lumo   |
| `--vaadin-pdf-viewer-border-color`       | Aura, Lumo   |
| `--vaadin-pdf-viewer-border-radius`      | Aura, Lumo   |
| `--vaadin-pdf-viewer-padding`            | Aura, Lumo   |
| `--vaadin-pdf-viewer-page-background`    | Aura, Lumo   |
| `--vaadin-pdf-viewer-page-gap`           | Aura, Lumo   |
| `--vaadin-pdf-viewer-page-shadow`        | Aura, Lumo   |
| `--vaadin-pdf-viewer-text-color`         | Aura, Lumo   |
| `--vaadin-pdf-viewer-toolbar-background` | Aura, Lumo   |
| `--vaadin-pdf-viewer-toolbar-gap`        | Aura, Lumo   |
| `--vaadin-pdf-viewer-toolbar-padding`    | Aura, Lumo   |

## <a id="css-selectors"></a>CSS Selectors

The following CSS selectors can be used in stylesheets to target the various parts and states of the component. See the [Styling documentation](https://vaadin.com/docs/next/styling.md) for more details on how to style components.

> **Important: Not for Shadow DOM**
>
> These selectors should be used in `styles.css` or another stylesheet loaded with the `@StyleSheet` annotation or the `@import` CSS rule. **They do not work in the shadow DOM of Vaadin components**, such as in stylesheets in the `components` sub-folder or loaded with the `@CssImport` annotation’s `themeFor` property.

---

- Root element

  `vaadin-pdf-viewer`

### <a id="states"></a>States

- Loading a document

  `vaadin-pdf-viewer[loading]`

- Document failed to load

  `vaadin-pdf-viewer[has-error]`

- Page area focused

  `vaadin-pdf-viewer[focused]`

- Page area keyboard focused

  `vaadin-pdf-viewer[focus-ring]`

### <a id="header"></a>Header

- Header

  `vaadin-pdf-viewer::part(header)`

- Title

  `vaadin-pdf-viewer::part(title)`

- Collapse and expand icon

  `vaadin-pdf-viewer::part(header-toggle)`

### <a id="toolbar"></a>Toolbar

- Toolbar

  `vaadin-pdf-viewer::part(toolbar)`

- Group of related controls

  `vaadin-pdf-viewer::part(toolbar-group)`

Each control of the toolbar has a slot of its own. The controls are Vaadin components: the buttons are Button components, the page field is an Integer Field, and the zoom select is a Select. Style them as you style these components.

- Previous page button

  `vaadin-pdf-viewer > [slot="toolbar-previous-page"]`

- Next page button

  `vaadin-pdf-viewer > [slot="toolbar-next-page"]`

- Page field

  `vaadin-pdf-viewer > [slot="toolbar-page"]`

- Zoom out button

  `vaadin-pdf-viewer > [slot="toolbar-zoom-out"]`

- Zoom select

  `vaadin-pdf-viewer > [slot="toolbar-zoom"]`

- Zoom in button

  `vaadin-pdf-viewer > [slot="toolbar-zoom-in"]`

- Download button

  `vaadin-pdf-viewer > [slot="toolbar-download"]`

- Toolbar actions

  `vaadin-pdf-viewer > [slot="toolbar-actions"]`

In Flow, the toolbar actions are inside a container element in the `toolbar-actions` slot. To target the actions themselves, use `vaadin-pdf-viewer > [slot="toolbar-actions"] > *`.

### <a id="pages"></a>Pages

- Scrollable page area

  `vaadin-pdf-viewer::part(content)`

- Page

  `vaadin-pdf-viewer::part(page)`

- Loading indicator

  `vaadin-pdf-viewer::part(loader)`
