Skip to main content

Installing Social Comments

Add Instagram-style social comments to your project with a single command.

Prerequisites

1

Initialize CLI

Creates your sublay.json configuration file. Select your platform and styling preference.
2

Install the Sublay SDK

React (Web):
React Native:
Expo:
The component’s other packages are listed under Required Dependencies. add offers to install any that are missing.
See the CLI Setup Guide for details.

Installation Command

--ref v8 reads the component from the v8 branch of the registry, where the v8 components live.

What Gets Installed

The CLI copies 43 files into your project on React (44 with Tailwind), and 44 on React Native and Expo (43 with Tailwind): the component’s own 26 files, and the shared pieces it is built from in shared/. Every file is yours to edit, the shared pieces included.

Using the Component

The section is bound to a Sublay entity by entityId (or pass the entity object). For a record in your own database, pass its ID as foreignId with createIfNotFound instead; see Attach comments to records you already have.
Make sure your app is wrapped with <SublayProvider>. See the Quick Start Guide for setup details.
On React Native and Expo, the sheets (the comment menu, Report) also need your whole app wrapped in <GestureHandlerRootView style={{ flex: 1 }}> from react-native-gesture-handler. Without it they don’t open or drag. react-native-reanimated needs its Babel setup too: Expo’s preset does it for you; on React Native, follow Reanimated’s install steps.
The Tailwind variant on React Native and Expo needs NativeWind set up in your app, or the components render unstyled. See Tailwind on React Native and Expo.

Platform Support


Switching Styling Variants

1

Delete Current Components

2

Update Configuration

Edit sublay.json:
3

Re-install

This replaces your component files. Back up any customizations first.

Next Steps

Props & API

Learn about available props

Customization

Customize the component

Features

Explore all features

File Structure

Understand file organization