Catalog npm
Back to packageRELEASE DETAILS

1.0.8

npm

@0xfacet/component-library

A reusable component library for Next.js applications.

component librarynext.jsreactreusableui components
Published16 Feb 2024
Direct dependencies27
Transitive dependenciesNot calculated

README

Current package documentation

@0xfacet/component-library

A reusable component library for Next.js applications, designed to offer a comprehensive suite of UI components that are essential for building modern web applications. This library is developed with flexibility and customization in mind, featuring components like BlockieAvatar, Card, Carousel, and many more, to help you build your Next.js applications faster and more efficiently.

Installation

Install the component library in your project with npm or yarn:

npm install @0xfacet/component-library

or

yarn add @0xfacet/component-library

Usage

Here's how to use various components from the library in your application:

import React from "react";
import { Card, Button, Carousel } from "@0xfacet/component-library";

function App() {
  return (
    <div>
      <Card>
        <h2>Card Title</h2>
        <p>This is a card from the @0xfacet/component-library</p>
        <Button>Click Me</Button>
      </Card>
      <Carousel>{/* Carousel items */}</Carousel>
    </div>
  );
}

export default App;

Components Overview

Our component library is meticulously crafted to support a wide range of design and development needs, organized into foundational UI components and advanced Core components. This structure ensures that developers can easily access exactly what they need, from simple building blocks to complex, feature-rich components.

UI Components

Located in the ui folder, these components are the versatile building blocks of your application's UI. Designed for maximum reusability and customization, they include:

  • Accordion: Collapsible sections for efficient space use and content organization.
  • Button: The quintessential interactive element for user actions.
  • Checkbox: For user selections and toggles.
  • Dialog: Modal overlays for critical user confirmations and interactions.
  • DropdownMenu: Selectable lists for option-rich inputs.
  • Input: Text fields for user input, supporting various data types.
  • Label: Descriptive text for form elements and user interface controls.
  • RadioGroup: Exclusive selection controls for setting preferences or options.
  • Select: Dropdowns for single or multiple selections from a list.
  • Sheet: Sliding panels for secondary content or actions.
  • Spinner: A visual cue for loading processes, elegantly indicating background activities.
  • Tooltip: Contextual hints and brief messages tied to UI elements.

Core Components

These components leverage the foundational UI components to create more sophisticated, ready-to-use functionalities. They address common UI patterns and complex interactions, making them indispensable for building rich interfaces. They include:

  • Avatar: Displays user or entity profile pictures, often with status indicators.
  • Button (Enhanced): Extends the foundational Button with extended functionalities like loading states.
  • Card: A versatile container for grouping related information and actions in a clear, concise format.
  • Carousel: A dynamic component for browsing through a collection of items, images, or content.
  • CopyText: A utility component that simplifies text copying to the clipboard with a single click.
  • Grid: A layout tool for creating responsive, grid-based designs.
  • Heading: Typography component for defining hierarchical content structure.
  • Link: Enhanced navigation elements for in-app routing or external linking.
  • List: Organized display for lists of items, supporting various styles and interactions.
  • Modal (Enhanced): Extends the foundational Dialog with additional features.
  • Pagination: Navigation component for managing content spread across multiple pages.
  • Section: Layout component that provides thematic grouping for content, enhancing readability and structure.
  • SegmentedControl: A control component for toggling between different views or modes within the same context.
  • ShowMoreText: Text display with built-in mechanisms for expanding and collapsing long content.
  • Table: A component for simple data presentation.
  • Toast: Timed, non-disruptive messages for user notifications and feedback.
  • Tooltip (Enhanced): Extends the foundational Tooltip.

Importing Components

Utilize components in your project seamlessly:

// Importing UI components
import { Button as UIButton, Input } from "@0xfacet/component-library/ui";

// Importing Core components for more complex scenarios
import { Button as CoreButton, Modal } from "@0xfacet/component-library";

Our components are designed to be intuitive and flexible, catering to a broad spectrum of design requirements and ensuring that your applications remain at the forefront of modern UI design.

Integrating with Tailwind CSS

To ensure that the Tailwind CSS class names used in @0xfacet/component-library are correctly applied and compiled in your project, you need to include the library's component files in your Tailwind configuration. This step is crucial for Tailwind CSS to apply its styles to the components imported from @0xfacet/component-library.

Follow these instructions to update your tailwind.config.js file:

  1. Locate Your Tailwind Configuration File

    Open your project's tailwind.config.js file. If you do not have this file, you may need to initialize Tailwind CSS in your project first. Refer to Tailwind CSS Installation for guidance.

  2. Update the content Array

    In the tailwind.config.js file, find the content array. You will add a new pattern that matches the JavaScript files within the @0xfacet/component-library package. Add the following line to the array:

    "./node_modules/@0xfacet/component-library/**/*.js";
    

    After adding, your content array should look something like this:

    module.exports = {
      content: [
        // Other contents...
        "./node_modules/@0xfacet/component-library/**/*.js", // Add this line
      ],
      // Other Tailwind configuration...
    };
    

Contributing

We welcome contributions to make this library even better! Whether it's adding new components, fixing bugs, or improving documentation, please feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License.

Support

For support, please open an issue in the GitHub issue tracker. We'll do our best to address it as quickly as possible.

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 30

