Skip to main content
This documentation is deprecated. We’ve moved to a CLI-based component approach that gives you full ownership and customization of the source code. Please see the new component documentation and migration guide for the recommended approach.

Styling the Social Comment Section

The social-style comment section requires a style configuration object to properly style its UI. This object holds all the values needed for styling various elements of the comment section, ensuring flexibility and adaptability to your app’s design needs. Using the default configuration is straightforward, and for most use cases, it provides a good balance of aesthetics and usability. However, you can also customize it to align perfectly with your app’s visual identity.

Getting the Style Configuration

To use the social comment section, you must pass a styleConfig object to the useSocialComments hook. You can obtain this configuration object using the useSocialStyle hook.
Default Configuration
For a basic setup, you can use the default configuration by simply calling useSocialStyle without any arguments:
Pass this styleConfig to the useSocialComments hook along with the entityId and any other optional properties.
Custom Configuration
If you wish to customize the styles, you can pass a partial configuration object to the useSocialStyle hook. Only the styles you want to change need to be included in the object. Here’s an example:
The returned styleConfig will include your customizations while retaining the default values for all other properties.

Style Configuration Object Interface

The style configuration object has the following structure:
Each section below details the properties available for customization:
CommentFeedStyleProps
Styles the comment feed container:
CommentStyleProps
Styles individual comments:
NewCommentFormStyleProps
Styles the new comment input form:

FontWeight and BorderStyles

You can use the following types for font weights and border styles:

Conclusion

The useSocialStyle hook provides an intuitive way to configure the styles for your comment section. Whether you stick with the default styles or create a completely custom design, this configuration system ensures your comment section fits seamlessly into your app. Customize as needed and create an engaging experience for your users.