Skip to content

More customization around message bubble layout #6030

@GiamoE

Description

@GiamoE

We need to render custom message types that don't fit the standard bubble layout:

  • System announcements that span full width
  • Custom notifications that need different styling

Currently we implement this using AttachmentFactory, which renders inside the bubble with ~75% width constraint and can't remove the bubble background.

iOS SDK Already Has This

The iOS SDK provides ChatMessageLayoutOptions where you can remove .bubble, control alignment, and create full-width messages. Android Compose SDK doesn't have
equivalent functionality.

Proposed Solution

Change visibility from internal to public:

// Current
@composable
internal fun LazyItemScope.DefaultMessageContainer(...)

// Proposed
@composable
public fun LazyItemScope.DefaultMessageContainer(...)

This allows developers to:

  • Render custom message types conditionally
  • Fall back to default rendering for regular messages
  • Avoid reimplementing entire message UI
  • Mix custom and default rendering in same list

Do let me know if I missed some thing and if there are other ways to achieve my use case!

With kind regards,
Giamo

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions