A React component library built with Tailwind CSS offering:
- 🧩 Ready-to-use React components
- 🎯 TypeScript support
- 📱 Responsive design
- 🔧 Easy integration with existing Tailwind projects
- Node.js >= 14
- React >= 16.8.0
- React DOM >= 16.8.0
- Install the package and its dependencies:
npm install @biosai/front-end-components
- Create or update your
postcss.config.js
:
module.exports = {
plugins: [
require('@tailwindcss/forms'),
],
};
- 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
};
- Import styles in your main CSS file:
@tailwind base;
@tailwind components;
@tailwind utilities;
Install dependencies
npm install
Build package
npm run build
Lint code
npm run lint
Clean build files
npm run clean
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',
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
).
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>
);
}
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}
/>
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>
import { Error } from '@biosai/front-end-components';
<Error content="Error message" />
import { Legend } from '@biosai/front-end-components';
<Legend
content="Legend text"
textAlign="text-left"
textColor="text-blue"
textSize="text-sm"
/>
import { List } from '@biosai/front-end-components';
<List
items={['Item 1', 'Item 2']}
logo={<YourLogo />}
/>
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"
/>
import { Icon } from '@biosai/front-end-components';
<Icon
logo="path/to/icon.svg"
alt="Icon description"
size={24}
link="https://example.com"
/>
import { Price } from '@biosai/front-end-components';
<Price price="100" legend="Price legend" />
import { ProductCard } from '@biosai/front-end-components';
<ProductCard
title="Product Card"
legend="Legend"
price="100"
priceLegend="Price legend"
/>
import { PresetCard } from '@biosai/front-end-components';
<PresetCard
title="Preset Card"
logo={<YourLogo />}
description="Description"
buttonText="Click me"
onButtonClick={() => {}}
/>
import { Chip } from '@biosai/front-end-components';
<Chip label="Chip" borderColor="border-primary" backgroundColor="bg-primary" />
import { ReviewCard } from '@biosai/front-end-components';
<ReviewCard name="Reviewer" text="Review text" width="w-[350px]" />
import { Collapsible } from '@biosai/front-end-components';
<Collapsible title="Collapsible title" content="Collapsible content" />
To publish this package, you need to run the following commands:
npm login
npm run build
npm publish
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.
ISC