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 🙏

© 2026 – Pkg Stats / Ryan Hefner

clyra

v0.1.2

Published

A comprehensive JavaScript framework CLI for building web and native applications

Readme

Clyra Framework

Clyra is a comprehensive JavaScript framework that combines the best features from React, Next.js, Vue.js, and Angular with built-in support for Tailwind CSS, shadcn/ui components, and React Native compatibility. Build powerful web and mobile applications with a unified, elegant API.

Clyra Framework

🌟 Features

Core Framework

  • Virtual DOM with efficient diffing algorithm
  • JSX/TSX Support for declarative UI development
  • Component System with both class and functional components
  • Hooks API for stateful functional components
  • Reactive State Management inspired by Vue.js
  • Context API for prop drilling prevention

Routing and Navigation

  • File-based Routing (Next.js-inspired)
  • Dynamic Routes with parameters
  • Nested Layouts for consistent UI structure
  • Client-side Navigation with history management

Data Management

  • Server-side Data Fetching with getInitialProps
  • Client-side Data Fetching with caching
  • Built-in State Management with Redux-like store
  • Reactive Data with Vue-inspired reactivity

Styling Solutions

  • Built-in Tailwind CSS integration
  • shadcn/ui Components ready to use
  • Theme System for consistent design
  • CSS-in-JS support
  • CSS Modules for scoped styling

Server Features

  • Server-side Rendering (SSR) for improved SEO
  • Static Site Generation (SSG) for fast loading times
  • API Routes for backend functionality
  • Incremental Static Regeneration

Cross-Platform

  • React Native Integration for mobile apps
  • Web and Native from a single codebase
  • Consistent API across platforms
  • Tailwind for Native with the same classes

Developer Experience

  • Hot Module Replacement
  • TypeScript Support
  • CLI Tools for project scaffolding
  • Development Server with fast refresh

🚀 Quick Start

Create a new Clyra project

# Install the CLI globally
npm install -g clyra-cli

# Create a new project
clyra create my-app

# Navigate to the project directory
cd my-app

# Install dependencies
npm install

# Start the development server
npm run dev

Project Structure

my-app/
├── src/
│   ├── app/
│   │   ├── components/  # Reusable components
│   │   ├── layouts/     # Page layouts
│   │   └── pages/       # Page components
│   ├── native/          # Native application
│   │   ├── components/  # Native components
│   │   └── screens/     # Native screens
│   └── styles/          # Global styles
├── public/              # Static assets
├── clyra.config.js  # Framework configuration
├── tailwind.config.js   # Tailwind CSS configuration
└── package.json         # Project dependencies

📚 Examples

Creating a Component

import Clyra from 'clyra';

// Class Component
class Counter extends Clyra.Component {
  constructor(props) {
    super(props);
    this.state = { count: 0 };
  }
  
  increment = () => {
    this.setState({ count: this.state.count + 1 });
  }
  
  render() {
    return (
      <div className="p-4 bg-white rounded shadow">
        <h2 className="text-xl font-bold mb-2">Counter: {this.state.count}</h2>
        <button 
          className="px-4 py-2 bg-primary text-white rounded"
          onClick={this.increment}
        >
          Increment
        </button>
      </div>
    );
  }
}

// Functional Component with Hooks
function CounterWithHooks() {
  const [count, setCount] = Clyra.useState(0);
  
  Clyra.useEffect(() => {
    document.title = `Count: ${count}`;
  }, [count]);
  
  return (
    <div className="p-4 bg-white rounded shadow">
      <h2 className="text-xl font-bold mb-2">Counter: {count}</h2>
      <button 
        className="px-4 py-2 bg-primary text-white rounded"
        onClick={() => setCount(count + 1)}
      >
        Increment
      </button>
    </div>
  );
}

Using the Router

import Clyra from 'clyra';
import RouterComponents from 'clyra-router';

const { Link } = RouterComponents;

function Navigation() {
  return (
    <nav className="p-4 bg-primary text-white">
      <ul className="flex space-x-4">
        <li><Link href="/" className="hover:underline">Home</Link></li>
        <li><Link href="/about" className="hover:underline">About</Link></li>
        <li><Link href="/users/123" className="hover:underline">User Profile</Link></li>
      </ul>
    </nav>
  );
}

