Component Library

Links: internal link and external link(opens in a new tab).

Steps Component

The Steps component provides a visually appealing way to present sequential instructions or processes.

  1. First Step

    This is the first step in the process.

    Terminal window
    npm i @nutrient-sdk/viewer
  2. Second Step

    After completing the first step, proceed to the second step.

    // Example code for the second step
    const secondStep = () => {
    console.log('Executing second step');
    };
  3. Final Step

    Complete the process with the final step.

    // Example code for the final step
    const finalStep = () => {
    console.log('Process complete!');
    };

Usage in Markdoc

To use the Steps component in your Markdoc files, use the following syntax:

[STEPS-TAG-OPEN]
1. First step
2. Second step
3. Third step
[STEPS-TAG-CLOSE]

Replace [STEPS-TAG-OPEN] with {% steps %} and [STEPS-TAG-CLOSE] with {% /steps %} in your actual code.

Note the following important formatting requirements:

  • Each step must start with a number followed by a period and space
  • Content under each step should be properly indented
  • Leave blank lines between steps and their content
  • You can use any number for each step (e.g., all "1." or sequential "1., 2., 3.")
  • The component will automatically handle the numbering

Advanced Example

[STEPS-TAG-OPEN]
1. **Add a title to your step**
This is the description for the first step.
```js
// You can include code blocks
const firstStep = () => {
console.log('Executing first step');
};
```
1. **Add images or other components**
You can include other components inside steps.
[PACKAGEMANAGERS-TAG pkg="package-name" /]
1. **Format your content**
Use **bold**, *italic*, or other Markdown formatting.
[STEPS-TAG-CLOSE]

Replace [STEPS-TAG-OPEN] with {% steps %}, [STEPS-TAG-CLOSE] with {% /steps %}, and [PACKAGEMANAGERS-TAG pkg="package-name" /] with {% packagemanagers pkg="package-name" /%} in your actual code.

Usage in Astro Components

In Astro components, you can use the Steps component directly:

<Steps>
<ol>
<li>
<strong>First Step</strong>
<p>Description of the first step.</p>
</li>
<li>
<strong>Second Step</strong>
<p>Description of the second step.</p>
</li>
<li>
<strong>Final Step</strong>
<p>Description of the final step.</p>
</li>
</ol>
</Steps>

Tabs Component

The Tabs component allows you to organize content into multiple tabbed sections, making it easier for users to navigate between related information.

This is the content for Tab 1.

You can include any Markdown content here, including:

  • Lists
  • Bold text
  • Italic text
  • Code blocks
// Form option.
formOption = {
"label": "name",
"value": "John Appleseed"
};

Usage in Markdoc

To use the Tabs component in your Markdoc files, use the following syntax:

[TABS-TAG-OPEN]
[TABITEM-TAG label="Tab 1"]
Content for Tab 1
[TABITEM-TAG-CLOSE]
[TABITEM-TAG label="Tab 2"]
Content for Tab 2
[TABITEM-TAG-CLOSE]
[TABITEM-TAG label="Tab 3" icon="icon-name"]
Content for Tab 3
[TABITEM-TAG-CLOSE]
[TABS-TAG-CLOSE]

Replace the placeholders with the actual Markdoc tags:

  • [TABS-TAG-OPEN] → {% tabs %}
  • [TABS-TAG-CLOSE] → {% /tabs %}
  • [TABITEM-TAG label="Tab 1"] → {% tabitem label="Tab 1" %}
  • [TABITEM-TAG-CLOSE] → {% /tabitem %}

Attributes

The Tabs component supports the following attributes:

  • syncKey (optional): A unique identifier to synchronize tab selection across multiple tab groups

The TabItem component supports the following attributes:

  • label (required): The text displayed in the tab
  • icon (optional): An icon to display alongside the label

Usage in Astro Components

In Astro components, you can use the Tabs component directly:

<Tabs>
<TabItem label="Tab 1">
<p>Content for Tab 1</p>
</TabItem>
<TabItem label="Tab 2">
<p>Content for Tab 2</p>
</TabItem>
<TabItem label="Tab 3" icon="icon-name">
<p>Content for Tab 3</p>
</TabItem>
</Tabs>

SwitcherTabs Component

The Switcher tabs component allows you to organize content into tabbed sections similar to tabs, but each tab points to a separate URL. This is useful for creating a tabbed navigation system where each tab corresponds to a different page or section.

The tab representing the current page is automatically highlighted.

NOTE: Switcher tabs turn into a dropdown on smaller screens.

Tab 1

This is the content for Overview Tab.

You can include any Markdown content here, including:

  • Lists
  • Bold text
  • Italic text
  • Code blocks

Usage in Markdoc

To use the Tabs component in your Markdoc files, use the following syntax:

[SWITCHER-TABS-TAG-OPEN]
[SWITCHER-TABITEM-TAG label="Tab 1" url="/guides/sample-components/tab1" SWITCHER-TABITEM-TAG-CLOSE]
[SWITCHER-TABITEM-TAG label="Tab 2" url="/guides/sample-components/tab2" SWITCHER-TABITEM-TAG-CLOSE]
[SWITCHER-TABITEM-TAG label="Tab 3" url="/guides/sample-components/tab3" SWITCHER-TABITEM-TAG-CLOSE]
[SWITCHER-TABS-TAG-CLOSE]

Replace the placeholders with the actual Markdoc tags:

  • [TABS-TAG-OPEN] → {% switcherTabs %}
  • [TABS-TAG-CLOSE] → {% /switcherTabs %}
  • [TABITEM-TAG label="Tab 1"] → {% switcherTabItem label="Tab 1" %}
  • [TABITEM-TAG-CLOSE] → {% /switcherTabItem %}

Attributes

The SwitcherTabItem component supports the following attributes:

  • label (required): The text displayed in the tab
  • url (required): The URL to navigate to when the tab is clicked

Usage in Astro Components

In Astro components, you can use the SwitcherTabs component directly:

<SwitcherTabs>
<SwitcherTabItem label="Tab 1" url="/guides/sample-components/tab1" />
<SwitcherTabItem label="Tab 2" url="/guides/sample-components/tab2" />
<SwitcherTabItem label="Tab 3" url="/guides/sample-components/tab3" />
</SwitcherTabs>

