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 🙏

© 2025 – Pkg Stats / Ryan Hefner

preline-react

v1.1.1

Published

React components library for Preline UI

Readme

Preline React

React component library for Preline UI - Easy integration of Preline UI components in React applications.

View Storybook Documentation / View Demo Site

Features

  • Easy integration of Preline UI in React
  • Full TypeScript support
  • Tailwind CSS based
  • Responsive design support
  • Accessibility support
  • Customizable

Installation

# npm
npm install preline-react preline

# yarn
yarn add preline-react preline

# pnpm
pnpm add preline-react preline

Setup

1. Tailwind CSS Configuration

Make sure Tailwind CSS is installed:

npm install -D tailwindcss @tailwindcss/forms

2. CSS File Configuration

Add the following to your CSS file (e.g., globals.css):

@import "tailwindcss";
@plugin "@tailwindcss/forms";

/* Preline UI */
@import "preline/variants.css";
@source "../node_modules/preline/dist/*.js";

/* Preline React */
@source "../node_modules/preline-react/dist/*.js";

/* Optional Preline UI styles */
@layer base {
  button:not(:disabled),
  [role="button"]:not(:disabled) {
    cursor: pointer;
  }
}

3. Provider Setup

Use PrelineProvider at the root of your application:

import { PrelineProvider } from "preline-react";

function App() {
  return (
    <PrelineProvider>
      <div className="App">{/* Your application */}</div>
    </PrelineProvider>
  );
}

Usage

import { useState } from "react";
import { Button } from "preline-react";

export default function App() {
  const [count, setCount] = useState(0);

  return (
    <div className="p-6 text-center">
      <h1 className="mb-4 text-2xl font-bold">Count: {count}</h1>

      <Button variant="solid" color="blue" onClick={() => setCount(count + 1)}>
        Click
      </Button>
    </div>
  );
}

Available Components

Layout Components

  • Container - Container
  • Columns - Multi-column layout wrapper
  • Grid - Grid
  • LayoutSplitter - Layout Splitter component
  • Typography - Text styling component
  • Link - Hyperlink component
  • Divider - Horizontal or vertical line separator
  • KBD - Keyboard input element

Basic Components

  • Alert - Alert messages
  • Avatar - User avatar
  • AvatarGroup - Group of avatars
  • Badge - Status badge
  • Blockquote - Quote block
  • Button - Button
  • ButtonGroup - Group of buttons
  • Card - Card container
  • ChatBubble - Chat message bubble
  • Collapse - Collapsible content
  • Device - Device mockup
  • LegendIndicator - Legend indicator
  • List - List component
  • Progress - Progress bar
  • Ratings - Star ratings
  • Skeleton - Loading placeholder
  • Spinner - Loading spinner
  • StyledIcon - Styled icon
  • Toast - Toast notification
  • Timeline - Timeline component
  • TreeView - Tree View component

Form Components

  • Input - Text input
  • InputGroup - Input with addons
  • InputNumber - Number input
  • Textarea - Text area
  • Select - Select dropdown
  • Checkbox - Checkbox
  • Radio - Radio button
  • Switch - Toggle switch
  • FileInput - File upload input
  • RangeSlider - Range slider
  • ColorPicker - Color picker
  • TimePicker - Time picker
  • StrongPassword - Password strength validation input
  • TogglePassword - Password visibility toggle input

Overlay Components

  • Modal - Modal dialog
  • Tooltip - Tooltip
  • Popover - Popover

Navigation Components

  • Accordion - Accordion/collapsible sections
  • Pagination - Pagination controls

Customization

All components accept the className property, making it easy to apply custom styles:

<Button className="custom-button-style">Custom Button</Button>

Storybook

This project uses Storybook for component development and documentation.

Starting Storybook

# Start the development server
pnpm run storybook

Open http://localhost:6006 in your browser to view Storybook.

Building Storybook

# Build static Storybook site
pnpm run storybook:build

Built files will be output to the storybook-static directory.

Development & Release

Development

# Clone the repository
git clone https://github.com/minagishl/preline-react.git
cd preline-react

# Install dependencies
pnpm install

# Start Storybook
pnpm run storybook

Release

This package uses automated releases through GitHub Actions. To release a new version:

  1. Create a new GitHub release:

    • Go to the Releases page in the repository
    • Click "Create a new release"
    • Create a new tag with the format v*.*.* (e.g., v1.2.3)
    • Add a release title and description
    • Click "Publish release"
  2. GitHub Actions will automatically:

    • Run tests and linting
    • Automatically update and push package.json version
    • Build the package
    • Publish to npm with public access
    • Upload the package asset to the GitHub release

Prerequisites for automated publishing:

  • Set up NPM_TOKEN in GitHub repository secrets
  • Ensure the npm package name is available or you have publishing rights

License

MIT License - See LICENSE file for details.

Contributing

Contributions are welcome! Please send Issues or Pull Requests for details.

Support

If you encounter any issues, please report them at GitHub Issues.