Skip to content

Commit

Permalink
Add rightToLeft option in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
sadegh19b committed Apr 2, 2023
1 parent cd45e00 commit f744dcf
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/content/en/features/keyboards.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,3 +199,22 @@ Keyboard::make()
->button('Dismiss')->action('dismiss')->param('id', '42')->width(0.5)
->when($userCanDelete, fn(Keyboard $keyboard) => $keyboard->button('Delete')->action('delete')->param('id', '42')->width(0.5))
```

## Right to left layout

A `rightToLeft` method allows to change buttons layout from left-to-right to right-to-left (RTL).

```php
use DefStudio\Telegraph\Keyboard\Button;
use DefStudio\Telegraph\Keyboard\Keyboard;

$keyboard = Keyboard::make()
->row([
Button::make('Delete')->action('delete')->param('id', '42'),
Button::make('Dismiss')->action('dismiss')->param('id', '42'),
])
->row([
Button::make('open')->url('https://test.it'),
])
->rightToLeft();
```

0 comments on commit f744dcf

Please sign in to comment.