PackageManagers Component

The PackageManagers component displays installation or command instructions for multiple package managers (npm, yarn, pnpm).

Terminal window
npm i @nutrient-sdk/viewer
Terminal window
npm i -D @nutrient-sdk/viewer
Terminal window
npm i vite
Terminal window
npm run dev

Usage in Markdoc

To use the PackageManagers component in your Markdoc files, use the following syntax:

[PACKAGEMANAGERS-TAG pkg="package-name" /]

Replace [PACKAGEMANAGERS-TAG pkg="package-name" /] with {% packagemanagers pkg="package-name" /%} in your actual code.

Attributes

The PackageManagers component supports the following attributes:

  • pkg (optional): The name of the package to install
  • extrapkg (optional): Comma-separated list of additional package managers to display (e.g., "bun" or "bun,deno")
  • args (optional): Additional arguments to pass to the command
  • dev (optional, boolean): Whether to install as a dev dependency
  • type (optional): The type of command to run. Possible values:
    • install (default): Install a package
    • run: Run a script
    • remove: Remove a package
    • create: Create a new project
    • exec: Execute a command
    • dlx: Run a package without installing it
  • comment (optional): A comment to display alongside the command
  • title (optional): A title for the command block
  • icons (optional, boolean): Whether to display package manager icons (default: true)
  • prefix (optional): A prefix to add to the command

Usage in Astro Components

In Astro components, you can use the PackageManagers component directly:

<PackageManagers pkg="@nutrient-sdk/viewer" />
<PackageManagers pkg="@nutrient-sdk/viewer" dev={true} />
<PackageManagers type="run" args="dev" />

CodeBlock Component

The CodeBlock component provides syntax-highlighted code blocks with additional features like line highlighting, titles, and more.

example.js
// This line is marked
const example = () => {
// This line is also marked
console.log('Hello, world!');
// This line is inserted
return true;
// This line is deleted
};

Code Block with Collapsible Sections

