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 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-ide-component

v0.0.1

Published

IDE Component with animation for react js

Downloads

1

Readme

React IDE Component

React IDE Component is lighweight IDE component for react that has been included with typewritting effect for animation.

npm type definitions

Alt demo

Dependecies

This components use:

  • GSAP for animation that have impressive performance
  • highlight.js for rich syntax highlighter and detect the language
  • html-react-parser for parsing HTML into React elements

Installation

If you're using npm, in the command prompt run:

npm install react-ide-component --save

If you're using yarn, run:

yarn add react-ide-component

Usage

Import the module

import IdeComponent from 'react-ide-component'

Prepare datas to send it as props, this example use React Icons as icon. you can use your own svg / image icon here

const ideData = [
  {
    id: 'tab1',
    icon: <ReactSvg size='100%' />
    filename: 'index.tsx',
    content: 'console.log("test")',
    lang: 'typescript'
  },
]

Datas Type

type for datas object | Property | Type | Required | Default | Description | | :-------------- | :-------------------------- | :---------------- | :---------------- | :------------------------------------------------------- | | id | string | true | null | tab's ids that you can use for your own needs | | icon | JSX.Element | true | null | you can use your own svg, png as icon logo that representation tile extention / code language | | filename | string | true | null | filename and extention file that will shown as tab's label example: 'index.js' | | content | string | true | null | it will be use as code text, enter/break line inside string didnt not work here. if you want to break line code content use <br> instead. | | lang | string | true | null | language name. example javascript, php, java, python, etc you can serach list language available from highlight.js languages list |

Then insert component and datas like this

<IdeComponent datas={ideData} />

Might be your full code look like this

import React from "react";
import IdeComponent from 'react-ide-component'
import { ReactSvg, JsSvg } from '../svg/ReactSvg'

const ideData = [
  {
    id: 'tab1',
    icon: <ReactSvg size='100%' />
    filename: 'index.tsx',
    content: 'console.log("test")',
    lang: 'typescript'
  },
  {
    id: 'tab2',
    icon: <JsSvg size='100%' />
    filename: 'index.jsx',
    content: 'console.log("test")',
    lang: 'javascript'
  },
]


function App() {
  return (
    <div>
      <IdeComponent datas={ideData} />
    </div>
  )
}

Props

| Property | Type | Required | Default | Description | | :------- | :-------------- | :------- | :------ | :------------------------------------------------------------------------------ | | datas | TabDataType[] | true | null | Array of object that representating tab ide, icon, filename, code, and language | | mode | dark or light | false | dark | Mode for IDE color between dark and light, default is `dark |