Convert Figma logo to code with AI

carbon-app logocarbon

:black_heart: Create and share beautiful images of your source code

34,434
1,906
34,434
85

Top Related Projects

34,438

:black_heart: Create and share beautiful images of your source code

🎨 Beautiful images of your code — from right inside your terminal.

The world's most popular non-default computer lockscreen.

📄 CLI that generates beautiful README.md files

📸 Polaroid for your code

Quick Overview

Carbon is an open-source web application that allows users to create and share beautiful images of their source code. It provides a sleek interface for customizing the appearance of code snippets, making them visually appealing for presentations, documentation, or social media sharing.

Pros

  • Easy to use with a simple, intuitive interface
  • Supports a wide range of programming languages and themes
  • Offers various customization options for background, window style, and syntax highlighting
  • Allows for easy sharing and exporting of created images

Cons

  • Limited to creating static images, not suitable for interactive code demonstrations
  • Requires an internet connection to use the web application
  • May not support some niche programming languages or custom syntax highlighting

Getting Started

To use Carbon, follow these steps:

  1. Visit the Carbon website at https://carbon.now.sh/
  2. Paste your code into the editor
  3. Customize the appearance using the options panel on the right
  4. Click the "Tweet" button to share on Twitter or "Export" to download the image

Note: Carbon is a web application, not a code library, so there are no code examples or installation instructions required.

Competitor Comparisons

34,438

:black_heart: Create and share beautiful images of your source code

Pros of Carbon

  • Actively maintained with regular updates and bug fixes
  • Large community with over 30k stars on GitHub
  • Extensive documentation and examples available

Cons of Carbon

  • Limited customization options for advanced users
  • Potential performance issues with large code snippets
  • Dependency on external services for some features

Code Comparison

Carbon:

import React from 'react'
import { useTheme } from 'next-themes'

export default function ThemeToggle() {
  const { theme, setTheme } = useTheme()
  // ... rest of the component
}

Carbon>:

// No relevant code comparison available
// as Carbon> is not a separate repository

Summary

The comparison between Carbon and Carbon> is not applicable, as Carbon> is not a separate repository. Carbon is the main project, while Carbon> likely refers to a specific feature or version within the Carbon repository. The pros and cons listed for Carbon are based on the actual Carbon project. For an accurate comparison, it would be necessary to compare Carbon with a different code snippet sharing tool or image generation project.

🎨 Beautiful images of your code — from right inside your terminal.

Pros of carbon-now-cli

  • Command-line interface allows for quick and easy code snippet creation without leaving the terminal
  • Supports batch processing of multiple files
  • Integrates well with existing CLI workflows and scripts

Cons of carbon-now-cli

  • Limited customization options compared to the web-based Carbon
  • Lacks real-time preview of the generated image
  • May require additional setup and dependencies for some users

Code Comparison

Carbon (web-based):

// No specific code required, as it's a web application

carbon-now-cli:

# Basic usage
carbon-now file.js

# With custom theme and language
carbon-now file.py -t material -l python

Both projects aim to create beautiful code snippets, but they cater to different use cases. Carbon provides a user-friendly web interface with extensive customization options, while carbon-now-cli offers a streamlined command-line experience for developers who prefer working in the terminal. The choice between the two depends on individual preferences and workflow requirements.

The world's most popular non-default computer lockscreen.

Pros of i3lock-color

  • Focused on system security and screen locking
  • Highly customizable appearance with color options
  • Lightweight and efficient for system resources

Cons of i3lock-color

  • Limited to screen locking functionality
  • Requires more technical knowledge to configure
  • Less visually appealing for general users

Code Comparison

i3lock-color (C):

static void draw_image(void) {
    if (!vistype)
        return;
    switch (vistype) {
        case 1:
            draw_image_centered();
            break;
        case 2:
            draw_image_fill();
            break;
    }
}

Carbon (JavaScript):

export function getTheme(theme: ThemeConfig, updates: ThemeConfig = {}) {
  const newTheme = merge(theme, updates)
  if (newTheme.windowTheme === 'none') {
    newTheme.windowControls = false
  }
  return newTheme
}

Summary

i3lock-color is a specialized tool for screen locking with extensive customization options, while Carbon is a web-based tool for creating and sharing code snippets. i3lock-color is more focused on system security and efficiency, whereas Carbon emphasizes visual appeal and ease of use for sharing code. The code comparison shows i3lock-color's C-based implementation for drawing images, contrasting with Carbon's JavaScript functions for theme management.