collapsible-example.js
5 collapsed lines
// All this boilerplate setup code will be collapsed
import { someBoilerplateEngine } from '@example/some-boilerplate'
import { evenMoreBoilerplate } from '@example/even-more-boilerplate'
const engine = someBoilerplateEngine(evenMoreBoilerplate())
// This part of the code will be visible by default
engine.doSomething(1, 2, 3, calcFn)
function calcFn() {
// You can have multiple collapsed sections
3 collapsed lines
const a = 1
const b = 2
const c = a + b
// This will remain visible
console.log(`Calculation result: ${a} + ${b} = ${c}`)
return c
}
4 collapsed lines
// All this code until the end of the block will be collapsed again
engine.closeConnection()
engine.freeMemory()
engine.shutdown({ reason: 'End of example boilerplate code' })
Long Code Block
import NutrientViewer from "@nutrient-sdk/viewer";
const customTheme = {
elevation: {
low: "0 0 4px 0 rgba(0, 0, 0, 0.4)",
medium: "0 4px 16px 0 rgba(0, 0, 0, 0.15)",
},
opacity: {
none: "0",
low: "0.1",
medium: "0.5",
high: "0.9",
},
324 collapsed lines
rounded: {
xs: "2px",
sm: "4px",
md: "8px",
lg: "12px",
xl: "16px",
"2xl": "24px",
full: "9999px",
},
spacing: {
xs: "2px",
sm: "4px",
md: "8px",
lg: "12px",
xl: "16px",
"2xl": "24px",
"3xl": "32px",
"4xl": "40px",
"5xl": "48px",
"6xl": "64px",
"7xl": "80px",
"8xl": "96px",
"9xl": "160px",
},
color: {
support: {
error: {
subtler: "#711b00",
subtle: "#b53007",
medium: "#fe7a68",
strong: "#ffd4ce",
},
success: {
subtler: "#223a03",
subtle: "#3C6612",
medium: "#80CC34",
strong: "#ecfeda",
},
warning: {
subtler: "#562800",
subtle: "#bd5a00",
medium: "#eb7f00",
strong: "#ffd4a1",
},
info: {
subtler: "#190d94",
subtle: "#4537de",
medium: "#777cf0",
strong: "#d3dcff",
},
},
focused: {
default: "#FB6F3B",
inset: "#5B1C0F",
},
background: {
primary: {
subtle: "#5B1C0F",
medium: "#431207",
strong: "#180501",
},
interactive: {
enabled: "#FB6F3B",
hovered: "#FEB609",
active: "#FFC938",
visited: "#FFC938",
disabled: "rgb(84.7% 28.6% 16.1% / 0.5)",
},
inverse: {
subtle: "#E95635",
medium: "#FFC938",
strong: "#FFE7A9",
},
secondary: {
subtle: "#762B1A",
medium: "#A93920",
strong: "#D84929",
},
overlay: {
subtle: "rgb(100% 90.6% 66.3% / 0.25)",
medium: "rgb(9.41% 1.96% 0.39% / 0.5)",
interactive: "rgb(98.4% 43.5% 23.1% / 0.25)",
},
positive: {
subtle: "#FFC938",
medium: "#FEDE89",
strong: "#FFE7A9",
interactive: {
enabled: "#5B1C0F",
},
},
},
text: {
primary: "#FFE7A9",
secondary: "#FEB609",
helper: "#FB6F3B",
placeholder: "#FB6F3B",
inverse: "#5B1C0F",
oninteractive: "#5B1C0F",
interactive: {
enabled: "#FB6F3B",
hovered: "#FEB609",
active: "#FFC938",
visited: "#FFC938",
disabled: "rgb(100% 90.6% 66.3% / 0.5)",
},
},
icon: {
primary: "#FFE7A9",
secondary: "#FB6F3B",
inverse: "#5B1C0F",
oninteractive: "#5B1C0F",
interactive: {
enabled: "#FB6F3B",
hovered: "#FEB609",
active: "#FFC938",
visited: "#FFC938",
disabled: "rgb(100% 90.6% 66.3% / 0.5)",
},
},
border: {
subtle: "#762B1A",
medium: "#A93920",
strong: "#D84929",
inverse: "#FFE7A9",
interactive: {
enabled: "#FB6F3B",
hovered: "#FEB609",
active: "#FFC938",
visited: "#FFC938",
disabled: "#D84929",
},
positive: {
interactive: {
enabled: "#5B1C0F",
},
subtle: "#FFC938",
medium: "#FEB609",
strong: "#FB6F3B",
},
},
},
typography: {
heading: {
h6: {
regular: {
font: '400 0.875rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
medium: {
font: '500 0.875rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
semibold: {
font: '600 0.875rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
},
h5: {
regular: {
font: '400 1rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
medium: {
font: '500 1rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
semibold: {
font: '600 1rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
},
h4: {
regular: {
font: '400 1.375rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0",
},
medium: {
font: '500 1.375rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0",
},
semibold: {
font: '600 1.375rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0",
},
},
h3: {
regular: {
font: '400 1.5rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0",
},
medium: {
font: '500 1.5rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0",
},
semibold: {
font: '600 1.5rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0",
},
},
h2: {
regular: {
font: '400 1.75rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0",
},
medium: {
font: '500 1.75rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0",
},
semibold: {
font: '600 1.75rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0",
},
},
h1: {
regular: {
font: '400 2rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0",
},
medium: {
font: '500 2rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0",
},
semibold: {
font: '600 2rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0",
},
},
},
label: {
sm: {
regular: {
font: '400 0.688rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.05px",
},
medium: {
font: '500 0.688rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.05px",
},
semibold: {
font: '600 0.688rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.05px",
},
},
md: {
regular: {
font: '400 0.75rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
medium: {
font: '500 0.75rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
semibold: {
font: '600 0.75rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
},
lg: {
regular: {
font: '400 0.875rem/1.375 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
medium: {
font: '500 0.875rem/1.375 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
semibold: {
font: '600 0.875rem/1.375 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
},
},
body: {
sm: {
regular: {
font: '400 0.75rem/1.375 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.05px",
},
medium: {
font: '500 0.75rem/1.375 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.05px",
},
semibold: {
font: '600 0.75rem/1.375 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.05px",
},
},
md: {
regular: {
font: '400 0.875rem/1.375 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
medium: {
font: '500 0.875rem/1.375 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
semibold: {
font: '600 0.875rem/1.375 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
},
lg: {
regular: {
font: '400 1rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
medium: {
font: '500 1rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
semibold: {
font: '600 1rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
},
},
},
}
NutrientViewer.load({
theme: customTheme,
document: "YOUR_DOCUMENT_URL",
});

Usage in Markdoc

To create a code block with additional features, wrap the attributes in {% %}:

```js [OPEN]% title="example.js" frame="terminal" mark=[1,3] ins=[5] del=[7] %[CLOSE]
// Your code here
```

Replace [OPEN] with { and [CLOSE] with } in your actual code.

Available Attributes

The Code Block component supports these attributes:

  • lang: The language for syntax highlighting (e.g., "js", "python", "bash")
  • title: Add a title to the code block
  • frame: Choose display style ("terminal", "browser", "code", "none")
  • meta: Additional meta information
  • locale: The locale for the code block
  • wrap: Whether to wrap long lines (boolean)
  • preserveIndent: Whether to preserve indentation (boolean)
  • showLineNumbers: Whether to show line numbers (boolean)
  • startLineNumber: Start counting from a specific number
  • mark: Line numbers to highlight (array)
  • ins: Line numbers to mark as inserted (array)
  • del: Line numbers to mark as deleted (array)
  • collapse: Line ranges to make collapsible (e.g., "{1-5, 12-14, 21-24}")
  • collapseStyle: Where the summary line is located (e.g., "github", "collapsible-start")

Usage in Astro Components

In Astro components, you can use the CodeBlock component directly:

<CodeBlock
language="js"
title="example.js"
frame="terminal"
mark={[1, 3]}
ins={[5]}
del={[7]}
showLineNumbers
startLineNumber={1}
collapse="{1-5,15-25}"
>
{`// Your code here
const example = () => {
// This line is also marked
console.log('Hello, world!');
// This line is inserted
return true;
// This line is deleted
};`}
</CodeBlock>

Github Code Component

The Github Code component displays code snippets from GitHub repositories. It is very similar to the CodeBlock component but is specifically designed for displaying code from GitHub.

[GITHUB-CODE-TAG
lang="vb"
samplePath="app/src/main/java/com/pspdfkit/catalog/examples/java/DynamicMultimediaAnnotationExample.java"
showLineNumbers=true /%]

Usage in Markdoc

To create a code block with additional features, wrap the attributes in {% %}:

[GITHUB-CODE-TAG lang="vb" samplePath="app/src/main/java/com/pspdfkit/catalog/examples/java/DynamicMultimediaAnnotationExample.java" /]

Available Attributes

The Github Code component supports these attributes:

  • url (required): The URL of the raw code snippet on GitHub.
  • lang: The language for syntax highlighting (e.g., "js", "python", "bash")
  • title: Add a title to the code block
  • frame: Choose display style ("terminal", "browser", "code", "none")
  • meta: Additional meta information
  • locale: The locale for the code block
  • wrap: Whether to wrap long lines (boolean)
  • preserveIndent: Whether to preserve indentation (boolean)
  • showLineNumbers: Whether to show line numbers (boolean)
  • startLineNumber: Start counting from a specific number
  • mark: Line numbers to highlight (array)
  • ins: Line numbers to mark as inserted (array)
  • del: Line numbers to mark as deleted (array)

Usage in Astro Components

In Astro components, you can use the GithubCode component directly:

<GithubCode
url="https://raw.githubusercontent.com/PSPDFKit/pspdfkit-android-catalog/master/app/src/main/java/com/pspdfkit/catalog/examples/java/DynamicMultimediaAnnotationExample.java"
language="js"
title="example.js"
frame="terminal"
/>

Alert Component

The Alert component is used to display alerts to the user. It can be used to display warnings, errors, or other important information.

Testing here is extremely tricky; Apple saves absolute paths in the binary, so if you happen to have the same username on the build machine and your test machine, it might work, but it fails somewhere else. It also seems that LLDB uses the shared module cache, so you need to delete DerivedData on every run. And (see later in this article), where you store the example and which other files you store also play into this — dare I say, this was extremely confusing and frustrating to debug.

This is a paragraph.

This is another paragraph.

This is a link to a page.

One line alert box.

Default alert with no props. There is no text in this alert. The text is not visible. No text.

One line alert box.

Discover what's new! Check out our changelog for the latest release updates, of which there are a lot.

Read more →

Usage in Markdoc

To use the Alert component in your Markdoc files, use the following syntax:

[ALERT-TAG text="Alert text" type="warning" line="multi-line" boxed=false /]

Attributes

The Alert component supports the following attributes:

  • type (optional): The type of alert to display (warning, success, error, neutral-gray)
  • line (optional): The line style to use (multi-line, single-line)
  • boxed (optional, boolean): Whether to display the alert in a boxed format (default: false)

Usage in Astro Components

In Astro components, you can use the Alert component directly:

<Alert
type="neutral-gray"
line="single-line"
boxed={false}
>
One line alert box.
</Alert>

List Component

The List component is used to display lists of items. It can work with both ordered and unordered lists.

  1. Item 1
    1. Item 1.1
    2. Item 1.2
    3. Item 1.3
  2. Item 2
  3. Item 3
  • Item 1
    • Item 1.1
    • Item 1.2
    • Item 1.3
  • Item 2
  • Item 3
  • First arrow item
  • Second arrow item
  • Third arrow item
  • First check item
  • Second check item
  • Third check item
  • First item
  • Second item
    • Item 3.1
    • Item 3.2
      • Item 3.2.1
      • Item 3.2.2
      • Item 3.2.3
    • Item 3.3
  • Fourth item

Quote Component

The Quote component is used to display quotes/testimonials from a person.

Angelica Nierras
Chief Growth Officer

Nutrient helps us significantly accelerate our time to market, provide key services to our clients, and reliably deliver solutions that we can easily integrate into our portfolio.

Faria Education Group

Nutrient helps us significantly accelerate our time to market, provide key services to our clients, and reliably deliver solutions that we can easily integrate into our portfolio.

Usage in Markdoc

To use the Quote component in your Markdoc files, use the following syntax:

[QUOTE-TAG
size="big"
name="Angelica Nierras"
position="Chief Growth Officer"
company="Faria Education Group" /]
Quote here
[QUOTE-TAG /]

Attributes

The Quote component supports the following attributes:

  • size (optional): The size of the quote (big, small)
  • name (optional): The name of the person who said the quote
  • position (optional): The position of the person who said the quote
  • company (optional): The company of the person who said the quote

Usage in Astro Components

In Astro components, you can use the Quote component directly:

<Quote
size="big"
name="Angelica Nierras"
position="Chief Growth Officer"
company="Faria Education Group"
/>
Quote here
</Quote>

CTA Component

The CTA component is used to display a call to action. It can be used to display a button or a link.

Ready to get started?

Ready to get started?

Ready to get started?

Usage in Markdoc

To use the CTA component in your Markdoc files, use the following syntax:

[CTA-TAG color="accent" supertitle="Ready to get started?" href="https://www.nutrient.io/try" boxed=false /]
Ready to get started?
[CTA-TAG /]

Attributes

The CTA component supports the following attributes:

  • color (optional): The color of the CTA (neutral, accent)
  • supertitle (optional): The supertitle of the CTA
  • href (optional): The href of the CTA
  • boxed (optional, boolean): Whether to display the CTA in a boxed format (default: false)

Usage in Astro Components

In Astro components, you can use the CTA component directly:

<CTA
color="accent"
supertitle="Ready to get started?"
href="https://www.nutrient.io/try"
boxed={false}
/>
Ready to get started?
</CTA>

Alternate CTA

Try it Free

Try our product for free and see the difference.

Upgrade Your Experience

Get access to premium features and priority support.

Premium features illustration

Tag Component

The Tag component is used to display a tag.

Tag name

Tag name

Tag name

Tag name

Tag name

Usage in Markdoc

[TAG-TAG color="accent" variant="text" href="/try" filter=false /]

Attributes

The Tag component supports the following attributes:

  • color (optional): The color of the tag (to be used with variant bullet or text. NOTE: This does not change the color of the button, only the bullet point or text)
  • variant (optional): The variant of the tag (text, bullet), to be used with color
  • href (optional): The href of the tag
  • filter (optional, boolean): Whether to display the tag as a clickable filter (default: false)

Usage in Astro Components

In Astro components, you can use the Tag component directly:

<Tag
color="accent"
variant="text"
href="/try"
filter={false}
/>
Tag name
</Tag>

Tables

2 Columns

Feature DescriptionStatus
Advanced user authentication system with multi-factor authentication, password recovery, and session management capabilities✅ Live
Basic contact form with email validation🚧 Testing
Comprehensive analytics dashboard featuring real-time user behavior tracking, conversion funnels, and detailed reporting with exportable data formats📋 Planned

3 Columns

Project TitleBudgetTeam Lead Notes
E-commerce platform redesign with modern UI/UX patterns, mobile-first approach, and enhanced checkout flow$85,000Sarah mentioned concerns about the timeline given the complexity of the payment integration. Need to discuss with the client about potentially phasing the rollout.
Bug fixes$2,500Quick turnaround
Customer relationship management system overhaul including automated email campaigns, lead scoring, and integration with existing sales tools$45,000Mike has experience with similar CRM implementations. Should be straightforward but will require data migration.

4 Columns

Course NameDurationPrerequisitesCourse Description
Introduction to Web Development12 weeksNoneA comprehensive beginner-friendly course covering HTML5, CSS3, JavaScript fundamentals, responsive design principles, and basic version control with Git. Students will build three projects including a personal portfolio website.
Advanced React Patterns3 daysReact basics, JavaScript ES6+Intensive workshop focusing on advanced React concepts including custom hooks, context patterns, performance optimization, and state management strategies.
Data Structures16 weeksProgramming fundamentals, basic mathematicsIn-depth exploration of fundamental data structures and algorithms including arrays, linked lists, trees, graphs, sorting algorithms, and complexity analysis with practical implementation exercises.
UX Design Bootcamp8 weeksDesign thinking basicsHands-on program covering user research methodologies, wireframing, prototyping tools, usability testing, and design systems creation with real client projects.

5 Columns

CompanyIndustryRevenueEmployeesRecent Developments
TechCorp SolutionsSoftware Development$2.4M45Just secured Series A funding of $8M to expand their AI-powered customer service platform. Planning to hire 20 new engineers and open a European office by Q3. The CEO announced partnerships with three major enterprises.
Local BakeryFood & Beverage$180K8New location opening next month
DataFlow AnalyticsBusiness Intelligence$890K23Recently launched their machine learning-powered predictive analytics suite. The product has gained traction with mid-market companies looking to optimize their supply chain operations. Currently in talks with a Fortune 500 company for a pilot program.
Green Energy CoRenewable Energy$5.7M78Completed installation of 50MW solar farm project ahead of schedule. Received government contract worth $12M for rural electrification program. Stock price up 23% this quarter.

6 Columns

Product NameCategoryPriceInventoryCustomer ReviewsMarketing Notes
UltraBook Pro 15"Laptops$1,29947"Exceptional build quality and performance. The battery life easily lasts a full work day, and the display is crisp and vibrant. Some users reported minor heating issues during intensive tasks, but overall satisfaction is very high. Would definitely recommend for professional use."Premium positioning working well. Consider highlighting the sustainable materials in next campaign. Sales team reports strong interest from creative professionals.
Wireless EarbudsAudio$79203"Good value for money but could improve"Price-sensitive segment
Smart Home HubIoT$14912"Setup was more complicated than expected, but once configured, it works flawlessly. Integration with major smart home brands is seamless. The mobile app could use some UI improvements, but the functionality is solid. Great for tech-savvy users."Inventory running low - reorder soon
Gaming Mouse RGBPeripherals$4589"Perfect for competitive gaming. Highly responsive and customizable. The RGB lighting effects are a nice touch, though they can be disabled for a more professional look. Ergonomics are excellent for extended gaming sessions."Popular with streamers and esports community. Consider sponsorship opportunities. Recent firmware update improved performance significantly.
Column 1Column 2
Vimeo Video Title
Cosmin IorgusCosmin Iorgus
AndroidiOS

Card Grid

Label Card Grid

Usign Grid

Documentation

Documentation

Documentation

Documentation

Using Flex (Recomanded for a number of uneven cards )

Documentation

Documentation

Documentation

Documentation

Documentation

Grid

Simple Responsive Grid

A responsive grid that changes columns at different breakpoints:

Item 1

Item 2

Item 3

Item 4

Item 5

Item 6

Item 7

Item 8

Item 9

Item 10

Item 11

Item 12

Basic 12-Column Grid

A simple 12-column grid that demonstrates the basic structure:

span 12

span 6

span 6

span 4

span 4

span 4

span 3

span 3

span 3

span 3

Responsive 12-Column Grid

A 12-column grid that adapts to different screen sizes:

12 cols on mobile → 6 on tablet → 4 on desktop

12 cols on mobile → 6 on tablet → 4 on desktop

12 cols on mobile → 12 on tablet → 4 on desktop

Grid with Specific Positioning

A grid with specific column and row positioning:

Item 1: Full width on mobile, spans 2x2 on tablet+

Item 2: Full width on mobile, col 3 on tablet+

Item 3: Full width on mobile, col 4 on tablet+

Item 4: Full width on mobile, col 5 on tablet+

Item 5: Full width on mobile, col 3, row 2 on tablet+

Item 6: Full width on mobile, col 4, row 2 on tablet+

Item 7: Full width on mobile, col 5, row 2 on tablet+

Another Grid Layout Example

A grid with different positioning and spanning:

Item 1: Default position

Item 2: Default position

Item 3: Default position

Item 4: Col 1, Row 2

Item 5: Col 2, Row 2

Item 6: Col 3, Row 2

Item 7: Spans 2x2 at Col 4, Row 1

Nested Grid Example

A grid with nested grids inside some of the items:

Regular Item

This is a standard grid item without any nested content.

Item with Nested Grid

This item contains a nested grid with its own layout:

Nested Item 1

Nested Item 2

Nested Item 3 (Full Width)

Full Width Item with Complex Nested Grid

This item spans the full width and contains a more complex nested grid:

Nested Item A (2 cols)

Nested Item B

Nested Item C

Deeply Nested Grid

Deep 1

Deep 2

Deep 3

Basic Flex Layout

A simple flex layout with items:

Flex Item 1

Flex Item 2

Flex Item 3

Responsive Flex Layout

A flex layout that changes direction on different screen sizes:

Card 1

This card will stack vertically on mobile and arrange horizontally on larger screens.

Card 2

Each card takes up equal space with flex-1.

Card 3

Flex is great for card layouts and responsive designs.

Advanced Flex Layout Examples

Holy Grail Layout

A classic "holy grail" layout with header, footer, main content, and sidebars:

Header

Fixed width on desktop, full width on mobile.

Main Content

This area takes up all remaining space. On mobile, the sidebars stack above and below.

The holy grail layout is a classic web design pattern that provides a header, footer, and three columns.

Also fixed width on desktop, full width on mobile.

Footer

Masonry-Style Layout

A Pinterest-like masonry layout with items of different heights:

Card 1

This is a short card.

Card 2

This card has more content.

It spans multiple lines to create a taller card in the layout.

The height of this card will affect the layout of other cards.

Card 3

Another short card.

Card 4

This card has a medium amount of content.

It has two paragraphs to make it taller than the shortest cards.

Card 5

A short card again.

Card 6

The last card in our masonry layout.

This demonstrates how flex-wrap and flex-basis can create a responsive masonry-style layout.

Dashboard Layout

A complex dashboard-style layout with nested flex containers:

Navigation

Dashboard

Analytics

Reports

Settings

Quick Stats

Users 1,234

Revenue $5,678

Conversion 12.3%

Main Dashboard Area

This is the main content area of our dashboard layout. In a real application, this would contain charts, tables, and other data visualizations.

The dashboard layout demonstrates how to create complex nested layouts using flexbox.

Activity Feed
  • User John signed up
  • New order #1234 received
  • Product inventory updated
Alerts
  • System maintenance scheduled
  • Payment gateway error
  • New feature deployed

Dialog Component

The Dialog component is used to display a dialog (usually a cookie consent dialog).

We use cookies to improve your experience and for marketing. Learn more in our privacy policy.

We use cookies to improve your experience and for marketing. Learn more in our privacy policy.

Usage in Markdoc

To use the Dialog component in your Markdoc files, use the following syntax:

[DIALOG-TAG hasX=true /]

Attributes

The Dialog component supports the following attributes:

  • color (optional): The color of the dialog (red, green, yellow, pink)
  • hasX (optional, boolean): Whether to display the X button (default: false)

Usage in Astro Components

In Astro components, you can use the Dialog component directly:

<Dialog hasX={true}>
We use cookies to improve your experience and for marketing. Learn more in our privacy policy.
</Dialog>

Button Component

The Button component is used to display a button.

Click me Click me Click me Click me Click me Click me Click me

Accordion Component

The Accordion component is used to display a list of items in an accordion. It should be used with the AccordionItem component.

What are some common use cases for HTML to PDF conversion in JavaScript?

Common use cases include generating invoices, reports, tickets, and any other documents that need to be downloadable or printable from a web application.

What are some common use cases for HTML to PDF conversion in JavaScript?

Common use cases include generating invoices, reports, tickets, and any other documents that need to be downloadable or printable from a web application.

Long Code Block
import NutrientViewer from "@nutrient-sdk/viewer";
const customTheme = {
elevation: {
low: "0 0 4px 0 rgba(0, 0, 0, 0.4)",
medium: "0 4px 16px 0 rgba(0, 0, 0, 0.15)",
},
opacity: {
none: "0",
low: "0.1",
medium: "0.5",
high: "0.9",
},
rounded: {
xs: "2px",
sm: "4px",
md: "8px",
lg: "12px",
xl: "16px",
"2xl": "24px",
full: "9999px",
},
spacing: {
xs: "2px",
sm: "4px",
md: "8px",
lg: "12px",
xl: "16px",
"2xl": "24px",
"3xl": "32px",
"4xl": "40px",
"5xl": "48px",
"6xl": "64px",
"7xl": "80px",
"8xl": "96px",
"9xl": "160px",
},
color: {
support: {
error: {
subtler: "#711b00",
subtle: "#b53007",
medium: "#fe7a68",
strong: "#ffd4ce",
},
success: {
subtler: "#223a03",
subtle: "#3C6612",
medium: "#80CC34",
strong: "#ecfeda",
},
warning: {
subtler: "#562800",
subtle: "#bd5a00",
medium: "#eb7f00",
strong: "#ffd4a1",
},
info: {
subtler: "#190d94",
subtle: "#4537de",
medium: "#777cf0",
strong: "#d3dcff",
},
},
focused: {
default: "#FB6F3B",
inset: "#5B1C0F",
},
background: {
primary: {
subtle: "#5B1C0F",
medium: "#431207",
strong: "#180501",
},
interactive: {
enabled: "#FB6F3B",
hovered: "#FEB609",
active: "#FFC938",
visited: "#FFC938",
disabled: "rgb(84.7% 28.6% 16.1% / 0.5)",
},
inverse: {
subtle: "#E95635",
medium: "#FFC938",
strong: "#FFE7A9",
},
secondary: {
subtle: "#762B1A",
medium: "#A93920",
strong: "#D84929",
},
overlay: {
subtle: "rgb(100% 90.6% 66.3% / 0.25)",
medium: "rgb(9.41% 1.96% 0.39% / 0.5)",
interactive: "rgb(98.4% 43.5% 23.1% / 0.25)",
},
positive: {
subtle: "#FFC938",
medium: "#FEDE89",
strong: "#FFE7A9",
interactive: {
enabled: "#5B1C0F",
},
},
},
text: {
primary: "#FFE7A9",
secondary: "#FEB609",
helper: "#FB6F3B",
placeholder: "#FB6F3B",
inverse: "#5B1C0F",
oninteractive: "#5B1C0F",
interactive: {
enabled: "#FB6F3B",
hovered: "#FEB609",
active: "#FFC938",
visited: "#FFC938",
disabled: "rgb(100% 90.6% 66.3% / 0.5)",
},
},
icon: {
primary: "#FFE7A9",
secondary: "#FB6F3B",
inverse: "#5B1C0F",
oninteractive: "#5B1C0F",
interactive: {
enabled: "#FB6F3B",
hovered: "#FEB609",
active: "#FFC938",
visited: "#FFC938",
disabled: "rgb(100% 90.6% 66.3% / 0.5)",
},
},
border: {
subtle: "#762B1A",
medium: "#A93920",
strong: "#D84929",
inverse: "#FFE7A9",
interactive: {
enabled: "#FB6F3B",
hovered: "#FEB609",
active: "#FFC938",
visited: "#FFC938",
disabled: "#D84929",
},
positive: {
interactive: {
enabled: "#5B1C0F",
},
subtle: "#FFC938",
medium: "#FEB609",
strong: "#FB6F3B",
},
},
},
typography: {
heading: {
h6: {
regular: {
font: '400 0.875rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
medium: {
font: '500 0.875rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
semibold: {
font: '600 0.875rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
},
h5: {
regular: {
font: '400 1rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
medium: {
font: '500 1rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
semibold: {
font: '600 1rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
},
h4: {
regular: {
font: '400 1.375rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0",
},
medium: {
font: '500 1.375rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0",
},
semibold: {
font: '600 1.375rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0",
},
},
h3: {
regular: {
font: '400 1.5rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0",
},
medium: {
font: '500 1.5rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0",
},
semibold: {
font: '600 1.5rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0",
},
},
h2: {
regular: {
font: '400 1.75rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0",
},
medium: {
font: '500 1.75rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0",
},
semibold: {
font: '600 1.75rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0",
},
},
h1: {
regular: {
font: '400 2rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0",
},
medium: {
font: '500 2rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0",
},
semibold: {
font: '600 2rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0",
},
},
},
label: {
sm: {
regular: {
font: '400 0.688rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.05px",
},
medium: {
font: '500 0.688rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.05px",
},
semibold: {
font: '600 0.688rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.05px",
},
},
md: {
regular: {
font: '400 0.75rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
medium: {
font: '500 0.75rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
semibold: {
font: '600 0.75rem/1.25 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
},
lg: {
regular: {
font: '400 0.875rem/1.375 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
medium: {
font: '500 0.875rem/1.375 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
semibold: {
font: '600 0.875rem/1.375 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
},
},
body: {
sm: {
regular: {
font: '400 0.75rem/1.375 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.05px",
},
medium: {
font: '500 0.75rem/1.375 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.05px",
},
semibold: {
font: '600 0.75rem/1.375 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.05px",
},
},
md: {
regular: {
font: '400 0.875rem/1.375 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
medium: {
font: '500 0.875rem/1.375 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
semibold: {
font: '600 0.875rem/1.375 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
},
lg: {
regular: {
font: '400 1rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
medium: {
font: '500 1rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
semibold: {
font: '600 1rem/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif',
letterSpacing: "0.1px",
},
},
},
},
}
NutrientViewer.load({
theme: customTheme,
document: "YOUR_DOCUMENT_URL",
});

Label Component

Default label

Neutral label and some more text

Neutral label and some more text

Neutral label and some more text

Neutral label and some more text

Label

Label image

Label

Separator

The Separator component is used to separate content. It can be used to create a visual break between sections of content.

Primary separator (default):


Secondary separator:


Custom classes to separators:



Usage in Markdoc

[SEPARATOR-TAG type="secondary" /]

Usage in Astro

<Separator type="secondary" />

Attributes

  • type (optional): The type of separator (primary, secondary)
  • class (optional): Additional classes to apply to the separator

Spacer

The Spacer component is used to create space between elements.

This text is above the spacer.

There is a spacer with pt-10 below this text.

This text is below the spacer.

Usage in Markdoc

[SPACER-TAG class="pt-10" /]

Usage in Astro

<Spacer class="pt-10" />

Attributes

  • class (optional): Additional classes to apply to the spacer

Short Feature

The Short Feature component displays a feature with an icon or number, title, and description in a compact horizontal layout.

With Icon

No trial key required
You have the option to try our SDK without obtaining a trial key.
30-day full access
Unlock our SDK's full capabilities with a 30-day trial key.
Get started in minutes
Our guides are designed to get you up and running within minutes.

With Number

1
Install the SDK
Add our SDK to your project using npm or yarn package manager.
2
Configure your app
Set up the viewer with your license key and document URL.
3
Start building
Customize the UI and add advanced features to match your needs.

Usage in Markdoc

[SHORT-FEATURE-TAG
iconProps={name: "dotted/unlock"}
title="No trial key required"
description="You have the option to try our SDK without obtaining a trial key." /]
[SHORT-FEATURE-TAG
number="1"
title="Install the SDK"
description="Add our SDK to your project using npm or yarn package manager." /]

Replace [SHORT-FEATURE-TAG with {% shortFeature and /] with /%} in your actual code.

Usage in Astro

import ShortFeature from "@/components/common/ShortFeature.astro";
<!-- With Icon -->
<ShortFeature
iconProps={{ name: "dotted/unlock" }}
title="No trial key required"
description="You have the option to try our SDK without obtaining a trial key."
/>
<!-- With Number -->
<ShortFeature
number="1"
title="Install the SDK"
description="Add our SDK to your project using npm or yarn package manager."
/>

Attributes

  • iconProps (object, optional): Icon component props including name, width, height, and class
    • name (string, required): Icon name (e.g., "dotted/unlock")
    • width (string, optional): Icon width (default: "32")
    • height (string, optional): Icon height (default: "32")
    • class (string, optional): Additional classes for the icon
  • number (string, optional): Number to display instead of icon (e.g., "1", "2", "3")
  • title (string, required): Feature title
  • description (string, required): Feature description
  • class (string, optional): Additional classes to apply to the component

Note: Either iconProps or number must be provided, but not both.

Logo Switcher

The Logo Switcher component is used to display a list of logos.

Usage in Markdoc

[LOGOSWITCHER-TAG logos=["...", "...", "..."] background="default" /]

Usage in Astro

<LogoSwitcher
background="transparent"
logos={[
"customer-logos/autodesk",
"customer-logos/disney",
"customer-logos/ubs",
]}
/>

Attributes

The LogoSwitcher component supports the following attributes:

  • logos (required): The logo icons to display
  • background (optional): The background color, either default or transparent
  • class (optional): Any custom classes

Video

The Video component is used to display a video from a URL or a local file.

Video poster
Vimeo Video Title

Video with no given aspect ratio and full width

Video with no given aspect ratio and limited with (%)

Video with no given aspect ratio and limited with (px)

Usage in Markdoc

[VIDEOPLAYER-TAG class="mb-10" src="@/assets/videos/article-header.mp4" poster="@/assets/videos/video-poster.jpg" controls=true muted=true /]

Usage in Astro

<VideoPlayer class="mb-10" src="@/assets/videos/article-header.mp4" poster="@/assets/videos/video-poster.jpg" controls={true} muted={true} />

Attributes

  • src (required): URL for self-hosted video or ID for YouTube/Vimeo
  • type (optional): Type of video (self-hosted, YouTube, Vimeo)
  • title (optional): Video title (for accessibility)
  • class (optional): Additional classes to apply to the video
  • aspectRatio (optional): Aspect ratio (16:9, 4:3, etc.)
  • poster (optional): Poster image URL or ImageMetadata
  • controls (optional): Show video controls
  • autoplay (optional): Autoplay video
  • loop (optional): Loop video
  • muted (optional): Mute video
  • preload (optional): Preload strategy (auto, metadata, none)
  • width (optional): Video width
  • height (optional): Video height
  • startAt (optional): Start time in seconds
  • showInfo (optional): Show video info (YouTube)
  • showRelated (optional): Show related videos (YouTube)
  • showControls (optional): Show player controls (YouTube/Vimeo)
  • privacyMode (optional): Enable privacy-enhanced mode

Image Component

The Image component is used to display an image. It can be used with a URL or a local file.

Cosmin Iorgus

Image - multiple images on brakepoints

Responsive image example

Usage in Markdoc

[IMAGE-TAG src="/src/assets/images/people/cosmin-iorgus.jpg" width=40 class="mx-auto" /]

Usage in Astro

<Image src="/src/assets/images/people/cosmin-iorgus.jpg" width=40 class="mx-auto" />

Attributes

  • src (required): URL for image
  • alt (optional): Alt text for image
  • width (optional): Image width
  • height (optional): Image height
  • class (optional): Additional classes to apply to the image
  • title (optional): Title for image (for accessibility)

TLDR

Quick Recap

This is a styled summary with a custom title.

Testimonial Component

The Testimonial component displays customer testimonials with optional headshots, company logos, and call-to-action buttons. It supports two variants: standard and large.

Complete testimonial with all fields

Name Surname's headshot
Name Surname
Position

"Using Pilotbrief and Mercury allows this all to be done electronically, saving not only paper but also precious time."

Company

Minimal testimonial (essential fields only)

Name Surname
Position

"Minimal example demonstrating essential fields only."

Company

Large size with button

Angelica Nierras's headshot
Angelica Nierras
Chief Growth Officer

"Nutrient helps us significantly accelerate our time to market, provide key services to our clients, and reliably deliver solutions that we can easily integrate into our portfolio."

Faria Education Group

Usage in Markdoc

To use the Testimonial component in your Markdoc files, use the following syntax:

[TESTIMONIAL-TAG
headshot="@/assets/images/people/cosmin-iorgus.jpg"
name="Name Surname"
position="Position"
company="Company"
logo="customer-logos/ibm" /]
Your testimonial quote here
[TESTIMONIAL-TAG /]

Replace [TESTIMONIAL-TAG with {% testimonial and [TESTIMONIAL-TAG /] with {% /testimonial %} in your actual code.

Attributes

The Testimonial component supports the following attributes:

Required attributes:

  • name (required): The name of the person giving the testimonial

Optional attributes:

  • position (optional): The person's job title or position
  • company (optional): The person's company or organization
  • size (optional): Size variant ("large" for larger testimonials, default is "small")
  • headshot (optional): Path to the person's headshot image
  • logo (optional): Company logo identifier (references logos in the assets directory) - only visible in small size
  • boxed (optional, boolean): Whether to display with background and padding (default: true). Only applies to small size; large size is always boxed
  • class (optional): Additional CSS classes to apply to the testimonial

Button functionality (requires size="large"):

  • buttonText (required for button): Text for the call-to-action button
  • buttonUrl (required for button): URL for the button link
  • buttonIcon (optional): Icon to display in the button

Note: Button functionality only works with size="large". Both buttonText and buttonUrl are required for the button to display, while buttonIcon is optional.

Usage in Astro Components

In Astro components, you can use the Testimonial component directly:

<Testimonial
name="Name Surname"
position="Position"
company="Company"
headshot="@/assets/images/people/cosmin-iorgus.jpg"
size="large"
buttonText="read case study"
buttonUrl="/case-study"
buttonIcon="dotted/check"
boxed={true}
>
Your testimonial quote here
</Testimonial>

GuidesList Component

The GuidesList component automatically scans .mdoc files within a folder or subfolder and generates an index list of guides. It's perfect for creating dynamic lists that stay up-to-date as you add or remove guide files.

Basic Usage

With Descriptions

Ordered List

Usage in Markdoc

<nav aria-label="List of guides guides in java/conversion"><ul class="guides-list"><li class="guides-list-item"><a href="/guides/java/conversion/pdf-to-excel-document/" class="guides-list-link"><span class="guides-list-title">PDF to Excel</span></a></li><li class="guides-list-item"><a href="/guides/java/conversion/pdf-to-html/" class="guides-list-link"><span class="guides-list-title">PDF to HTML</span></a></li><li class="guides-list-item"><a href="/guides/java/conversion/pdf-to-powerpoint-document/" class="guides-list-link"><span class="guides-list-title">PDF to PowerPoint</span></a></li><li class="guides-list-item"><a href="/guides/java/conversion/pdf-to-word-document/" class="guides-list-link"><span class="guides-list-title">PDF to Word</span></a></li><li class="guides-list-item"><a href="/guides/java/conversion/powerpoint-document-to-pdf/" class="guides-list-link"><span class="guides-list-title">PowerPoint to PDF</span></a></li><li class="guides-list-item"><a href="/guides/java/conversion/word-document-to-pdf/" class="guides-list-link"><span class="guides-list-title">Word to PDF</span></a></li><li class="guides-list-item"><a href="/guides/java/conversion/word-document-to-pdf-ua/" class="guides-list-link"><span class="guides-list-title">Word to PDF/UA</span></a></li><li class="guides-list-item"><a href="/guides/java/conversion/word-document-to-pdf-including-comments/" class="guides-list-link"><span class="guides-list-title">Word to PDF with comments</span></a></li><li class="guides-list-item"><a href="/guides/java/conversion/excel-document-to-pdf/" class="guides-list-link"><span class="guides-list-title">Excel to PDF</span></a></li><li class="guides-list-item"><a href="/guides/java/conversion/markdown-to-pdf/" class="guides-list-link"><span class="guides-list-title">Markdown to PDF</span></a></li></ul></nav>
<nav aria-label="List of guides guides in ios/tutorials"><ul class="guides-list"></ul></nav>
<nav aria-label="List of sdk guides in android/advanced"><div class="guides-list guides-list-div" role="list"></div></nav>

Attributes

The GuidesList component supports the following attributes:

Required attributes:

  • folder (required): The folder path to scan for guides (relative to collection root)

Optional attributes:

  • collection (optional): Content collection to scan ("guides", "sdk", "blog"). Default: "guides"
  • includeSubfolders (optional, boolean): Whether to include files from subfolders. Default: true
  • orderBy (optional): How to sort the guides ("title", "order", "filename"). Default: "order"
  • showDescriptions (optional, boolean): Whether to display guide descriptions. Default: false
  • listStyle (optional): Display format ("ul", "ol", "div"). Default: "ul"
  • class (optional): Additional CSS classes to apply

Key Features

  • Automatic Discovery: Scans folders for .mdoc files and generates links
  • Smart Filtering: Excludes partial files (starting with _) and index files
  • Frontmatter Integration: Extracts title, description, and order from file metadata
  • Flexible URLs: Supports custom permalinks or generates URLs from file paths
  • Navigation Consistency: Uses sidenav_label when available for consistent navigation
  • Multiple Layouts: Supports unordered lists, ordered lists, and div-based layouts

Usage in Astro Components

In Astro components, you can use the GuidesList component directly:

<GuidesList
collection="guides"
folder="java/conversion"
showDescriptions={true}
listStyle="ul"
orderBy="order"
/>