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

@sswahn/components

v2.4.1

Published

A collection of customizable, reusable React components.

Downloads

93

Readme

Components · License npm version Weekly Downloads

A collection of customizable, reusable React components.

Features

  • Checkbox Component: Create customizable checkboxes with labels using the Checkbox component, featuring options for custom classes, checked status, and change event handling.
  • Dropdown Component: Easily generate dropdown menus with various options using the Dropdown component, providing customization through a custom class and a list of options with labels and associated click handlers, and support for option icons.
  • Modal Component: Utilize the Modal component to effortlessly create modal dialogs that can be programmatically opened and closed, with customizable appearances and onClose event handling.
  • Search Component: Implement search functionality with the Search component, offering an input field for capturing search input changes, along with customization options such as a custom class and a placeholder.
  • Sidebar Component: Create flexible sidebars with open and close functionality using the Sidebar component, featuring customization through a custom class, open status control, and an onClose event handler.
  • Tabs Component: The Tab Component is a flexible and accessible solution for implementing tabbed navigation. Easily organize content into tabs and switch between them with a clean and customizable interface.

Installation

Using npm.

npm install @sswahn/components

Usage

Import the components.

import {
  Checkbox,
  Dropdown,
  Modal,
  Search,
  Sidebar,
  Tabs
} from '@sswahn/components'

Checkbox

The Checkbox component allows you to create customizable checkboxes with labels.

<Checkbox
  className="custom-checkbox"
  label="Check me"
  checked={isChecked}
  onChange={handleCheckboxChange}
/>

Dropdown

The Dropdown component provides a simple way to create dropdown menus with various options, including optional icons.

const dropdownOptions = [
  {icon: FirstIcon, label: 'option one', onClick: handleOptionOne},
  {icon: SecondIcon, label: 'option two', onClick: handleOptionTwo},
  {icon: ThirdIcon, label: 'option three', onClick: handleOptionThree}
]
<Dropdown
  className="custom-dropdown"
  icon={ButtonIcon}
  text="Select an option"
  options={dropdownOptions}
/>

Modal

The Modal component allows you to create modal dialogs that can be opened and closed programmatically.

<Modal className="custom-modal" open={isOpen} onClose={handleCloseModal}>
  {/* Content for the modal */}
</Modal>

Search

The Search component provides an input field for searching, and it allows you to capture search input changes.

<Search className="custom-search" onChange={handleSearch} placeholder="Search..." />

Sidebar

The Sidebar component helps you create flexible sidebars with an open and close functionality.

<Sidebar className="custom-sidebar" open={isOpen} onClose={handleCloseSidebar}>
  {/* Sidebar content */}
</Sidebar>

Tabs

The Tabs component allows you to easily organize content into tabs and switch between them.

const tabOptions = [
  {label: 'Tab 1', content: <p>Content for Tab 1</p>},
  {label: 'Tab 2', content: <p>Content for Tab 2</p>},
  {label: 'Tab 3', content: <p>Content for Tab 3</p>}
]

<Tabs className="custom-tabs" options={tabOptions} />

Peer Dependencies

Components requires React as a peer dependency. You should have React installed in your project with a version compatible with this library.

Related

  • @sswahn/social: A collection of customizable, reusable social components for use with React.
  • @sswahn/router: A lightweight and flexible router for client-side routing in React.
  • @sswahn/login: A collection of customizable React components designed to streamline the user authentication processes.

License

Components is MIT Licensed