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

@biosai/front-end-components

v1.4.4

Published

A React component library with Tailwind CSS theming

Downloads

460

Readme

@biosai/front-end-components

A React component library built with Tailwind CSS offering:

  • 🧩 Ready-to-use React components
  • 🎯 TypeScript support
  • 📱 Responsive design
  • 🔧 Easy integration with existing Tailwind projects

Prerequisites

  • Node.js >= 14
  • React >= 16.8.0
  • React DOM >= 16.8.0

🧰 Installation

  1. Install the package and its dependencies:
npm install @biosai/front-end-components
  1. Create or update your postcss.config.js:
module.exports = {
  plugins: [
    require('@tailwindcss/forms'),
  ],
};
  1. Make sure to include our classes in your Tailwind config:
// tailwind.config.js
module.exports = {
  content: [
    './src/**/*.{js,jsx,ts,tsx}',
    './node_modules/@biosai/front-end-components/**/*.{js,jsx,ts,tsx}',
  ],
  plugins: [
    require('@tailwindcss/forms'),
  ],
  // ... rest of your config
};
  1. Import styles in your main CSS file:
@tailwind base;
@tailwind components;
@tailwind utilities;

⚙️ Development

Install dependencies

npm install

Build package

npm run build

Lint code

npm run lint

Clean build files

npm run clean

🎨 Theme Configuration

Default Theme Colors

primary: '#0F172A',
secondary: '#771717',
background: '#F9FAFB',
border: '#EAF2F1',
error: '#B91C1C',
legend: '#646464',
text: '#0F172A',
white: '#FFFFFF',
yellow: '#FFD600',
orange: '#FF9500',
green: '#34C759',
blue: '#007AFF',
red: '#FF3B30',
purple: '#8E8EE5',
pink: '#FF2D55',
grey: '#8E8E93',
brown: '#A2845E',
black: '#000000',

Responsive Design

All components are built with Tailwind's responsive utilities. You can use any Tailwind breakpoint prefix (sm:, md:, lg:, xl:) with the component props as well as any Tailwind class (e.g., w-full, h-10, text-primary, bg-white).

🏃‍♀️ Quick Start

You can star using the components with the default theme:

import { Button, Card } from '@biosai/front-end-components';

function MyComponent() {
  return (
    <Card>
      <Button content="Click me" />
    </Card>
  );
}

Or you can use the components with your own theme:

import { Button, Card } from '@biosai/front-end-components';

function MyComponent() {
  return (
    <Card>
      <Button content="Click me" backgroundColor="bg-primary" />
    </Card>
  );
}

🗃️ Components available

Button

import { Button } from '@biosai/front-end-components';

<Button
  content="Click me"
  width="w-full"
  height="h-10"
  backgroundColor="bg-primary"
  logo={<YourLogo />}
  logoPosition="left"
  textColor="text-white"
  onClick={() => {}}
  type="button"
  isLoading={false}
  isDisabled={false}
/>

Card

import { Card } from '@biosai/front-end-components';

<Card
  width="w-full"
  height="h-auto"
  backgroundColor="bg-primary"
  backgroundImage="path/to/image.png"
  contentAlignment="center"
  textColor="text-white"
  onClick={() => {}}
  hasBorder={false}
  contentAlignmentY="top"
  contentAlignmentX="left"
>
  {/* Card content */}
</Card>

Error

import { Error } from '@biosai/front-end-components';

<Error content="Error message" />

Legend

import { Legend } from '@biosai/front-end-components';

<Legend
  content="Legend text"
  textAlign="text-left"
  textColor="text-blue"
  textSize="text-sm"
/>

List

import { List } from '@biosai/front-end-components';

<List
  items={['Item 1', 'Item 2']}
  logo={<YourLogo />}
/>

Title

import { Title } from '@biosai/front-end-components';

<Title
  content="Title text"
  width="w-full"
  height="h-fit"
  textColor="text-primary"
  backgroundColor="bg-secondary"
  textSize="text-md"
  fontWeight="font-bold"
/>

Icon

import { Icon } from '@biosai/front-end-components';

<Icon
  logo="path/to/icon.svg"
  alt="Icon description"
  size={24}
  link="https://example.com"
/>

Price

import { Price } from '@biosai/front-end-components';

<Price price="100" legend="Price legend" />

ProductCard

import { ProductCard } from '@biosai/front-end-components';

<ProductCard
  title="Product Card"
  legend="Legend"
  price="100"
  priceLegend="Price legend"
/>

PresetCard

import { PresetCard } from '@biosai/front-end-components';

<PresetCard
  title="Preset Card"
  logo={<YourLogo />}
  description="Description"
  buttonText="Click me"
  onButtonClick={() => {}}
/>

Chip

import { Chip } from '@biosai/front-end-components';

<Chip label="Chip" borderColor="border-primary" backgroundColor="bg-primary" />

ReviewCard

import { ReviewCard } from '@biosai/front-end-components';

<ReviewCard name="Reviewer" text="Review text" width="w-[350px]" />

Collapsible

import { Collapsible } from '@biosai/front-end-components';

<Collapsible title="Collapsible title" content="Collapsible content" />

📝 Package Maintenance

NPM publish

To publish this package, you need to run the following commands:

npm login
npm run build
npm publish

Versioning

This package follows the Major-Menor-Patch versioning scheme:

  • Major: Breaking changes
  • Menor: New features
  • Patch: Bug fixes

So if you are going to make breaking changes, you need to increment the major version. If you are going to add new features, you need to increment the minor version. And if you are going to fix bugs, you need to increment the patch version.

⚖️ License

ISC