// Dynamic route page (in src/app/pages/users/[id].jsx)
function UserProfile({ params }) {
  return (
    <div className="p-4">
      <h1 className="text-2xl font-bold mb-4">User Profile</h1>
      <p>User ID: {params.id}</p>
    </div>
  );
}

// Server-side data fetching
UserProfile.getInitialProps = async ({ params }) => {
  // Fetch user data from API
  const response = await fetch(`https://api.example.com/users/${params.id}`);
  const userData = await response.json();
  
  return { userData };
};

Using shadcn/ui Components

import Clyra from 'clyra';
import { ui } from 'clyra-styling';

function LoginForm() {
  const [email, setEmail] = Clyra.useState('');
  const [password, setPassword] = Clyra.useState('');
  
  const handleSubmit = (e) => {
    e.preventDefault();
    // Handle login logic
  };
  
  return (
    <ui.Card className="w-full max-w-md mx-auto">
      <ui.CardHeader>
        <ui.CardTitle>Login</ui.CardTitle>
        <ui.CardDescription>
          Enter your credentials to access your account
        </ui.CardDescription>
      </ui.CardHeader>
      
      <ui.CardContent>
        <form onSubmit={handleSubmit} className="space-y-4">
          <div className="space-y-2">
            <label htmlFor="email" className="text-sm font-medium">
              Email
            </label>
            <ui.Input
              id="email"
              type="email"
              value={email}
              onChange={(e) => setEmail(e.target.value)}
              placeholder="[email protected]"
              required
            />
          </div>
          
          <div className="space-y-2">
            <label htmlFor="password" className="text-sm font-medium">
              Password
            </label>
            <ui.Input
              id="password"
              type="password"
              value={password}
              onChange={(e) => setPassword(e.target.value)}
              required
            />
          </div>
        </form>
      </ui.CardContent>
      
      <ui.CardFooter>
        <ui.Button type="submit" className="w-full">
          Sign In
        </ui.Button>
      </ui.CardFooter>
    </ui.Card>
  );
}

Creating React Native Screens

import Clyra from 'clyra';
import { reactorNative } from 'clyra-styling';

const { View, Text, TouchableOpacity, ScrollView } = reactorNative;

function HomeScreen() {
  const [count, setCount] = Clyra.useState(0);
  
  return (
    <ScrollView className="flex-1 bg-white p-4">
      <Text className="text-2xl font-bold mb-6">Clyra Native</Text>
      
      <View className="bg-gray-100 rounded-lg p-6 mb-6">
        <Text className="text-lg mb-4">Count: {count}</Text>
        
        <View className="flex-row space-x-4">
          <TouchableOpacity 
            className="bg-primary px-4 py-2 rounded"
            onPress={() => setCount(count + 1)}
          >
            <Text className="text-white font-medium">Increment</Text>
          </TouchableOpacity>
          
          <TouchableOpacity 
            className="bg-gray-500 px-4 py-2 rounded"
            onPress={() => setCount(0)}
          >
            <Text className="text-white font-medium">Reset</Text>
          </TouchableOpacity>
        </View>
      </View>
      
      <Text className="text-xl font-semibold mb-4">Features</Text>
      <View className="space-y-2 mb-6">
        <View className="flex-row items-center">
          <View className="w-2 h-2 rounded-full bg-primary mr-2" />
          <Text>Unified API for web and native</Text>
        </View>
        <View className="flex-row items-center">
          <View className="w-2 h-2 rounded-full bg-primary mr-2" />
          <Text>Tailwind CSS support</Text>
        </View>
        <View className="flex-row items-center">
          <View className="w-2 h-2 rounded-full bg-primary mr-2" />
          <Text>Native performance</Text>
        </View>
        <View className="flex-row items-center">
          <View className="w-2 h-2 rounded-full bg-primary mr-2" />
          <Text>Reusable business logic</Text>
        </View>
        <View className="flex-row items-center">
          <View className="w-2 h-2 rounded-full bg-primary mr-2" />
          <Text>Cross-platform components</Text>
        </View>
      </View>
    </ScrollView>
  );
}

📦 Package Structure

