@fleetbase/ember-ui
Version:
Fleetbase UI provides all the interface components, helpers, services and utilities for building a Fleetbase extension into the Console.
68 lines (51 loc) • 2.63 kB
Markdown
# Modal Component
This is a reusable modal component built with Ember.js. It provides a customizable UI element that can be used to display content in a modal dialog.
## Usage
To use the modal component, you can simply import it into your Ember component and include it in your template as follows:
```hbs
<EmberModal ="modal/dialog" />
```
You can customize the EmberModal component by passing in different props:
| Parameter | Description |
|-----------------|-------------------------------------------------------------------|
| `dialogComponent` | The component used to render the modal dialog. |
| `headerComponent` | The component used to render the modal header. |
| `bodyComponent` | The component used to render the modal body. |
| `footerComponent` | The component used to render the modal footer. |
| `onClose` | A function that will be called when the modal is closed. |
| `onSubmit` | A function that will be called when the modal is submitted. |
| `fade` | Whether or not to use a fade animation. |
| `showModal` | Whether or not to show the modal. |
| `keyboard` | Whether or not to close the modal when the escape key is pressed. |
| `size` | The size of the modal (e.g. small, medium, large). |
| `backdropClose` | Whether or not to close the modal when the backdrop is clicked. |
| `paddingLeft` | The left padding of the modal. |
| `paddingRight` | The right padding of the modal. |
| `position` | The position of the modal (e.g. center, top, bottom). |
| `scrollable` | Whether or not the modal is scrollable. |
| `fullscreen` | Whether or not the modal is fullscreen. |
## Example
```hbs
{{#if this.showModal}}
<EmberModal
="modal/dialog"
="modal/header"
="modal/body"
="modal/footer"
={{this.closeModal}}
={{this.submitModal}}
={{true}}
={{true}}
={{true}}
="large"
={{true}}
={{10}}
={{10}}
="center"
={{true}}
={{true}}
>
{{!-- Modal Content Goes Here --}}
</EmberModal>
{{/if}}
```