📄 CLI that generates beautiful README.md files

Pros of readme-md-generator

  • Focused on generating README files, making it more specialized for this specific task
  • Interactive CLI tool, guiding users through the README creation process
  • Supports multiple languages and can generate badges automatically

Cons of readme-md-generator

  • Limited to README generation, while Carbon offers broader code snippet sharing capabilities
  • Less visually appealing output compared to Carbon's stylized code images
  • Lacks the ability to customize colors and themes for the generated content

Code Comparison

readme-md-generator:

const questions = [
  {
    type: 'input',
    name: 'projectName',
    message: 'Project name:',
  },
  // More questions...
];

Carbon:

const themes = {
  '3024 Night': '3024-night',
  'A11y Dark': 'a11y-dark',
  'Blackboard': 'blackboard',
  // More themes...
};

While readme-md-generator focuses on gathering project information through a series of questions, Carbon's code emphasizes theme selection for code snippet styling. This reflects their different purposes: readme-md-generator for README creation and Carbon for code snippet visualization.

📸 Polaroid for your code

Pros of Polacode

  • Integrated directly into VS Code as an extension
  • Captures code snippets from the active editor, maintaining syntax highlighting
  • Simpler to use for quick code sharing within the VS Code environment

Cons of Polacode

  • Limited customization options compared to Carbon
  • Only works within VS Code, lacking web-based functionality
  • Less flexibility in terms of export formats and social media integration

Code Comparison

Carbon:

import { createComponent } from 'carbon-components-react'

const MyComponent = createComponent({
  name: 'MyComponent',
  render: () => <div>Hello, Carbon!</div>
})

Polacode:

// No specific code required for Polacode
// It captures code directly from the VS Code editor

Summary

Carbon is a web-based tool offering extensive customization and sharing options for code snippets, while Polacode is a VS Code extension focused on quick and easy code captures within the editor. Carbon provides more flexibility and features for creating visually appealing code images, whereas Polacode excels in simplicity and integration with the VS Code workflow. The choice between the two depends on the user's specific needs and preferred development environment.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

maintained with Ranger All Contributors MIT License FOSSA Status



Translations
Español हिंदी Deutsch 简体中文 Português
മലയാളം Türkçe 한국어 தமிழ் Français
日本語 Svenska Polski Nederlands 正體中文
Indonesia Українська Italiano עברית Русский
العربية বাংলা Add +

Introduction

You know all of those code screenshots you see on Twitter? Though the code's usually impressive, we saw room for improvement in the aesthetic department. Carbon makes it easy to create and share beautiful images of your source code. So what are you waiting for? Go impress all of your followers with your newfound design prowess.

Carbon example

Features

  • Customization. Customize things like your image's syntax theme, font style, and more
  • Share quickly. Save your image or a link with one click
  • Save snippets. Create an account to save snippets for later. Shared snippets are automatically unfurled on Twitter and Slack.

Usage

Import

There are a few different ways to import code into Carbon:

Customization

Once you've got all of your code into Carbon, you can customize your image by changing the syntax theme, background color, window theme, padding, shadows, fonts, and more.

Exporting & Sharing

After you've customized your image you can share your snippet in a number of ways

Create a saved snippet

Sharing a saved snippet will automatically unfurl the image on platforms like Twitter and Slack. This lets users see your creation, while also giving them access to the source code via the link. Better yet, if you need to make an update, simply follow the link yourself to edit the snippet directly.

To create a saved snippet:

  1. Login using the "Sign in/Sign up" button
  2. Edit as you normally would — your snippet will get saved automatically
  3. Copy the URL from your browser window and share away!
Embed a snippet

This is the recommended method for sharing Carbon on your own website or blog. Readers can even copy the code with the click of a button.

You can embed any Carbon snippet in your website directly using the carbon.now.sh/embed URL. The "Copy Menu" lets you quickly copy the correct iFrame snippet, or the encoded URL for embedding on platforms like Medium.

Finally, you can also embed saved snippets or GitHub gists using carbon.now.sh/embed/:id.

Use the Tweet button

The Tweet button will not only share the image on Twitter, but it will also correctly encode the alt text to ensure your images are accessible. However, if you want to tweet image yourself, please check out how to make your Twitter images accessible.

Download the image directly

Carbon supports downloading your image as a PNG and SVG. You can also click Export → Open to open your image directly in the browser. Finally, you can copy the Carbon image directly to your clipboard by going to Copy → Image.