Clyra is composed of several packages that work together:

  • clyra: Core framework with Virtual DOM, Component system, and Hooks
  • clyra-router: File-based routing and navigation system
  • clyra-styling: Styling solution with Tailwind CSS and shadcn/ui integration
  • clyra-native: React Native integration and bridge
  • clyra-cli: Command-line interface for project scaffolding
  • clyra-ui: UI component library based on shadcn/ui

🔧 Configuration

Clyra uses a configuration file (clyra.config.js) to customize various aspects of your application:

// clyra.config.js
module.exports = {
  // General settings
  appName: 'My Clyra App',
  
  // Platforms to build for
  platforms: ['web', 'native'],
  
  // Web configuration
  web: {
    devPort: 3000,
    buildDir: 'dist',
    publicDir: 'public',
    ssr: true,
    ssg: {
      enabled: true,
      paths: ['/about', '/contact']
    }
  },
  
  // Native configuration
  native: {
    appId: 'com.example.myapp',
    platforms: ['ios', 'android'],
  },
  
  // Styling options
  styling: {
    tailwind: true,
    shadcn: true,
    theme: {
      colors: {
        primary: '#3b82f6',
        secondary: '#6b7280',
      }
    }
  }
};

🔄 State Management

Clyra offers multiple ways to manage state:

1. Component State

// Class component
class Counter extends Clyra.Component {
  constructor(props) {
    super(props);
    this.state = { count: 0 };
  }
  
  increment = () => {
    this.setState({ count: this.state.count + 1 });
  }
  
  render() {
    return (
      <div>
        <p>Count: {this.state.count}</p>
        <button onClick={this.increment}>Increment</button>
      </div>
    );
  }
}

// Functional component with hooks
function HookCounter() {
  const [count, setCount] = Clyra.useState(0);
  
  return (
    <div>
      <p>Count: {count}</p>
      <button onClick={() => setCount(count + 1)}>Increment</button>
    </div>
  );
}

2. Context API

// Create a context
const ThemeContext = Clyra.createContext({ theme: 'light' });

// Provider component
function ThemeProvider({ children }) {
  const [theme, setTheme] = Clyra.useState('light');
  
  const toggleTheme = () => {
    setTheme(theme === 'light' ? 'dark' : 'light');
  };
  
  return (
    <ThemeContext.Provider value={{ theme, toggleTheme }}>
      {children}
    </ThemeContext.Provider>
  );
}

// Consumer component
function ThemedButton() {
  const { theme, toggleTheme } = Clyra.useContext(ThemeContext);
  
  return (
    <button 
      className={`px-4 py-2 rounded ${theme === 'light' ? 'bg-primary text-white' : 'bg-gray-800 text-white'}`}
      onClick={toggleTheme}
    >
      Toggle Theme (Current: {theme})
    </button>
  );
}

3. Global Store

// Create a store
const store = Clyra.createStore({
  state: {
    count: 0,
    user: null
  },
  
  reducers: {
    INCREMENT: (state) => ({ ...state, count: state.count + 1 }),
    DECREMENT: (state) => ({ ...state, count: state.count - 1 }),
    SET_USER: (state, user) => ({ ...state, user })
  }
});

// Connect component to store
function ConnectedCounter() {
  const { state, dispatch } = store.useStore();
  
  return (
    <div>
      <p>Count: {state.count}</p>
      <button onClick={() => dispatch({ type: 'INCREMENT' })}>Increment</button>
      <button onClick={() => dispatch({ type: 'DECREMENT' })}>Decrement</button>
    </div>
  );
}

4. Reactive State (Vue-inspired)

// Create reactive state
const state = Clyra.reactive({
  count: 0,
  user: null
});

// Component using reactive state
function ReactiveCounter() {
  // This component will automatically re-render when state.count changes
  Clyra.watchEffect(() => {
    console.log('Count changed:', state.count);
  });
  
  return (
    <div>
      <p>Count: {state.count}</p>
      <button onClick={() => state.count++}>Increment</button>
      <button onClick={() => state.count--}>Decrement</button>
    </div>
  );
}

📝 Server-Side Rendering

Clyra supports server-side rendering for improved performance and SEO:

