Skip to content

About

Worked examples for rnxjs, the reactive TypeScript UI framework.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Latest commit

Β 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

rnxJS Samples

Welcome to the rnxJS Samples repository! This collection showcases the power and flexibility of rnxJS - The Bootstrap-Native Framework for Production Apps.

πŸš€ What is rnxJS?

rnxJS is a lightweight (~10KB gzipped), zero-build framework that brings reactive programming to Bootstrap applications. Perfect for backend developers (Django, Rails, Laravel, Express) and internal tools.

Key Features

  • βœ… Zero Build Required - No Webpack, no bundlers, just HTML and JS
  • βœ… 46+ Components - Production-ready Bootstrap & Material Design components
  • βœ… Reactive State - Proxy-based reactivity with automatic UI updates
  • βœ… Two-Way Binding - Built-in data-bind for forms and elements
  • βœ… Form Validation - Built-in validation rules
  • βœ… Backend Integration - Official packages for Django, Express, Rails, Laravel

πŸ“‚ Repository Structure

rnxJS_samples/
β”œβ”€β”€ index.html           # Landing page with all demos
β”œβ”€β”€ dashboard.html       # Admin dashboard demo
β”œβ”€β”€ shop.html           # E-commerce product catalog
β”œβ”€β”€ forms.html          # Form validation demo
β”œβ”€β”€ datatable.html      # Data table with sorting/filtering
β”œβ”€β”€ tasks.html          # Task manager (todo app)
β”œβ”€β”€ chat.html           # Chat interface
β”œβ”€β”€ settings.html       # Settings panel
β”œβ”€β”€ styles.css          # Shared custom styles
β”œβ”€β”€ django-demo/        # Django integration demo
β”‚   └── README.md
β”œβ”€β”€ express-demo/       # Express.js integration demo
β”‚   └── README.md
└── README.md           # This file

🎯 Standalone HTML Demos

All standalone demos are copy-paste ready and require no build step. They load a pinned rnxJS build (2.3.1) from jsDelivr, so open them in a browser with an internet connection.

1. Landing Page (index.html)

  • Overview of all demos
  • Quick start guide
  • Resource links

2. Admin Dashboard (dashboard.html)

  • Real-time stat cards
  • User management table
  • Activity feed
  • Search and filtering

Components Used: StatCard, DataTable, Input, Button, Card

3. E-Commerce Shop (shop.html)

  • Product catalog with images
  • Category and price filtering
  • Shopping cart with sidebar
  • Reactive cart totals

Components Used: Card, Badge, Modal, Search, Select, Button

4. Form Validation (forms.html)

  • Multi-step form
  • Built-in validation rules
  • File upload
  • Real-time error messages

Components Used: Input, Textarea, Select, Checkbox, Radio, Switch, FileUpload

5. Data Table (datatable.html)

  • Sortable columns
  • Search and filtering
  • Pagination
  • Row actions (edit/delete)

Components Used: DataTable, Search, Pagination, Dropdown

6. Task Manager (tasks.html)

  • Add/edit/delete tasks
  • Status tracking (todo, in progress, done)
  • Filtering by status
  • Due date management

Components Used: List, Checkbox, FAB, Chips, DatePicker, Tabs

7. Chat Interface (chat.html)

  • Real-time message list
  • Send/receive messages
  • Toast notifications
  • Auto-scroll to latest message

Components Used: List, Input, Toast, Button

8. Settings Panel (settings.html)

  • Theme switching (light/dark)
  • Tabbed interface
  • Slider controls
  • Accordion sections

Components Used: Tabs, Switch, Slider, Select, Accordion, Sidebar

πŸ”§ Backend Integration Demos

Django Integration (django-demo/)

Complete Django project demonstrating @arnelirobles/django-rnx integration.

Features:

  • Django template tags ({% rnx_scripts %}, {% rnx_state %}, {% rnx_component %})
  • Form integration with Django forms
  • Reactive state from Django context
  • Plugin usage (router, toast, storage)

