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

@dinkarjallan/rezilient-ui

v0.2.1

Published

A frontend library designed to enhance user experience in offline-first, resilient applications. This package provides tools and components to seamlessly bridge UI interactions with resilient application logic, ensuring a consistent and robust user experi

Downloads

184

Readme

@dinkarjallan/rezilient-ui

A frontend library designed to enhance user experience in offline-first, resilient applications. This package provides tools and components to seamlessly bridge UI interactions with resilient application logic, ensuring a consistent and robust user experience even under challenging network conditions.


What is rezilient-ui?

@dinkarjallan/rezilient-ui is part of the Rezilient.js ecosystem, focusing on UI-specific utilities for building offline-ready, network-resilient web applications. It complements @dinkarjallan/rezilient-utils by offering components, decorators, hooks, and HOCs tailored for UI interaction in scenarios where network conditions are unpredictable.


What to Expect from This Package

  • Decorators to transform UI components into service-worker managed components.
  • Higher-Order Components (HOCs) to enable fallback behavior for offline scenarios.
  • Hooks for managing UI state related to network conditions, offline/online mode, and sync processes.
  • Prebuilt components like network status indicators, retry buttons, and sync progress bars.
  • Enhanced error boundaries to gracefully handle offline-specific errors.
  • Tools to simplify creating UI elements that respond dynamically to network changes.

Installation

Install the package using npm or yarn:

npm install @dinkarjallan/rezilient-ui

or

yarn add @dinkarjallan/rezilient-ui

Features and Examples

1. Decorators for Components

Easily make your components service-worker managed and offline-ready.

import { offlineReady } from '@dinkarjallan/rezilient-ui';

@offlineReady
const DataDisplay = ({ data }) => <div>{data}</div>;

2. Higher-Order Components (HOCs)

Wrap your components to provide fallback behavior during offline mode.

import { withOfflineFallback } from '@dinkarjallan/rezilient-ui';

const OfflineDisplay = withOfflineFallback(MyComponent, <FallbackUI />);

3. Network Status Indicators

Use prebuilt components to display real-time network status.

import { NetworkStatusBadge } from '@dinkarjallan/rezilient-ui';

<NetworkStatusBadge />;

4. Retry Buttons and Prompts

Allow users to retry failed actions through intuitive UI elements.

import { RetryButton } from '@dinkarjallan/rezilient-ui';

<RetryButton onRetry={retrySync} />;

5. Offline Fallback Components

Create components that adapt to offline scenarios seamlessly.

import { OfflineAwareImage } from '@dinkarjallan/rezilient-ui';

<OfflineAwareImage src="/images/profile.jpg" />;

6. Hooks for UI State Management

Leverage hooks to monitor and react to network conditions.

import { useOfflineStatus } from '@dinkarjallan/rezilient-ui';

const isOffline = useOfflineStatus();
if (isOffline) {
  alert('You are offline!');
}

7. Background Sync Indicators

Provide visual feedback during background syncing operations.

import { SyncProgressBar } from '@dinkarjallan/rezilient-ui';

<SyncProgressBar />;

8. Enhanced Error Boundaries

Handle offline-related errors gracefully with enhanced error boundaries.

import { OfflineErrorBoundary } from '@dinkarjallan/rezilient-ui';

<OfflineErrorBoundary fallback={<OfflinePlaceholder />}>
  <MyComponent />
</OfflineErrorBoundary>;

Why Use rezilient-ui?

  • Resilient Applications: Build robust applications that work seamlessly under poor or no network conditions.
  • Developer-Friendly API: Leverage simple, intuitive tools to integrate offline behavior into your UI.
  • Customizable: Extend and adapt components to suit your application's needs.
  • Part of a Unified Ecosystem: Combine with @dinkarjallan/rezilient-utils to create full-stack resilient solutions.

Contributing

Contributions, issues, and feature requests are welcome! Feel free to open an issue or submit a pull request.


License

This project is licensed under the MIT License.