Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-code-block

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-code-block

Set of unstyled UI components to build powerful code blocks in React.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source


React Code Block 🧩

Set of unstyled UI components to build powerful code blocks in React.





React Code Block banner

Features

  • Unstyled
  • Syntax highlighting
  • Line numbers
  • Line highlighting
  • Word highlighting
  • Theming

Getting started

npm i react-code-block prism-react-renderer

Continue with basic example here →

Documentation

You can find the complete documentation at react-code-block.netlify.app

Why?

Let's face it, building code blocks is hard! There are various libraries out there that handle syntax highlighting, but then you realize that you need more than just syntax highlighting. If you are writing a technical blog or documentation, chances are you need features like line numbers, line highlighting, word highlighting and so on. Most of the syntax highlighting libraries don't come with this out-of-the-box, so you have to spend time implementing all this by yourself. Or if they do come with these features, it's incredibly hard to extend and style them according to the way you want it to be.

React Code Block solves all these problems by only providing you with the core functionality without any of the styling. You can compose the primitive components from this library to build any kind of code block you need.

How does it work?

React Code Block uses prism-react-renderer under the hood for syntax highlighting. On top of this, it adds additional features like line numbers, line highlighting, etc. which can be styled through the primitive components this package exposes.

License

React Code Block is MIT Licensed.

Keywords

FAQs

Package last updated on 18 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc