Skip to content

Commit 4baa279

Browse files
committed
Added example images and added stacks() section to README
1 parent ed3fa91 commit 4baa279

4 files changed

+21
-1
lines changed

README.md

+21-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
<ol>
1919
<li><a href="#by-row">By Row</a></li>
2020
<li><a href="#by-button">By Button</a></li>
21+
<li><a href="#as-stack">As Stack</a></li>
2122
</ol>
2223
</li>
2324
<li><a href="#forcereply-and-replykeyboardremove">ForceReply and ReplyKeyboardRemove</a></li>
@@ -135,6 +136,8 @@ InlineKeyboardMarkup::make()
135136
]);
136137
```
137138

139+
![InlineKeyboard with multiple rows](./docs/images/inlinekeyboard-multiple-rows.png)
140+
138141
#### By Button
139142

140143
```php
@@ -153,11 +156,28 @@ InlineKeyboardMarkup::make()
153156
->button(InlineKeyboardButton::make('C')->callbackData('answer-c'))
154157
->button(InlineKeyboardButton::make('D')->callbackData('answer-d'));
155158
```
159+
![InlineKeyboard with multiline buttons](./docs/images/inlinekeyboards-multiline-buttons.png)
156160

157161
It's up to you if you define your buttons inline like in these examples or you'd like to generate a whole row before and
158162
pass the variable to the `row()` method.
159163

160-
**You can mix and match the `row()` and `button()` methods.**
164+
#### As Stack
165+
166+
If you want to add a bunch of buttons that have a row for themselves you can use the `stack()` method.
167+
168+
```php
169+
InlineKeyboardMarkup::make()
170+
->stack([
171+
InlineKeyboardButton::make('Login')->loginUrl([
172+
'url' => 'https://example.com/login'
173+
]),
174+
InlineKeyboardButton::make('Visit Homepage')->url('https://example.com')
175+
]);
176+
```
177+
178+
![InlineKeyboard with stack](./docs/images/inlinekeyboard-stack.png)
179+
180+
**You can mix and match the `row()`, `stack()` and `button()` methods as it fits your needs.**
161181

162182
<p align="right">(<a href="#top">back to top</a>)</p>
163183

39.2 KB
Loading

docs/images/inlinekeyboard-stack.png

32.5 KB
Loading
Loading

0 commit comments

Comments
 (0)