npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@xsolla/xui-markdown

v0.106.0

Published

A React component that renders markdown content with consistent, theme-aware styling. Uses `react-markdown` under the hood.

Downloads

8,355

Readme

Markdown

A React component that renders markdown content with consistent, theme-aware styling. Uses react-markdown under the hood.

Installation

npm install @xsolla/xui-markdown
# or
yarn add @xsolla/xui-markdown

Demo

Basic Markdown

import * as React from 'react';
import { Markdown } from '@xsolla/xui-markdown';

export default function BasicMarkdown() {
  const content = `
# Hello World

This is a paragraph with **bold** and *italic* text.

- Item one
- Item two
- Item three
  `;

  return <Markdown>{content}</Markdown>;
}

Headings and Paragraphs

import * as React from 'react';
import { Markdown } from '@xsolla/xui-markdown';

export default function HeadingsDemo() {
  const content = `
# Heading 1
## Heading 2
### Heading 3
#### Heading 4

This is a regular paragraph with some text content.

Another paragraph following the first one.
  `;

  return <Markdown>{content}</Markdown>;
}

Code Blocks

import * as React from 'react';
import { Markdown } from '@xsolla/xui-markdown';

export default function CodeDemo() {
  const content = `
Inline code: \`const x = 1;\`

Code block:
\`\`\`javascript
function greet(name) {
  return \`Hello, \${name}!\`;
}
\`\`\`
  `;

  return <Markdown>{content}</Markdown>;
}

Anatomy

import { Markdown } from '@xsolla/xui-markdown';

<Markdown
  className="custom-markdown"  // CSS class
>
  {markdownContent}
</Markdown>

Examples

Rich Content

import * as React from 'react';
import { Markdown } from '@xsolla/xui-markdown';

export default function RichContent() {
  const content = `
# Product Documentation

## Getting Started

Follow these steps to integrate our SDK:

1. Install the package
2. Configure your API keys
3. Initialize the SDK

> **Note:** Make sure to keep your API keys secure and never commit them to version control.

### Code Example

\`\`\`javascript
import { SDK } from '@example/sdk';

const client = new SDK({
  apiKey: process.env.API_KEY,
});

await client.initialize();
\`\`\`

### Links and Images

Visit our [documentation](https://docs.example.com) for more details.

![Example diagram](https://example.com/diagram.png)
  `;

  return <Markdown>{content}</Markdown>;
}

Dynamic Content

import * as React from 'react';
import { Markdown } from '@xsolla/xui-markdown';

export default function DynamicContent() {
  const [content, setContent] = React.useState('# Hello\n\nStart typing...');

  return (
    <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 16 }}>
      <textarea
        value={content}
        onChange={(e) => setContent(e.target.value)}
        style={{ height: 300, fontFamily: 'monospace' }}
      />
      <div style={{ background: '#1a1a1a', padding: 16, borderRadius: 8 }}>
        <Markdown>{content}</Markdown>
      </div>
    </div>
  );
}

Article Display

import * as React from 'react';
import { Markdown } from '@xsolla/xui-markdown';

export default function ArticleDisplay() {
  const article = `
# Understanding Game Monetization

## Introduction

Game monetization is a critical aspect of game development that determines how a game generates revenue.

## Key Strategies

### In-App Purchases

In-app purchases (IAP) allow players to buy virtual goods:

- Cosmetic items
- Power-ups
- Premium currency
- Battle passes

### Subscription Models

Subscription models provide ongoing value:

1. **Monthly subscriptions** - Regular content updates
2. **Season passes** - Time-limited content access
3. **Premium tiers** - Enhanced features

> "The best monetization strategies provide value to players while generating sustainable revenue."

## Conclusion

Choose a monetization strategy that aligns with your game design and player expectations.
  `;

  return (
    <article style={{ maxWidth: 800, margin: '0 auto' }}>
      <Markdown>{article}</Markdown>
    </article>
  );
}

API Reference

Markdown

MarkdownProps:

| Prop | Type | Default | Description | | :--- | :--- | :------ | :---------- | | children | string | - | Markdown content to render. | | className | string | - | CSS class name for the container. |

Supported Markdown Syntax

| Element | Syntax | | :------ | :----- | | Heading 1 | # Heading | | Heading 2 | ## Heading | | Heading 3 | ### Heading | | Heading 4 | #### Heading | | Bold | **text** | | Italic | *text* | | Link | [text](url) | | Image | ![alt](url) | | Inline code | `code` | | Code block | ```language | | Blockquote | > quote | | Unordered list | - item | | Ordered list | 1. item |

Typography Styles

| Element | Font Size | Line Height | Weight | | :------ | :-------- | :---------- | :----- | | h1 | 40px | 48px | 700 | | h2 | 32px | 38px | 700 | | h3 | 28px | 34px | 700 | | h4 | 24px | 28px | 700 | | p | 16px | 22px | 400 | | li | 16px | 22px | 400 |

Theming

The Markdown component automatically uses theme colors from XUIProvider:

  • Text color from content.primary
  • Link color from control.link.primary
  • Blockquote border from border.brand
  • Code background with subtle transparency

Accessibility

  • Headings create a proper document outline
  • Links are styled with visible focus states
  • Images require alt text in markdown syntax
  • Code blocks are contained in <pre> elements for proper semantics