// Server entry point (server.js)
import { createServerApp } from 'clyra-router';
import express from 'express';

// Import pages and layouts
import HomePage from './src/app/pages/home';
import AboutPage from './src/app/pages/about';
import MainLayout from './src/app/layouts/main';

const app = express();

// Define routes
const pages = {
  '/': HomePage,
  '/about': AboutPage
};

// Define layouts
const layouts = {
  '/': MainLayout
};

// Create server app
const reactorApp = createServerApp({
  pages,
  layouts,
  title: 'My Clyra App',
  styles: tailwindStyles // Pre-generated Tailwind CSS
});

// Handle all routes
app.get('*', async (req, res) => {
  try {
    const { html, statusCode } = await reactorApp.renderPath(req.path);
    res.status(statusCode).send(html);
  } catch (error) {
    console.error('Rendering error:', error);
    res.status(500).send('Server Error');
  }
});

app.listen(3000, () => {
  console.log('Server running on http://localhost:3000');
});

🔌 Extending Clyra

Creating Custom Plugins

// my-plugin.js
module.exports = function myPlugin(options) {
  return {
    name: 'my-plugin',
    
    // Hook into the Clyra lifecycle
    beforeBuild() {
      console.log('Before build');
    },
    
    afterBuild() {
      console.log('After build');
    },
    
    // Extend the component API
    extendComponent(Component) {
      Component.prototype.myCustomMethod = function() {
        console.log('Custom method called');
      };
      
      return Component;
    }
  };
};

// In clyra.config.js
module.exports = {
  // ...other config
  plugins: [
    require('./my-plugin')({ /* options */ })
  ]
};

📱 React Native Integration

Clyra seamlessly integrates with React Native to build cross-platform applications:

// src/native/index.jsx
import Clyra from 'clyra';
import { AppRegistry } from 'clyra-native';
import { reactorNative, TailwindProvider } from 'clyra-styling';

import HomeScreen from './screens/home';
import SettingsScreen from './screens/settings';

const { View, Text } = reactorNative;

// Navigation state
const [currentScreen, setCurrentScreen] = Clyra.useState('home');

// Simple tab navigator
const App = () => {
  return (
    <TailwindProvider>
      <View className="flex-1">
        {/* Content area */}
        <View className="flex-1">
          {currentScreen === 'home' && <HomeScreen />}
          {currentScreen === 'settings' && <SettingsScreen />}
        </View>
        
        {/* Tab bar */}
        <View className="flex-row border-t border-gray-200">
          <View 
            className={`flex-1 py-4 items-center ${currentScreen === 'home' ? 'bg-primary' : 'bg-white'}`}
            onPress={() => setCurrentScreen('home')}
          >
            <Text className={currentScreen === 'home' ? 'text-white' : 'text-gray-700'}>
              Home
            </Text>
          </View>
          
          <View 
            className={`flex-1 py-4 items-center ${currentScreen === 'settings' ? 'bg-primary' : 'bg-white'}`}
            onPress={() => setCurrentScreen('settings')}
          >
            <Text className={currentScreen === 'settings' ? 'text-white' : 'text-gray-700'}>
              Settings
            </Text>
          </View>
        </View>
      </View>
    </TailwindProvider>
  );
};

// Register the app
AppRegistry.registerComponent('MyApp', () => App);

🛠️ CLI Commands

Clyra CLI provides various commands to streamline development:

# Create a new project
clyra create my-app

# Start development server
clyra dev

# Build for production
clyra build

# Build for specific platform
clyra build web
clyra build native

# Generate component
clyra generate component Button

# Generate page
clyra generate page About

# Generate layout
clyra generate layout Main

📊 Performance Optimization

Clyra includes several features for optimal performance:

  • Tree Shaking: Eliminates unused code
  • Code Splitting: Loads components on demand
  • Lazy Loading: Defers loading of non-critical components
  • Memoization: Prevents unnecessary re-renders
  • Server-side Rendering: Improves initial load time
  • Static Site Generation: Pre-renders pages for maximum performance

📚 Documentation

For comprehensive documentation, visit clyra.dev.

🤝 Contributing

Contributions are welcome! Please read our contributing guide to get started.

📄 License

Clyra is MIT licensed.