Installing Carbon for Desktop (Offline)

If you are using Google Chrome, or another browser that supports Progressive Web Apps, you can install Carbon for use offline by:

  1. Visit carbon.now.sh
  2. Click your browser's settings menu
  3. Click "Install Carbon..."

Community

Check out these projects our awesome community has created:

Editor Plugins
Tools
  • CLI carbon-now-cli - Open a file in Carbon or download it directly using carbon-now, featuring an interactive mode, selective highlighting and more
  • CodeExpander - A smart GitHub gist client with the TextExpander features
  • nef - Export multiple Carbon code snippets from Xcode Playground.
  • @carbonshbot - A Telegram chatbot which takes in a code snippet or gist URL and generates an Carbon image
  • R carbonate - Iteratively manipulate image aesthetics in R and either open in Carbon or download directly.
  • Carbon for Slack - Use Carbon directly in Slack. Just invoke the /carbon command.
Citations

Authors

Carbon is a project by:

License

FOSSA Status




Contribute & Support

Pull requests are welcome! Please see our contributing guidelines for more details.

Sponsors & Backers

Fossa

Powered by Vercel

Thanks To

▲ Vercel for sponsoring Carbon's hosting.

All Contributors

Thanks goes out to all these wonderful people (emoji key):


briandennis

💻 📖 🚇 👀

mfix22

💬 💻 🤔

jakedex

💬 💻 🎨 📹

andrewda

💬 💻 🐛 👀

yeskunall

💻 📖 🔧 🐛

stoshfabricius

💻

jkling38

📖

otobrglez

💻

darahak

📖

dom96

💻

elrumordelaluz

💻

cjb

💻

Krzysztof-Cieslak

💻

fernahh

📖

g3r4n

💻

Mat Gadd

🐛 💻

Brad Davies

🐛 💻

Rafael Câmara

💻

Gleb Bahmutov

⚠️ 🔧

Iván Munguía

💻

Dillon Mulroy

💻

Nihad Abbasov

💻

Bruno C. Couto

💻

Mark Molnar

💻

Takahiko Inayama

💻

François Martin

💻

Raphael Amorim

💻

Camron Flanders

💻

Eric Adamski

💻

Winner Crespo

💻 🎨

Milos

💻 🔧 📖 🌍

Yashu Mittal

💻

Rachel M. Carmena

📖

Miguel Salazar

📖 🌍

Vyom Jain

📖 🌍

racaljk

🌍

Sean

💻

Izabela Borges

🌍

Shinil M S

🌍

Berke Atac

🌍

LEE YONGJUN

🌍

Matthew Nielsen

💻

Boy

📦

Vetrivel Chinnasamy

🌍

Farzad YZ

💻 🤔

Yannick Loriot

🌍

Joel Hanson

💻

Muhammad Muzzammil

💻

souppower

🚇

Masato Urai (@uraway_)

🌍

Fernando

🌍

Megha Sachdev

💻 ⚠️

Anudeep Reddy

🚇

Munieru

🌍

Adam Lusted

💻

Jose Noriega

🌍

Merlin Fuchs

🌍

Ramy Majouji

💻

Viktor Nemes

💻

Eric Bailey

💻

Nazeefa

🌍

Pratik Butani

📝

Bakti Aditya

💻

Caleb Taylor

💻

Rogério Munhoz

💻

Technoknol

💻

Tymoteusz Makowski

💻

Nisar Hassan Naqvi

🐛

Ilyas Karim

🐛

Nick Fix

🤔

Melanie Sumner

🤔

aluc

💻

B. Mearns

🤔

Peng Jie

💻

Binyamin Aron Green

💻

Michal

🌍

Quinn Blenkinsop

💻

Dwiferdio Seagal Putra

💻

Ashley Woodall Clark

💻

Tim Wienk

🌍

George McCarron

📖

Erwin Rahayu

🌍 📖

Luca

💻

Andrew Hayes

💻

Bereket Semagn

💻

Lorenzo Lancia

🌍

Guy Adler

🌍

Dan Bamikiya

🤔

kewang

🌍

Rizda Dwi Prasetya

🖋

AbreuY

🌍

>_Rizky.dev

🌍 📖

Abidemi Harry

💻

Marco

🌍

Sam Robbins

📖

alceil

💻

hatsu

💻

Praveen Kumar Purushothaman

🌍

Amir Elsagan

🌍

korzck

🌍

Sakibul Alam

🌍

NPM DownloadsLast 30 Days