Setup:

cd django-demo
pip install -r requirements.txt
python manage.py runserver

See django-demo/README.md for detailed instructions.

Express Integration (express-demo/)

Complete Express.js project demonstrating @arnelirobles/express-rnx integration.

Features:

  • EJS view helpers (rnx.scripts(), rnx.state(), rnx.component())
  • Reactive state from server data
  • Component rendering in templates
  • Middleware configuration

Setup:

cd express-demo
npm install
npm start

See express-demo/README.md for detailed instructions.

πŸƒ Running the Demos

Option 1: Open Directly in Browser

Open any .html file in your browser. No server and no build step. The page loads rnxJS 2.3.1 from jsDelivr, so you need to be online.

# macOS
open index.html

# Linux
xdg-open index.html

# Windows
start index.html

Option 2: Use a Local Server

For a better development experience:

# Using Python
python -m http.server 8000

# Using Node.js (http-server)
npx http-server

# Using PHP
php -S localhost:8000

Then visit http://localhost:8000

πŸ“š Learning Resources

🎨 Customization

All demos use a shared styles.css file with modern styling including:

  • Glassmorphism effects
  • Gradient backgrounds
  • Smooth animations
  • Responsive design
  • Custom scrollbars

Feel free to modify styles.css to match your brand!

πŸš€ Quick Start with rnxJS

CDN (No Build)

<!DOCTYPE html>
<html>
<head>
    <!-- Bootstrap CSS -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
    
    <!-- Bootstrap Icons -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
</head>
<body>
    <Container>
        <h1 data-bind="message"></h1>
        <Input data-bind="message" placeholder="Type something..." />
        <Button label="Click Me" variant="primary" onclick="alert(state.message)" />
    </Container>

    <!-- rnxJS Library -->
    <script src="https://cdn.jsdelivr.net/npm/@arnelirobles/rnxjs@2.3.1/dist/rnx.global.js"></script>
    
    <script>
        const { createReactiveState, autoRegisterComponents, loadComponents } = rnx;
        
        const state = createReactiveState({
            message: 'Hello, rnxJS!'
        });
        
        autoRegisterComponents();
        loadComponents(document.body, state);
    </script>
</body>
</html>

NPM (With Bundler)

npm install @arnelirobles/rnxjs
import { createReactiveState, autoRegisterComponents, loadComponents } from '@arnelirobles/rnxjs';
import '@arnelirobles/rnxjs/css/bootstrap-m3-theme.css'; // Optional M3 theme

const state = createReactiveState({ count: 0 });
autoRegisterComponents();
loadComponents(document.body, state);

CLI Scaffolding

npx @arnelirobles/create-rnxjs-app@latest

🀝 Contributing

Found a bug or have a suggestion? Please open an issue on the main rnxJS repository.

πŸ“„ License

These samples are provided under the MIT License - feel free to use them in your projects!

The rnxJS library itself is licensed under MPL-2.0.

πŸ’‘ Tips

  1. Start Simple: Begin with index.html to understand the basics
  2. Explore Components: Check dashboard.html for component variety
  3. Learn Reactivity: shop.html demonstrates reactive cart management
  4. Backend Integration: Try django-demo/ or express-demo/ for full-stack apps
  5. Customize: Modify styles.css to match your design system

🌟 Why rnxJS?

Feature rnxJS jQuery Vue 3 React 18
Bundle Size ~10KB ~30KB ~16KB ~42KB
Zero Build βœ… Yes βœ… Yes ⚠️ Recommended ❌ Required
Components 46 0 0 0
Two-Way Binding βœ… Built-in ❌ Manual βœ… v-model ❌ Manual
Form Validation βœ… Built-in ❌ Plugin ❌ Library ❌ Library
Learning Curve 1 hour 1 hour 1 day 1 week

πŸ“ž Support


Built with ❀️ by BaryoDev

Enjoy exploring rnxJS! πŸš€

About

Worked examples for rnxjs, the reactive TypeScript UI framework.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages