🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

c063

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

c063

A React component for displaying code snippets with syntax highlighting.

latest
Source
npmnpm
Version
1.7.1
Version published
Maintainers
1
Created
Source
icon

c063

npm version license

A highly customizable React component library for displaying syntax-highlighted code snippets. Supports multiple languages and themes, making it ideal for documentation, blogs, or educational platforms.

✨ Project Overview

c063 is a syntax highlighting component built with React and TypeScript. It offers flexible theming and a modular architecture that makes it easy for developers to embed code blocks into their applications.

⚡️ Features

  • ✏️ Display code snippets with syntax highlighting.
  • 🌟 Multiple theme support: GitHub, Visual Studio, Light/Dark, etc.
  • 🔄 Modular design for easy integration and customization.
  • 📖 Perfect for tutorials, blog posts, and educational content.

🚀 Installation & Usage

Installation

npm install c063

Usage Example

import { CodeBlock } from "c063";

const tokens = [
  [
    { type: "keyword1", children: "const" },
    { type: "default", children: " " },
    { type: "variable", children: "x" },
    { type: "default", children: " = " },
    { type: "number", children: "42" },
  ],
];

<CodeBlock tokenLines={tokens} theme="github-light" />;

📂 Project Structure

src
├── components/         # Component files
│   ├── CodeBlock.tsx   # Code block container
│   ├── CodeLine.tsx    # Single line component
│   ├── CodeToken.tsx   # Individual token component
├── libs/               # Theme and configuration
│   └── themes/         # Color themes
├── types/              # Type definitions
├── utils/              # Utility functions and parsers
└── index.ts            # Module export entry

🔍 API / Props Reference

CodeBlock<T>

interface CodeBlockProps<T extends React.ElementType> {
  tokenLines: CodeTokenProps<T>[][];
  showLineNumbers?: boolean; // Default true
  lineNumberStyle?: React.CSSProperties;
  theme?: CodeTheme; // e.g. "github-dark"
  autoWrap:? boolean;
}

CodeLine<T>

interface CodeLineProps<T extends React.ElementType> {
  tokens: CodeTokenProps<T>[];
  theme?: CodeTheme;
  autoWrap:? boolean;
}

CodeToken<T>

interface CodeTokenProps<T extends React.ElementType> {
  type?: CodeTokenType;
  theme?: CodeTheme;
  children: React.ReactNode;
  as?: T; // Custom rendering tag
}

Utilities

  • c063.<type>(): Quickly create tokens, e.g., c063.keyword1("const").
  • whiteSpace(count): Insert a specific number of whitespace tokens.

✍️ Contributing

All contributions are welcome, including but not limited to:

  • Bug fixes or performance improvements
  • New theme submissions
  • Support for more programming languages

Before submitting a PR, please fork the repository and create a new branch for your changes.

📄 License

This project is licensed under the MIT license.

Repository:

https://github.com/fanyuuu2006/c063

Keywords

c063

FAQs

Package last updated on 04 Mar 2026

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