Skip to content

Commit 4943674

Browse files
committed
direct use of v2 components without container
1 parent 6b08de1 commit 4943674

1 file changed

Lines changed: 17 additions & 2 deletions

File tree

guide/CodeReferences/ref.v2_components.md

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ You can use {container:data} to send a message with v2 component
1717
```
1818

1919
#### section structure
20-
section allow you to add a text + image + button together in inside the container
20+
section allow you to add a text + image + button together in inside the container, a section should contain at least one text and one accessory (image or button).
2121
the structure is:
2222
```
2323
{section:
@@ -101,5 +101,20 @@ $sendMessage[
101101
]
102102
```
103103

104+
### Example (Not using container)
105+
If you don't like how the container looks like, you can directly add components without it (only for text, section, gallery, file, separator)
106+
```php
107+
$sendMessage[
108+
{section:
109+
{text: a text inside section}
110+
{thumb: $userAvatar}
111+
}
112+
{separator}
113+
{section:
114+
{text: a text inside another section}
115+
{button:Click me:gray::btn_id}
116+
}
117+
]
118+
```
104119
### Output
105-
![](https://i.imgur.com/9bnlwKg.png)
120+
![](https://i.imgur.com/v8DYvPY.png)

0 commit comments

Comments
 (0)