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

@osmn-byhn/mdarea

v0.0.7

Published

A powerful, accessible, and highly customizable React Markdown Editor component. It provides a rich writing experience with split-pane preview, toolbar formatting, and comprehensive styling options.

Downloads

742

Readme

@osmn-byhn/mdarea

A powerful, accessible, and highly customizable React Markdown Editor component. It provides a rich writing experience with split-pane preview, toolbar formatting, and comprehensive styling options.

Features

  • Split-pane View: Write and preview markdown side-by-side.
  • Toolbar: Rich formatting toolbar (Bold, Italic, Headings, Lists, Code, etc.).
  • Syntax Highlighting: Built-in support for code block syntax highlighting.
  • Customizable: Full control over styles, labels, and classes.
  • Mobile Friendly: Tabbed interface for mobile devices.

Installation

pnpm add @osmn-byhn/mdarea

Basic Usage

Import the component and the necessary CSS.

import { useState } from 'react'
import { MarkdownEditor } from '@osmn-byhn/mdarea'
import '@osmn-byhn/mdarea/styles.css'

function App() {
  const [value, setValue] = useState('# Hello World')

  return (
    <div style={{ height: '500px' }}>
      <MarkdownEditor
        value={value}
        onChange={setValue}
        placeholder="Start writing..."
      />
    </div>
  )
}

Component API

<MarkdownEditor />

The main component that integrates the editor, toolbar, and preview.

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | value | string | undefined | The markdown content. | | onChange | (value: string) => void | undefined | Callback fired when content changes. | | placeholder | string | undefined | Placeholder text shown when empty. | | className | string | '' | Class name for the outer container. | | previewStyle | CSSProperties | {} | Inline styles applied to the preview pane. | | labels | MarkdownEditorLabels | {} | Custom labels for UI elements. | | classNames | MarkdownEditorClassNames | {} | Granular class names for sub-components. |

Customizing Labels (labels prop)

You can translate or customize the button labels for the mobile view tabs.

<MarkdownEditor
  labels={{
    write: 'Düzenle',
    preview: 'Önizleme'
  }}
/>

Customizing Styles (classNames prop)

Use classNames to add custom classes to specific parts of the editor without using !important global overrides.

<MarkdownEditor
  classNames={{
    container: 'my-editor-root',
    toolbar: 'my-toolbar',
    toolbarBtn: 'my-tool-btn',
    contentArea: 'my-content',
    textArea: 'my-textarea',
    previewPane: 'my-preview'
  }}
/>

CSS Customization

The editor uses plain CSS with standard classes. You can override styles globally if preferred.

Core classes:

  • .md-editor-container: Main wrapper.
  • .md-toolbar-container: Toolbar wrapper.
  • .md-content-area: Wrapper for editor/preview panes.
  • .md-pane: Individual pane (editor or preview).
  • .md-textarea: The raw textarea input.

Advanced Usage

If MarkdownEditor doesn't fit your layout needs, you can compose your own editor using the sub-components.

import { EditorProvider, Toolbar, Editor, Preview } from '@osmn-byhn/mdarea'

function CustomLayout() {
  return (
    <EditorProvider initialValue="# Custom Layout">
      <div className="my-custom-layout">
        <Toolbar />
        <div className="columns">
          <Editor />
          <Preview />
        </div>
      </div>
    </EditorProvider>
  )
}

Want you run or test the project live on the web? Storybook is deployed on Vercel. You can access it at MdArea Storybook.