Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions en/components/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- [Macroable Trait](#macroable)
- [Custom Component](#custom)

- [Subtitle in Modal](#subtitle-in-modal)
---

<a name="description"></a>
Expand Down
39 changes: 39 additions & 0 deletions en/components/modal.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,3 +385,42 @@ The `moonshine::modal` component allows for loading content asynchronously.
</x-slot>
</x-moonshine::modal>
```

## Subtitle in Modal

The `Modal` component now supports an optional subtitle, allowing you to provide additional context or information in the modal header.

### Usage

To set a subtitle for a modal, use the `subtitle()` method on the `Modal` component.

```php
// torchlight! {"summaryCollapsedIndicator": "namespaces"}
// [tl! collapse:1]
use MoonShine\UI\Components\Modal;

Modal::make('Title')
->subtitle('This is a subtitle');
```

This will render a modal with both a title and a subtitle in the header.

### Blade Example

You can also set the subtitle directly in a Blade view:

```blade
<x-moonshine::modal title="Title" subtitle="This is a subtitle">
<!-- Modal content -->
</x-moonshine::modal>
```

### Styling

The subtitle uses the following CSS variables for styling, which can be customized:

- `--ms-modal-subtitle-font-size`: Font size of the subtitle.
- `--ms-modal-subtitle-font-weight`: Font weight of the subtitle.
- `--ms-modal-subtitle-color`: Color of the subtitle text.

These variables provide flexibility in styling the subtitle to match your application's design.
1 change: 1 addition & 0 deletions ru/components/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- [Трейт Macroable](#macroable)
- [Кастомный компонент](#custom)

- [Подзаголовок в модальном окне](#подзаголовок-в-модальном-окне)
---

<a name="description"></a>
Expand Down
39 changes: 39 additions & 0 deletions ru/components/modal.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,3 +385,42 @@ Modal::make('Title', 'Content...', ActionButton::make('Show Modal', '#'))
</x-slot>
</x-moonshine::modal>
```

## Подзаголовок в модальном окне

Компонент `Modal` теперь поддерживает опциональный подзаголовок, позволяя предоставить дополнительный контекст или информацию в заголовке модального окна.

### Использование

Чтобы установить подзаголовок для модального окна, используйте метод `subtitle()` на компоненте `Modal`.

```php
// torchlight! {"summaryCollapsedIndicator": "namespaces"}
// [tl! collapse:1]
use MoonShine\UI\Components\Modal;

Modal::make('Заголовок')
->subtitle('Это подзаголовок');
```

Это отобразит модальное окно с заголовком и подзаголовком в заголовке.

### Пример Blade

Вы также можете установить подзаголовок непосредственно в Blade-шаблоне:

```blade
<x-moonshine::modal title="Заголовок" subtitle="Это подзаголовок">
<!-- Содержимое модального окна -->
</x-moonshine::modal>
```

### Стилизация

Подзаголовок использует следующие CSS-переменные для стилизации, которые можно настроить:

- `--ms-modal-subtitle-font-size`: Размер шрифта подзаголовка.
- `--ms-modal-subtitle-font-weight`: Толщина шрифта подзаголовка.
- `--ms-modal-subtitle-color`: Цвет текста подзаголовка.

Эти переменные обеспечивают гибкость в стилизации подзаголовка в соответствии с дизайном вашего приложения.