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

this.gui

v1.0.18

Published

This Graphic User Interface.

Downloads

54

Readme

THIS.GUI

this.GUI aims to automate the GUI generation process by allowing users to pass data or configurations. It then dynamically builds the UI based on these inputs. This package exports pre-defined components, theme providers, MDX integration, and a Site/App builder for rapid prototyping and deployment.

Installation & Setup

Install this.gui via npm:

npm install this.gui

After installation, you can start the development server using:

npm start

This command will initialize the app, allowing you to use the Site Builder and Component Library.

Key Features

1. Pre-built Components

​ • Atoms: Smallest building blocks like buttons, inputs, text elements, etc.

​ • Molecules: Combinations of atoms to form reusable UI elements like cards, forms, tables, etc.

​ • Organisms: More complex components that combine multiple molecules.

​ • Layouts & Templates: Predefined page structures that can be customized using the JSON configuration.

2. MDX & Theme Providers

​ • MDX integration for dynamic content rendering.

​ • Easy-to-use theme providers for switching between light and dark modes.

3. Site & App Builder

​ • Drag-and-drop interface for building entire pages or applications.

​ • Generates JSON configuration that maps to your UI structure.

​ • The JSON-based UI renderer automatically handles rendering of components based on the passed configuration.

Getting Started

Here’s a quick overview of how to use this.GUI in your project.

1. Direct JSX Usage

The index.js file allows you to import and use pre-built components directly in your JSX/JS files.

import { Button, TextInput } from 'this.gui/Atoms';

function MyComponent() {
 return (
    <div>
   <Button label="Click Me" color="primary" />
   <TextInput placeholder="Enter text" />
  </div>
 );
}

2. Dynamic UI via JSON

Use the ComponentRegistry and renderComponent function to build dynamic UIs from JSON configurations.

Example JSON:

{
 "layout": [
  {
   "type": "Button",
   "props": { "label": "Click Me", "color": "primary" }
  },
  {
   "type": "Heading",
   "props": { "text": "Welcome to Our Site", "level": 1 }
  }
 ]
}

Rendering the above JSON with this.GUI:

import React from 'react';
import { Page } from 'this.gui/Page';

const config = {
 layout: [
  { type: 'Button', props: { label: 'Click Me', color: 'primary' } },
  { type: 'Heading', props: { text: 'Welcome to Our Site', level: 1 } }
 ]
};

function App() {
 return <Page config={config} />;
}

3. Component Registry & JSON Mapping

ComponentRegistry maps JSON keys to the corresponding React components. This allows dynamic rendering of components via JSON without directly importing each component.

const ComponentRegistry = {
 Button: Atoms.Button,
 Heading: Atoms.Heading,
 Paragraph: Atoms.Paragraph,
 *// More mappings...*
};

Component Categories

​ • Atoms: Small, reusable components like Buttons, Inputs, Paragraphs.

​ • Examples: Button, TextInput, Paragraph, Image, Icon, etc.

​ • Molecules: Components that combine multiple atoms.

​ • Examples: Card, Navbar, Breadcrumbs, FormField, AudioPlayer, etc.

​ • Organisms: More complex components combining multiple molecules.

​ • Examples: LoginForm, SidebarLayout, etc.

​ • Layouts & Templates: Complete page structures.

​ • Examples: TwoColumnLayout, LandingPageTemplate, etc.

Key Components

  1. Component Registry

• Maps JSON keys to components for dynamic rendering.

  1. JSON Configuration Files

• Define the layout and structure of your UI in JSON.

  1. Rendering Engine

• Reads the JSON configuration and renders the appropriate components dynamically.

Example Usage

Here’s an example that showcases how to use the JSON configuration for rendering a dynamic UI.

{
 "layout": [
  {
   "type": "Card",
   "props": { "variant": "solid", "color": "primary-color", "width": "300px" },
   "children": [
    {
     "type": "Paragraph",
     "props": { "text": "Welcome to our site!" }
    }
   ]
  }
 ]
}

You can pass this JSON configuration to the Page component to render the UI dynamically:

import { Page } from 'this.gui/Page';
import config from './config.json'; *// Import the JSON configuration*

function App() {
 return <Page config={config} />;
}

Additional Resources

​ • Storybook: For browsing and testing all pre-built components. Launch Storybook with:

npm run storybook

​ •MDX Editor: Edit and visualize MDX content in real time.

this.GUI is part of the Neurons.me ecosystem, a set of modular data structures designed to work together across multiple domains.

About All.This

Modular Data Structures

this.me - this.audio - this.text - this.wallet - this.img - this.pixel - be.this - this.DOM - this.env - this.GUI - this.be - this.video - this.atom - this.dictionaries

These classes encapsulate the functionalities to domain-specific data.

Neurons.me

License & Policies

  • License: MIT License (see LICENSE for details).

  • Privacy Policy: Respects user privacy; no collection/storage of personal data.

  • Terms of Usage: Use responsibly. No guarantees/warranties provided. Terms | Privacy neurons.me