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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@duct-ui/components

v0.8.4

Published

Standard Component Library for Duct UI

Readme

Duct UI Components

NPM Version

A comprehensive component library for Duct UI with buttons, forms, navigation, layout, and data display components.

Installation

npm install @duct-ui/components @duct-ui/core

Usage

import { createRef } from '@duct-ui/core'
import Button from '@duct-ui/components/button/button'
import Toggle from '@duct-ui/components/button/toggle'
import Modal from '@duct-ui/components/layout/modal'

const buttonRef = createRef<ButtonLogic>()
const modalRef = createRef<ModalLogic>()

function MyApp() {
  return (
    <div>
      <Button
        ref={buttonRef}
        label="Open Modal"
        class="btn btn-primary"
        on:click={() => modalRef.current?.show()}
      />

      <Toggle
        onLabel="Hide"
        offLabel="Show"
        initialState="off"
        on:change={(el, state) => console.log('Toggle:', state)}
      />

      <Modal
        ref={modalRef}
        content={() => <div>Modal content here</div>}
        on:close={() => console.log('Modal closed')}
      />
    </div>
  )
}

Available Components

Buttons

  • Button - Basic button with customizable styling
  • IconButton - Button with icon support
  • Toggle - Toggle button with on/off states
  • AsyncToggle - Toggle with async operations

Forms & Input

  • EditableInput - Click-to-edit text input

Dropdown & Navigation

  • Menu - Dropdown menu with items
  • MenuItem - Individual menu item
  • MenuSeparator - Visual separator for menus
  • Select - Dropdown selection component

Layout

  • Modal - Modal dialogs with positioning
  • Tabs - Tabbed interface component
  • Drawer - Responsive drawer/sidebar
  • SidebarNav - Navigation sidebar

Data Display

  • List - Paginated list component
  • TreeView - Hierarchical tree view

Images

  • Icon - Icon component with SVG support

Styling

Components use Tailwind CSS classes. Some components include additional CSS files that should be imported:

/* In your main CSS file */
@import '@duct-ui/components/layout/drawer.css';
@import '@duct-ui/components/layout/modal.css';
@import '@duct-ui/components/data-display/tree-view.css';
@import '@duct-ui/components/layout/sidebar-nav.css';

Component Logic Access

All components expose their logic through refs:

const componentRef = createRef<ComponentLogic>()

// Use in JSX
<Component ref={componentRef} />

// Access methods
componentRef.current?.someMethod()

Static Site Generation

All components work seamlessly with Duct's static site generation:

// In your SSG pages
import Button from '@duct-ui/components/button/button'

export default function HomePage() {
  return (
    <div>
      <h1>Welcome</h1>
      <Button label="Get Started" class="btn btn-primary" />
    </div>
  )
}

Resources