> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sublay.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Components Overview

> Own your components with Sublay's CLI-based distribution system

# Sublay Components

Sublay provides a **CLI-based component distribution** system inspired by shadcn/ui. Instead of hiding UI components in `node_modules`, Sublay copies the full source code directly into your project so you own and control every line.

> [!NOTE]
>
> **The philosophy:** Copy, paste, customize. Not install and configure.
>
> You get **source code**, not packages. You **own** your components and can modify anything.

***

## How It Works

**1. Initialize Sublay**

```bash theme={null}
npx @sublay/cli init
```

Configure your platform (React/React Native/Expo), styling preference (Tailwind/Inline styles), and component installation path.

**2. Add Components**

```bash theme={null}
npx @sublay/cli add comments-threaded
# or
npx @sublay/cli add comments-social
```

Components are copied directly into your `src/components/` directory as editable source files.

**3. Use & Customize**

```tsx theme={null}
import { ThreadedCommentSection } from './components/comments-threaded';

<ThreadedCommentSection entityId="my-post-123" />
```

The component works out of the box. Want to customize? Edit the source files directly.

***

## Available Components

> [card] [Threaded Comments](https://docs.sublay.io/v7/components/components/threaded/overview.md)
>
> Reddit-style threaded discussions with:
>
> * Unlimited nesting depth
> * Upvote/downvote system
> * Visual threading lines
> * Collapsible threads
>
> **Best for:** Forums, technical discussions, detailed conversations

> [card] [Social Comments](https://docs.sublay.io/v7/components/components/social/overview.md)
>
> Instagram-style social comments with:
>
> * Single-level nesting
> * Heart/like system
> * Clean, minimal design
> * Top/New/Old sorting
>
> **Best for:** Social platforms, media content, quick interactions

> [card] [Notification Control](https://docs.sublay.io/v7/components/components/notifications/overview.md)
>
> Dropdown notification bell control with:
>
> * Real-time notification updates
> * Smart viewport positioning
> * Mark as read functionality
> * Infinite scroll
>
> **Best for:** Navigation bars, headers, notification systems

***

## Styling Options

Each component comes in two styling variants:

### Inline Styles

* All styles as `style={{}}` objects in JSX
* No external dependencies
* Works everywhere
* Easy to find and change colors
* Theme support via conditional logic

### Tailwind CSS

* Utility classes for styling
* Requires Tailwind CSS installed
* Dark mode via `dark:` prefix
* More concise code
* Easy to integrate with design systems

Choose your variant during `init` — you can switch by re-running `add` commands.

***

## What Gets Installed

When you add a component, approximately **25 TypeScript/TSX files** are copied into your project:

```
src/components/comments-threaded/
├── index.ts                    # Entry point
├── components/                 # All UI components (~20 files)
│   ├── threaded-comment-section.tsx
│   ├── new-comment-form.tsx
│   ├── comments-feed/
│   └── modals/
├── hooks/                      # React hooks
├── utils/                      # Utilities
└── context/                    # React context
```

Every file is:

* ✅ Visible in your project
* ✅ Editable
* ✅ TypeScript with full type annotations
* ✅ Self-documenting with inline comments

***

## Required Dependencies

Components depend on Sublay's core libraries for data fetching, real-time updates, authentication, and more.

**For React (Web):**

```json theme={null}
{
  "dependencies": {
    "@sublay/react-js": "^7.0.0",
    "@sublay/ui-core-react-js": "^7.0.0"
  }
}
```

**For React Native / Expo:**

```json theme={null}
{
  "dependencies": {
    "@sublay/react-native": "^7.0.0",
    "@sublay/ui-core-react-native": "^7.0.0"
  }
}
```

The CLI checks for these and offers to install them automatically. On Expo it installs them with `npx expo install`, so each matches your Expo SDK.

***

## Getting Started

> [card] [CLI Setup](https://docs.sublay.io/v7/components/installation/cli-setup.md)
>
> Install the CLI and configure your project

> [card] [Quick Start](https://docs.sublay.io/v7/components/installation/quick-start.md)
>
> Get comments working in under 5 minutes

> [card] [Customization](https://docs.sublay.io/v7/components/customization/overview.md)
>
> Learn how to customize colors, layout, and functionality

> [card] [Component Types](https://docs.sublay.io/v7/components/components/overview.md)
>
> Compare available components and choose the right one

***

## Philosophy

The Sublay CLI follows these principles:

1. **Minimal Props** — Components work with just `entityId`. No complex configuration required.
2. **Sensible Defaults** — Beautiful, accessible styling out of the box.
3. **Edit, Don't Configure** — Customize by editing source code, not passing config objects.
4. **Progressive Disclosure** — Ignore implementation details until you need to customize.
5. **Self-Documenting Code** — Clear file names, thorough comments, and color palettes documented in headers.

***

## Open Source

All components are **open source** under the Apache 2.0 license. You can fork, modify, contribute, and use them in commercial projects freely.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.