JSPM

@flint-org/ui

0.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 3
  • Score
    100M100P100Q44926F
  • License MIT

Enterprise-grade React component library with beautiful animations, built on Radix UI and Tailwind CSS. Features 50+ production-ready components with TypeScript support, dark mode, and accessibility built-in.

Package Exports

  • @flint-org/ui
  • @flint-org/ui/accordion
  • @flint-org/ui/activity-item
  • @flint-org/ui/alert
  • @flint-org/ui/alert-dialog
  • @flint-org/ui/animated/animated-components
  • @flint-org/ui/animated/animated-counter
  • @flint-org/ui/animated/code-snippet
  • @flint-org/ui/animated/gradient-background
  • @flint-org/ui/animated/scroll-reveal
  • @flint-org/ui/animated/tech-badge
  • @flint-org/ui/animated/tilt-card
  • @flint-org/ui/avatar
  • @flint-org/ui/badge
  • @flint-org/ui/breadcrumb
  • @flint-org/ui/button
  • @flint-org/ui/calendar
  • @flint-org/ui/card
  • @flint-org/ui/checkbox
  • @flint-org/ui/command
  • @flint-org/ui/data-table
  • @flint-org/ui/dialog
  • @flint-org/ui/dropdown-menu
  • @flint-org/ui/empty-state
  • @flint-org/ui/filter-bar
  • @flint-org/ui/hooks
  • @flint-org/ui/input
  • @flint-org/ui/label
  • @flint-org/ui/loading-spinner
  • @flint-org/ui/navbar
  • @flint-org/ui/package.json
  • @flint-org/ui/pagination
  • @flint-org/ui/popover
  • @flint-org/ui/preset
  • @flint-org/ui/progress
  • @flint-org/ui/radio-group
  • @flint-org/ui/search-input
  • @flint-org/ui/select
  • @flint-org/ui/separator
  • @flint-org/ui/sheet
  • @flint-org/ui/sidebar
  • @flint-org/ui/skeleton
  • @flint-org/ui/slider
  • @flint-org/ui/status-badge
  • @flint-org/ui/styles
  • @flint-org/ui/switch
  • @flint-org/ui/table
  • @flint-org/ui/tabs
  • @flint-org/ui/textarea
  • @flint-org/ui/theme-provider
  • @flint-org/ui/theme-switcher
  • @flint-org/ui/theme-toggle
  • @flint-org/ui/toast
  • @flint-org/ui/toaster
  • @flint-org/ui/tooltip
  • @flint-org/ui/utils

Readme

@flint-org/ui

NPM Version NPM Downloads CI Bundle Size License

Enterprise-grade React component library with beautiful, pre-animated components

Built on Radix UI primitives, styled with Tailwind CSS, and animated with Framer Motion. Features 50+ production-ready components with full TypeScript support, dark mode, and accessibility built-in.


โœจ Features

  • ๐ŸŽญ 50+ Components - Comprehensive library covering all enterprise needs
  • ๐ŸŽฌ Pre-Animated - Every component includes beautiful Framer Motion animations
  • ๐ŸŽจ Tailwind-Native - Deep integration with Tailwind CSS for easy customization
  • โ™ฟ Accessible - WCAG 2.1 AA compliant, keyboard navigation, screen reader support
  • ๐Ÿ“ฆ Tree-Shakeable - Individual component imports (Button = ~2KB vs 76KB full bundle)
  • ๐ŸŒ™ Dark Mode - Built-in theme system with next-themes support
  • ๐Ÿ“˜ TypeScript - 100% TypeScript with full type definitions
  • ๐Ÿ”ง Radix Primitives - Built on battle-tested, accessible primitives
  • โšก Performance - Optimized bundle size, code-splitting ready
  • ๐Ÿ“š Documented - Comprehensive Storybook with 80+ examples

๐Ÿ“ฆ Installation

# npm
npm install @flint-org/ui framer-motion tailwindcss

# pnpm
pnpm add @flint-org/ui framer-motion tailwindcss

# yarn
yarn add @flint-org/ui framer-motion tailwindcss

From GitHub Packages

npm install @flint-org/ui --registry=https://npm.pkg.github.com

Peer Dependencies

The library requires these peer dependencies:

  • react >= 18.0.0
  • react-dom >= 18.0.0
  • framer-motion (optional, for animated components)
  • tailwindcss >= 3.0.0 (for styling)

๐Ÿš€ Quick Start

1. Install the package

pnpm add @flint-org/ui framer-motion tailwindcss

2. Import CSS

Add to your root layout or _app.tsx:

