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

ui-components-struct

v0.0.2

Published

A collection of reusable, customizable React components built with TypeScript, Tailwind CSS, and Storybook. Designed for modern UI development with flexibility and scalability.

Readme

Struct UI Components

Description

A collection of reusable, customizable React components built with TypeScript, Tailwind CSS, and Storybook. Designed for modern UI development with flexibility and scalability, this library provides a set of essential UI elements and hooks to accelerate the development of React applications. The components are styled with Tailwind CSS, offering a consistent and customizable design system. Storybook integration allows for easy component showcasing and testing.

File Structure

/src
├── components/          # Reusable React components
│   ├── core/             # Core components (Button, Card, etc.)
│   ├── form/             # Form-related components
│   ├── table/            # Table components
│   └── utils/            # Utility components
├── hooks/               # Custom React hooks
├── utils/               # Utility functions
├── assets/              # Assets (CSS, fonts, images)
└── index.ts             # Entry point for the library

Core Components

  • Accordion: A vertically collapsing panel that displays large amounts of content in an organized way. It allows users to expand and collapse sections of content, making it ideal for FAQs, documentation, and other content-heavy pages.
  • Alert: Displays important messages to the user, such as success, error, warning, or informational messages. It can be customized with different styles and icons.
  • AlertBox: A styled container for alerts, providing a consistent look and feel.
  • Avatar: A visual representation of a user, typically displaying a user's initials or profile picture.
  • Badge: A small visual indicator, often used to display a count or status.
  • Breadcrumbs: A navigation aid that shows the user's current location within the application.
  • Button: An interactive element that triggers an action, such as submitting a form or navigating to a new page.
  • ButtonGroup: A container for grouping buttons together, providing a consistent layout and spacing.
  • Card: A flexible container for displaying content, such as articles, products, or user profiles.
  • Checkbox: Allows the user to select one or more options from a list.
  • Dialog: A modal window that appears on top of the main content, used for displaying important information or prompting the user for input.
  • Dropdown: A toggleable menu that allows the user to choose one value from a predefined list.
  • Image: Displays images with optional styling and lazy loading.
  • Input: Allows the user to enter text, such as usernames, passwords, or search queries.
  • InputGroup: A container for grouping inputs together, providing a consistent layout and spacing.
  • Label: A text label for form elements, providing context and accessibility.
  • List: Displays a list of items, such as navigation links or product listings.
  • Loader: Indicates that content is loading, providing feedback to the user.
  • Modal: A dialog box/popup window that is displayed on top of the current page, used for displaying important information or prompting the user for input.
  • Notification: Displays a brief message to the user, typically used for non-critical updates or alerts.
  • Pagination: Allows the user to navigate through multiple pages of content, such as search results or product listings.
  • Progressbar: Visually represents the progress of a task, such as uploading a file or completing a form.
  • Radio: Allows the user to select one option from a list.
  • Table: Displays data in a tabular format, with features such as sorting, filtering, and pagination.
  • Tabs: Allows the user to switch between different views, such as different sections of a profile or different categories of products.
  • Textarea: Allows the user to enter multi-line text, such as comments or descriptions.
  • Tooltip: Displays information when the user hovers over an element, providing additional context or guidance.
  • Widget: A small application that can be installed and run within a web page, providing specific functionality or information.

Hooks

  • useArray: Provides utility functions for working with arrays, such as adding, removing, and updating elements.
  • useAsync: Handles asynchronous operations, such as fetching data from an API or performing a long-running task.
  • useClickOutside: Detects clicks outside of a specified element, allowing you to close a dropdown or modal when the user clicks away.
  • useCookie: Manages cookies, allowing you to store and retrieve data in the user's browser.
  • useCopyToClipboard: Copies text to the clipboard, providing a convenient way for users to share information.
  • useDarkMode: Toggles dark mode, allowing users to switch between light and dark themes.
  • useDebounce: Debounces a function, preventing it from being called too frequently.
  • useDebugInformation: Provides debug information, such as the component's render count and props.
  • useDeepCompareEffect: A useEffect hook that uses deep comparison, ensuring that the effect only runs when the dependencies have actually changed.
  • useEffectOnce: A useEffect hook that runs only once, similar to componentDidMount in class components.
  • useEventListener: Adds an event listener to an element, allowing you to respond to user interactions or other events.
  • useFetch: Fetches data from an API, providing a simple and convenient way to retrieve data from a remote server.
  • useGeolocation: Gets the user's geolocation, allowing you to display location-based content or provide location-aware features.
  • useHover: Detects when the user hovers over an element, allowing you to display tooltips or other hover-related effects.
  • useLongPress: Detects long presses on an element, allowing you to trigger a different action when the user presses and holds an element.
  • useMediaQuery: Detects media query changes, allowing you to adapt your UI to different screen sizes or devices.
  • useOnlineStatus: Detects the user's online status, allowing you to display a message when the user is offline or disable certain features.
  • useOnScreen: Detects when an element is on screen, allowing you to lazy load images or trigger animations when an element becomes visible.
  • usePrevious: Returns the previous value of a variable, allowing you to compare the current value to the previous value.
  • useRenderCount: Returns the number of times a component has rendered, useful for debugging performance issues.
  • useScript: Loads a script, allowing you to dynamically load external scripts or libraries.
  • useStateWithHistory: Manages state with history, allowing you to implement undo/redo functionality.
  • useStateWithValidation: Manages state with validation, ensuring that the state is always valid.
  • useStorage: Manages local storage, allowing you to store and retrieve data in the user's browser.
  • useTimeout: Sets a timeout, allowing you to execute a function after a specified delay.
  • useToggle: Toggles a boolean value, providing a simple way to switch between two states.
  • useTranslation: Handles translations, allowing you to create multilingual applications.
  • useUpdateEffect: A useEffect hook that only runs on updates, skipping the initial render.
  • useWindowSize: Gets the window size, allowing you to adapt your UI to different screen sizes.

Utilities

  • dates.ts: Date-related utility functions, such as formatting dates and calculating time differences.
  • index.ts: General utility functions, such as string manipulation, data formatting, and other common tasks.

Dependencies

  • @fortawesome/fontawesome-svg-core: Font Awesome SVG core.
  • @fortawesome/free-brands-svg-icons: Font Awesome brand icons.
  • @fortawesome/free-regular-svg-icons: Font Awesome regular icons.
  • @fortawesome/free-solid-svg-icons: Font Awesome solid icons.
  • @fortawesome/react-fontawesome: Font Awesome React component.
  • @react-hook/window-size: React hook for getting the window size.
  • @tanstack/react-table: Headless UI for building powerful tables & datagrids for React.
  • classnames: A simple JavaScript utility for conditionally joining classNames together.
  • copy-to-clipboard: Copy text to the clipboard.
  • js-cookie: A simple, lightweight JavaScript API for handling browser cookies.
  • react: A JavaScript library for building user interfaces.
  • react-charts: Simple, declarative React charts.
  • react-dom: Provides DOM-specific methods that are useful for managing a component in the browser.
  • react-router: A standard library for routing in React.
  • react-router-dom: A DOM bindings for React Router.

Installation

yarn install

Usage

import { Button } from 'ui-components-struct';

function App() {
  return (
    <Button onClick={() => alert('Clicked!')}>Click me</Button>
  );
}

Contributing

Contributions are welcome! Please fork the repository and submit a pull request.

License

MIT