Native requirements
27 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
@radix-ui/react-accordion
Environment
{
  "local_name": "@radix-ui/react-accordion",
  "alias": false,
  "peer_metadata": null
}
^1.1.2runtime
@radix-ui/react-checkbox
Environment
{
  "local_name": "@radix-ui/react-checkbox",
  "alias": false,
  "peer_metadata": null
}
^1.0.4runtime
@radix-ui/react-dialog
Environment
{
  "local_name": "@radix-ui/react-dialog",
  "alias": false,
  "peer_metadata": null
}
^1.0.5runtime
@radix-ui/react-dropdown-menu
Environment
{
  "local_name": "@radix-ui/react-dropdown-menu",
  "alias": false,
  "peer_metadata": null
}
^2.0.6runtime
@radix-ui/react-icons
Environment
{
  "local_name": "@radix-ui/react-icons",
  "alias": false,
  "peer_metadata": null
}
^1.3.0runtime
@radix-ui/react-label
Environment
{
  "local_name": "@radix-ui/react-label",
  "alias": false,
  "peer_metadata": null
}
^2.0.2runtime
@radix-ui/react-radio-group
Environment
{
  "local_name": "@radix-ui/react-radio-group",
  "alias": false,
  "peer_metadata": null
}
^1.1.3runtime
@radix-ui/react-select
Environment
{
  "local_name": "@radix-ui/react-select",
  "alias": false,
  "peer_metadata": null
}
^2.0.0runtime
@radix-ui/react-slot
Environment
{
  "local_name": "@radix-ui/react-slot",
  "alias": false,
  "peer_metadata": null
}
^1.0.2runtime
@radix-ui/react-tooltip
Environment
{
  "local_name": "@radix-ui/react-tooltip",
  "alias": false,
  "peer_metadata": null
}
^1.0.7runtime
class-variance-authority
Environment
{
  "local_name": "class-variance-authority",
  "alias": false,
  "peer_metadata": null
}
^0.7.0runtime
clsx
Environment
{
  "local_name": "clsx",
  "alias": false,
  "peer_metadata": null
}
^2.1.0runtime
react
Environment
{
  "local_name": "react",
  "alias": false,
  "peer_metadata": null
}
^17.0.0 || ^18.0.0runtime
react-blockies
Environment
{
  "local_name": "react-blockies",
  "alias": false,
  "peer_metadata": null
}
^1.4.1runtime
react-copy-to-clipboard
Environment
{
  "local_name": "react-copy-to-clipboard",
  "alias": false,
  "peer_metadata": null
}
^5.1.0runtime
react-dom
Environment
{
  "local_name": "react-dom",
  "alias": false,
  "peer_metadata": null
}
^17.0.0 || ^18.0.0runtime
react-icons
Environment
{
  "local_name": "react-icons",
  "alias": false,
  "peer_metadata": null
}
^5.0.1runtime
react-show-more-text
Environment
{
  "local_name": "react-show-more-text",
  "alias": false,
  "peer_metadata": null
}
^1.7.1runtime
tailwind-merge
Environment
{
  "local_name": "tailwind-merge",
  "alias": false,
  "peer_metadata": null
}
^2.2.1runtime
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^20.11.19development
@types/react
Environment
{
  "local_name": "@types/react",
  "alias": false,
  "peer_metadata": null
}
^18.2.55development
@types/react-blockies
Environment
{
  "local_name": "@types/react-blockies",
  "alias": false,
  "peer_metadata": null
}
^1.4.4development
@types/react-copy-to-clipboard
Environment
{
  "local_name": "@types/react-copy-to-clipboard",
  "alias": false,
  "peer_metadata": null
}
^5.0.7development
@types/react-dom
Environment
{
  "local_name": "@types/react-dom",
  "alias": false,
  "peer_metadata": null
}
^18.2.19development
@types/react-show-more-text
Environment
{
  "local_name": "@types/react-show-more-text",
  "alias": false,
  "peer_metadata": null
}
^1.4.5development
next
Environment
{
  "local_name": "next",
  "alias": false,
  "peer_metadata": null
}
^14.1.0development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^5.3.3development
next
Environment
{
  "local_name": "next",
  "alias": false,
  "peer_metadata": null
}
^14.1.0peer
react
Environment
{
  "local_name": "react",
  "alias": false,
  "peer_metadata": null
}
^17.0.0 || ^18.0.0peer
react-dom
Environment
{
  "local_name": "react-dom",
  "alias": false,
  "peer_metadata": null
}
^17.0.0 || ^18.0.0peer

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-lV1YLGdGFGeQY/8XZ7vmpmO6AYS3+h3cCw9zITviQYkwUmC++W2as3F7WTVrEXtBoA817dxU0GmgULZoTCpQ2A==",
  "shasum": "628c569b0f377f9626715371c6dbaba17b5d26ba",
  "tarball": "https://registry.npmjs.org/@0xfacet/component-library/-/component-library-1.0.8.tgz",
  "fileCount": 66,
  "unpackedSize": 94500,
  "signatures": [
    {
      "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
      "sig": "MEQCIHQ3IC4NxPSO0IK10JHNXgRMKNJ4Ka9OfmihwPOiyGsHAiBsWCJ3u7GaY815POBTF44w1wjziQhBPCJhLFQPLhICMA=="
    }
  ]
}

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 23:07 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:47710f5093e3087250a44459092f8de3c73c81ae37b032eda7920a3cc2fa02a0

Other collected versions

1.0.1123 May1.0.1022 Feb1.0.921 Feb1.0.716 Feb1.0.616 Feb1.0.515 FebView all collected versions →