import '@flint-org/ui/styles';

Use our preset for the full experience:

// tailwind.config.js
import flintPreset from '@flint-org/ui/preset';

export default {
  presets: [flintPreset],
  content: [
    './app/**/*.{ts,tsx}',
    './components/**/*.{ts,tsx}',
    './node_modules/@flint-org/ui/dist/**/*.js',
  ],
};

4. Use components

import { Button, Card, AnimatedCounter } from '@flint-org/ui';

export default function App() {
  return (
    <Card>
      <h2>Total Revenue</h2>
      <AnimatedCounter value={45231} prefix="$" />
      <Button>View Details</Button>
    </Card>
  );
}

๐Ÿ“ฆ Import Strategies

@flint-org/ui supports multiple import patterns to optimize your bundle size. Choose based on your needs:

Import only what you need for the smallest bundle sizes:

// UI Primitives (~1-2KB each)
import { Button } from '@flint-org/ui/button';
import { Card } from '@flint-org/ui/card';
import { Input } from '@flint-org/ui/input';

// Custom Components
import { DataTable } from '@flint-org/ui/data-table';  // ~10KB (includes TanStack Table)
import { Navbar } from '@flint-org/ui/navbar';

// Animated Components
import { AnimatedCounter } from '@flint-org/ui/animated/animated-counter';  // ~15KB (includes Framer Motion)
import { TiltCard } from '@flint-org/ui/animated/tilt-card';

// Utilities & Hooks
import { cn } from '@flint-org/ui/utils';
import { useToast } from '@flint-org/ui/hooks';

๐Ÿš€ Convenience Import (Quick Start/Prototyping)

Import from the main entry for faster development:

// Full bundle (~76KB) - includes all components
import { Button, Card, Input, DataTable, AnimatedCounter } from '@flint-org/ui';

๐Ÿ“Š Bundle Size Comparison

Import Method Bundle Size Use Case
@flint-org/ui/button ~1.9KB โœ… Production (97% smaller!)
@flint-org/ui/data-table ~10KB Complex data tables
@flint-org/ui/animated/counter ~15KB Animated components
@flint-org/ui (barrel) ~76KB Quick prototyping

๐ŸŽฏ Best Practices

  1. Production apps: Use individual imports (@flint-org/ui/button)
  2. Prototypes/demos: Use barrel import (@flint-org/ui)
  3. Animated components: Only import when you need animations
  4. Tree-shaking: Works automatically with individual imports
  5. Next.js App Router: Add "use client" to your page/component if needed

Example: Optimized Next.js Page

'use client';

import { Button } from '@flint-org/ui/button';
import { Card, CardHeader, CardTitle, CardContent } from '@flint-org/ui/card';
import { cn } from '@flint-org/ui/utils';

export default function Dashboard() {
  return (
    <div className={cn('container mx-auto p-6')}>
      <Card>
        <CardHeader>
          <CardTitle>Dashboard</CardTitle>
        </CardHeader>
        <CardContent>
          <Button>Get Started</Button>
        </CardContent>
      </Card>
    </div>
  );
}

Bundle size: ~3-5KB instead of 76KB! ๐ŸŽ‰


๐Ÿ“š Component Categories

UI Primitives (21 components)

Button, Card, Input, Badge, Dialog, Table, Skeleton, Select, Textarea, Checkbox, Switch, Tabs, DropdownMenu, Popover, Toast, Avatar, Progress, Separator, Calendar, Label, Toaster

Animated Components (7 components)

AnimatedCounter, ScrollReveal, TiltCard, TechBadge, CodeSnippet, GradientBackground, AnimatedComponents

Custom Components (10 components)

ThemeToggle, LoadingSpinner, Navbar, Sidebar, EmptyState, StatusBadge, Pagination, SearchInput, ActivityItem, FilterBar

Data Display (2 components)

DataTable, DataTableColumnHeader

Coming Soon (Week 2-4)

Tooltip, Alert, Sheet, Breadcrumb, RadioGroup, Slider, Accordion, Command, Combobox, DatePicker, Form, Stepper, Timeline, Menu, NumberInput, FileUpload, MultiSelect, Carousel, Rating, Tree, ContextMenu, ScrollArea


๐Ÿ“– Documentation


๐ŸŽจ Theming

Dark Mode

The library includes built-in dark mode support via CSS variables:

import { ThemeProvider } from 'next-themes';

function App({ children }) {
  return (
    <ThemeProvider attribute="class" defaultTheme="system" enableSystem>
      {children}
    </ThemeProvider>
  );
}

Customization

