Skip to content

Commit 3ffa79f

Browse files
committed
docs(modal): add positioned
1 parent 88e2575 commit 3ffa79f

File tree

4 files changed

+79
-0
lines changed

4 files changed

+79
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<button
2+
flowbiteButton
3+
[ngpDialogTrigger]="dialog">
4+
Modal
5+
</button>
6+
7+
<ng-template
8+
#dialog
9+
let-close="close">
10+
<div
11+
flowbiteModalOverlay
12+
position="top-left">
13+
<div flowbiteModal>
14+
<h3 flowbiteModalHeader>Terms of Service</h3>
15+
<div flowbiteModalContent>
16+
<p class="text-base leading-relaxed text-gray-500 dark:text-gray-400">
17+
With less than a month to go before the European Union enacts new consumer privacy laws
18+
for its citizens, companies around the world are updating their terms of service
19+
agreements to comply.
20+
</p>
21+
<p class="text-base leading-relaxed text-gray-500 dark:text-gray-400">
22+
The European Union’s General Data Protection Regulation (G.D.P.R.) goes into effect on May
23+
25 and is meant to ensure a common set of data rights in the European Union. It requires
24+
organizations to notify users as soon as possible of high-risk data breaches that could
25+
personally affect them.
26+
</p>
27+
</div>
28+
<div flowbiteModalFooter>
29+
<button
30+
flowbiteButton
31+
(click)="close()"
32+
color="info">
33+
I accept
34+
</button>
35+
<button
36+
flowbiteButton
37+
(click)="close()"
38+
color="default"
39+
outline>
40+
Decline
41+
</button>
42+
</div>
43+
</div>
44+
</div>
45+
</ng-template>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { Button } from 'flowbite-angular/button';
2+
import {
3+
Modal,
4+
ModalContent,
5+
ModalFooter,
6+
ModalHeader,
7+
ModalOverlay,
8+
} from 'flowbite-angular/modal';
9+
10+
import { Component } from '@angular/core';
11+
import { NgpDialogTrigger } from 'ng-primitives/dialog';
12+
13+
@Component({
14+
imports: [Button, NgpDialogTrigger, Modal, ModalContent, ModalFooter, ModalHeader, ModalOverlay],
15+
templateUrl: './_position.component.html',
16+
host: {
17+
class: 'flex flex-wrap flex-row gap-3 p-6',
18+
},
19+
})
20+
export class FlowbitePositionComponent {}

apps/docs/docs/components/modal/index.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,15 @@ keyword: ModalPage
2525
```angular-ts file="./_open-programatically.component.ts" group="openProgramatically" name="typescript"
2626
2727
```
28+
29+
## Positioned modal
30+
31+
{{ NgDocActions.demo('flowbitePositionComponent', {container: false}) }}
32+
33+
```angular-html file="./_position.component.html" group="position" name="html"
34+
35+
```
36+
37+
```angular-ts file="./_position.component.ts" group="position" name="typescript"
38+
39+
```

apps/docs/docs/components/modal/ng-doc.page.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import ComponentCategory from '../ng-doc.category';
22
import { FlowbiteDefaultComponent } from './_default.component';
33
import { FlowbiteOpenprogramaticallyComponent } from './_open-programatically.component';
4+
import { FlowbitePositionComponent } from './_position.component';
45

56
import type { NgDocPage } from '@ng-doc/core';
67

@@ -14,6 +15,7 @@ const Modal: NgDocPage = {
1415
demos: {
1516
flowbiteDefaultComponent: FlowbiteDefaultComponent,
1617
flowbiteOpenprogramaticallyComponent: FlowbiteOpenprogramaticallyComponent,
18+
flowbitePositionComponent: FlowbitePositionComponent,
1719
},
1820
};
1921

0 commit comments

Comments
 (0)