Accessible React Component Library with shadcn – Pittaya UI

React/Next.js component library for Tailwind projects with CLI install, accessible UI components, and local source files.

Pittaya UI is an open-source collection of 20+ production-ready UI components built on TypeScript, Tailwind CSS, Shadcn UI, and Next.js.

You can initialize the UI component library through a CLI that records your global CSS path, component alias, utils alias, and React Server Components setting.

Each component arrives in your source tree as an editable file.

Features

🧩 23+ UI Components: Buttons, Badges, Carousels, Multi-Select, Copy Button, Orbit Images, and more are copy-ready for any project.

âš¡ CLI Installation: One command adds any component with its dependencies and styles pre-configured.

♿ Accessibility Built-In: All components sit on Radix UI primitives with full ARIA attributes, keyboard navigation, and screen reader support.

🔷 Full TypeScript Coverage: Every component and variant ships with complete type definitions and IntelliSense autocomplete.

🎨 Tailwind CSS: All styles run through Tailwind utility classes and stay fully editable from your own project files.

🔀 Multi-Variant System: Class Variance Authority handles multiple visual and behavioral variants per component.

📱 Mobile-First Layout: Every component is built on a mobile-first approach and scales across screen sizes.

🌙 Theme Management: Next Themes handles dark and light mode switching across the full component set.

Use Cases

  • Launch a marketing site with badges, cards, buttons, and orbit image sections.
  • Create an admin panel with tabs, selects, progress bars, and popovers.
  • Add typed form controls to a React product app with inputs, checkboxes, switches, and textareas.
  • Publish a component docs site with preview panels, code snippets, and copy actions.

How to Use It

1. Check these prerequisites before running the CLI:

  • Node.js 14 or higher
  • npm, yarn, or pnpm
  • React 16.8 or higher

2. Pittaya UI builds on top of Shadcn UI. Start by following the Shadcn installation guide to scaffold your project. If your project already runs Shadcn, skip this step.

3. Run the Pittaya CLI from your project root:

npx pittaya init

4. The CLI walks you through several configuration prompts:

Welcome to Pittaya UI!
✔ Which style would you like to use? › Default
✔ Where is your globals.css file? … app/globals.css
✔ Use React Server Components? … yes
✔ Path for components? … @/components
✔ Path for utils? … @/lib/utils
✔ components.json created successfully!
✔ Dependencies installed!
✅ Pittaya UI configured successfully!

5. Add a specific component by name:

npx pittaya add button

6. Or add the entire component set at once:

npx pittaya add --all

7. Import a component directly from its local path:

import { Button } from "@/components/pittaya/ui/button";
export default function App() {
  return <Button>Click me</Button>;
}

8. Customizing Component Styles. All components use Tailwind CSS utility classes. Open any component file under @/components/pittaya/ui/ and edit the class strings directly. Tailwind Merge prevents class conflicts when you add utilities on top of the defaults.

9. All UI components included:

ComponentDescription
Announcement BadgeDisplays short highlight text near headings or hero content.
AvatarRenders profile or brand images.
BadgeRenders compact status labels.
ButtonRenders clickable actions.
CardGroups related content in a bordered container.
CarouselCycles through slide based content.
CheckboxRenders boolean form input.
CommandRenders command style search or action panels.
Copy ButtonCopies snippet content to the clipboard.
Installation SectionRenders install steps for docs pages or landing pages.
InputRenders single line text entry.
LabelRenders text labels for form controls.
Multi SelectRenders multi choice selection input.
Orbit ImagesRenders orbit style image compositions.
PopoverRenders anchored floating content.
ProgressRenders progress feedback.
Radio GroupRenders exclusive option selection.
SelectRenders dropdown selection.
SkeletonRenders loading placeholders.
SwitchRenders binary toggle input.
TabsRenders tab based content sections.
TextareaRenders multi line text entry.
TooltipRenders small contextual hints

Related Resources

  • Shadcn UI: The copy-paste component system that Pittaya UI extends with additional components and CLI tooling.
  • Class Variance Authority: The variant management library that handles multiple visual states per component without class conflicts.
  • Tailwind CSS: The utility-first CSS framework that covers all styling in the component set.

FAQs

Q: Can you use Pittaya components without the CLI?
A: Yes. Each component page on the official documentation site has a copy button. Copy the source code, paste it into your project manually, and install any missing Radix UI or utility dependencies listed in the component file.

Q: Will the init command overwrite an existing Shadcn configuration?
A: No. The CLI detects an existing components.json and skips the Shadcn setup step.

Q: How do you update a component after it has been added?
A: Re-run npx pittaya add [component]. The CLI will prompt you to confirm before overwriting the existing file in your source tree.

pittaya

pittaya

A modern, flexible open-source UI library for React and Next.js.

Leave a Reply

Your email address will not be published. Required fields are marked *