Override CSS variables to match your brand:

:root {
  --ui-primary: 262 83% 58%;
  --ui-background: 0 0% 100%;
  --ui-foreground: 222 47% 11%;
  --ui-radius: 0.5rem;
  /* ... more variables */
}

.dark {
  --ui-primary: 263 70% 50%;
  --ui-background: 224 71% 4%;
  --ui-foreground: 213 31% 91%;
  /* ... more variables */
}

๐Ÿ’ก Usage Examples

Basic Button

import { Button } from '@flint-org/ui';

<Button variant="default" size="md">
  Click me
</Button>

Data Table

import { DataTable } from '@flint-org/ui';

const columns = [
  { accessorKey: 'name', header: 'Name' },
  { accessorKey: 'email', header: 'Email' },
];

<DataTable columns={columns} data={users} />

Animated Counter

import { AnimatedCounter } from '@flint-org/ui';

<AnimatedCounter
  value={45231}
  prefix="$"
  duration={2}
/>

Scroll Reveal Animation

import { ScrollReveal } from '@flint-org/ui';

<ScrollReveal variant="fadeInUp">
  <Card>Content appears on scroll</Card>
</ScrollReveal>

๐Ÿ—๏ธ Framework Support

Next.js (App Router)

// app/layout.tsx
import '@flint-org/ui/styles';

export default function RootLayout({ children }) {
  return (
    <html lang="en">
      <body>{children}</body>
    </html>
  );
}

Next.js (Pages Router)

// _app.tsx
import '@flint-org/ui/styles';

export default function App({ Component, pageProps }) {
  return <Component {...pageProps} />;
}

Vite + React

// main.tsx
import '@flint-org/ui/styles';
import ReactDOM from 'react-dom/client';
import App from './App';

ReactDOM.createRoot(document.getElementById('root')!).render(<App />);

๐Ÿ”ง TypeScript

All components are fully typed:

import { ButtonProps, CardProps } from '@flint-org/ui';

const MyButton: React.FC<ButtonProps> = (props) => {
  return <Button {...props} />;
};

๐Ÿ“ฆ Bundle Size

The library is optimized for production:

  • Full Library: ~50KB gzipped
  • Tree-shakeable: Only bundle what you import
  • Example: Button + Card = ~8KB gzipped

Check your bundle with:

npx bundlephobia @flint-org/ui

๐Ÿงช Testing

The library includes comprehensive tests using Vitest and React Testing Library.

Running Tests

# Run tests in watch mode
pnpm test

# Run tests once (CI mode)
pnpm test:run

# Run tests with coverage
pnpm test:coverage

# Open visual test UI
pnpm test:ui

Test Coverage

We maintain high test coverage for all components:

  • Utilities: 100% coverage
  • Components: 80%+ coverage
  • Hooks: 90%+ coverage
  • Overall: 75%+ coverage

Writing Tests

Tests are located in the tests/ folder, mirroring the src/ structure:

tests/
โ”œโ”€โ”€ components/
โ”‚   โ”œโ”€โ”€ ui/
โ”‚   โ”‚   โ”œโ”€โ”€ button.test.tsx
โ”‚   โ”‚   โ”œโ”€โ”€ card.test.tsx
โ”‚   โ”‚   โ””โ”€โ”€ input.test.tsx
โ”‚   โ””โ”€โ”€ animated/
โ”œโ”€โ”€ hooks/
โ”‚   โ””โ”€โ”€ use-toast.test.ts
โ””โ”€โ”€ lib/
    โ””โ”€โ”€ utils.test.ts

Example test:

import { describe, it, expect } from 'vitest'
import { render, screen } from '../test-utils'
import { Button } from '@/components/ui/button'

describe('Button', () => {
  it('should render with children', () => {
    render(<Button>Click me</Button>)
    expect(screen.getByRole('button')).toHaveTextContent('Click me')
  })
})

๐Ÿค Contributing

We welcome contributions!

  1. Fork the repository
  2. Create a feature branch (git checkout -b feat/amazing-feature)
  3. Commit your changes (git commit -m 'feat: add amazing feature')
  4. Push to the branch (git push origin feat/amazing-feature)
  5. Open a Pull Request

Please ensure:

  • All tests pass (pnpm test:run)
  • Code is linted (pnpm lint)
  • TypeScript has no errors (pnpm typecheck)
  • Coverage remains above 75%

๐Ÿ“„ License

MIT ยฉ Flint UI Team

See LICENSE for details.


๐Ÿ™ Acknowledgments

Built with amazing open-source tools:



Made with โค๏ธ for the React community