├── .editorconfig
├── .gitignore
├── .vscode
├── extensions.json
├── launch.json
└── tasks.json
├── LICENSE.md
├── README.md
├── angular.json
├── package-lock.json
├── package.json
├── public
└── favicon.ico
├── src
├── app
│ ├── accordion
│ │ ├── accordion.component.css
│ │ ├── accordion.component.html
│ │ ├── accordion.component.spec.ts
│ │ └── accordion.component.ts
│ ├── app.component.css
│ ├── app.component.html
│ ├── app.component.spec.ts
│ ├── app.component.ts
│ ├── app.config.server.ts
│ ├── app.config.ts
│ ├── app.routes.server.ts
│ ├── app.routes.ts
│ ├── carousel
│ │ ├── carousel.component.css
│ │ ├── carousel.component.html
│ │ ├── carousel.component.spec.ts
│ │ └── carousel.component.ts
│ ├── collapse
│ │ ├── collapse.component.css
│ │ ├── collapse.component.html
│ │ ├── collapse.component.spec.ts
│ │ └── collapse.component.ts
│ ├── datepicker
│ │ ├── datepicker.component.css
│ │ ├── datepicker.component.html
│ │ ├── datepicker.component.spec.ts
│ │ └── datepicker.component.ts
│ ├── dismiss
│ │ ├── dismiss.component.css
│ │ ├── dismiss.component.html
│ │ ├── dismiss.component.spec.ts
│ │ └── dismiss.component.ts
│ ├── drawer
│ │ ├── drawer.component.css
│ │ ├── drawer.component.html
│ │ ├── drawer.component.spec.ts
│ │ └── drawer.component.ts
│ ├── dropdown
│ │ ├── dropdown.component.css
│ │ ├── dropdown.component.html
│ │ ├── dropdown.component.spec.ts
│ │ └── dropdown.component.ts
│ ├── events
│ │ ├── events.component.css
│ │ ├── events.component.html
│ │ ├── events.component.spec.ts
│ │ └── events.component.ts
│ ├── home
│ │ ├── home.component.css
│ │ ├── home.component.html
│ │ ├── home.component.spec.ts
│ │ └── home.component.ts
│ ├── modal
│ │ ├── modal.component.css
│ │ ├── modal.component.html
│ │ ├── modal.component.spec.ts
│ │ └── modal.component.ts
│ ├── popover
│ │ ├── popover.component.css
│ │ ├── popover.component.html
│ │ ├── popover.component.spec.ts
│ │ └── popover.component.ts
│ ├── speed-dial
│ │ ├── speed-dial.component.css
│ │ ├── speed-dial.component.html
│ │ ├── speed-dial.component.spec.ts
│ │ └── speed-dial.component.ts
│ ├── tabs
│ │ ├── tabs.component.css
│ │ ├── tabs.component.html
│ │ ├── tabs.component.spec.ts
│ │ └── tabs.component.ts
│ └── tooltip
│ │ ├── tooltip.component.css
│ │ ├── tooltip.component.html
│ │ ├── tooltip.component.spec.ts
│ │ └── tooltip.component.ts
├── index.html
├── main.server.ts
├── main.ts
├── server.ts
├── services
│ └── flowbite.service.ts
└── styles.css
├── tsconfig.app.json
├── tsconfig.json
└── tsconfig.spec.json
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see https://editorconfig.org
2 | root = true
3 |
4 | [*]
5 | charset = utf-8
6 | indent_style = space
7 | indent_size = 2
8 | insert_final_newline = true
9 | trim_trailing_whitespace = true
10 |
11 | [*.ts]
12 | quote_type = single
13 |
14 | [*.md]
15 | max_line_length = off
16 | trim_trailing_whitespace = false
17 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # See http://help.github.com/ignore-files/ for more about ignoring files.
2 |
3 | # Compiled output
4 | /dist
5 | /tmp
6 | /out-tsc
7 | /bazel-out
8 |
9 | # Node
10 | /node_modules
11 | npm-debug.log
12 | yarn-error.log
13 |
14 | # IDEs and editors
15 | .idea/
16 | .project
17 | .classpath
18 | .c9/
19 | *.launch
20 | .settings/
21 | *.sublime-workspace
22 |
23 | # Visual Studio Code
24 | .vscode/*
25 | !.vscode/settings.json
26 | !.vscode/tasks.json
27 | !.vscode/launch.json
28 | !.vscode/extensions.json
29 | .history/*
30 |
31 | # Miscellaneous
32 | /.angular/cache
33 | .sass-cache/
34 | /connect.lock
35 | /coverage
36 | /libpeerconnection.log
37 | testem.log
38 | /typings
39 |
40 | # System files
41 | .DS_Store
42 | Thumbs.db
43 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
3 | "recommendations": ["angular.ng-template"]
4 | }
5 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
3 | "version": "0.2.0",
4 | "configurations": [
5 | {
6 | "name": "ng serve",
7 | "type": "chrome",
8 | "request": "launch",
9 | "preLaunchTask": "npm: start",
10 | "url": "http://localhost:4200/"
11 | },
12 | {
13 | "name": "ng test",
14 | "type": "chrome",
15 | "request": "launch",
16 | "preLaunchTask": "npm: test",
17 | "url": "http://localhost:9876/debug.html"
18 | }
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
3 | "version": "2.0.0",
4 | "tasks": [
5 | {
6 | "type": "npm",
7 | "script": "start",
8 | "isBackground": true,
9 | "problemMatcher": {
10 | "owner": "typescript",
11 | "pattern": "$tsc",
12 | "background": {
13 | "activeOnStart": true,
14 | "beginsPattern": {
15 | "regexp": "(.*?)"
16 | },
17 | "endsPattern": {
18 | "regexp": "bundle generation complete"
19 | }
20 | }
21 | }
22 | },
23 | {
24 | "type": "npm",
25 | "script": "test",
26 | "isBackground": true,
27 | "problemMatcher": {
28 | "owner": "typescript",
29 | "pattern": "$tsc",
30 | "background": {
31 | "activeOnStart": true,
32 | "beginsPattern": {
33 | "regexp": "(.*?)"
34 | },
35 | "endsPattern": {
36 | "regexp": "bundle generation complete"
37 | }
38 | }
39 | }
40 | }
41 | ]
42 | }
43 |
--------------------------------------------------------------------------------
/LICENSE.md:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 Bergside
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## Tailwind 4 Angular Starter
2 |
3 | [Follow this guide](https://flowbite.com/docs/getting-started/angular/) to learn how to set up a new Angular project with Tailwind CSS and integrate the open-source UI components from the Flowbite Library.
4 |
5 | ## Create Angular project
6 |
7 | The recommended and quickest way to get started with creating a new Angular project is by installing the official CLI tool by running the following command in your terminal:
8 |
9 | ```bash
10 | npm install -g @angular/cli
11 | ```
12 |
13 | This command will make the Angular CLI available on your local computer.
14 |
15 | 1. Run the following command to create a new Angular project:
16 |
17 | ```bash
18 | ng new flowbite-app
19 | ```
20 |
21 | You can follow the instructions from the CLI prompts to select the options that you want to choose when creating a new project - you should select "CSS" when asked.
22 |
23 | This command will create a new folder called `flowbite-app` where you have all the necessary source files to start a new local and production-ready Angular project.
24 |
25 | 2. Run the `ng serve --open` command in your terminal to start a local server:
26 |
27 | ```bash
28 | ng serve --open
29 | ```
30 |
31 | This will create a local development server and automatically open a new tab on the `localhost:4200` port by adding the `--open` flag to the command.
32 |
33 | Congratulations! Now you have a fully working Angular project installed and configured.
34 |
35 | ## Install Tailwind CSS
36 |
37 | Now that you've successfully installed and configured an Angular project we can proceed with installing the most popular utility-first CSS framework called Tailwind.
38 |
39 | 1. Install Tailwind CSS and Post CSS via NPM by running the following command:
40 |
41 | ```bash
42 | npm install tailwindcss @tailwindcss/postcss postcss --save
43 | ```
44 |
45 | This command will install all the dependencies of Tailwind CSS available in your `package.json` file.
46 |
47 | 2. Create a `.postcssrc.json` file in the root folder of your project and include the Tailwind PostCSS plugin:
48 |
49 | ```javascript
50 | {
51 | "plugins": {
52 | "@tailwindcss/postcss": {}
53 | }
54 | }
55 | ```
56 |
57 | 3. Import the core Tailwind directive inside the `styles.css` file:
58 |
59 | ```css
60 | /* You can add global styles to this file, and also import other style files */
61 |
62 | @import "tailwindcss";
63 | ```
64 |
65 | 5. Start a local development server on Angular by running `ng serve --open`. If you already had one open then you need to restart it to allow Angular to internally set up the new configuration.
66 |
67 | Congratulations! You can now start using the utility classes from Tailwind CSS inside your Angular project.
68 |
69 | ## Install Flowbite
70 |
71 | Now that you have both Angular and Tailwind CSS configured for your web application project you can proceed by installing the Flowbite Library to start leveraging the interactive UI components such as navbars, modals, cards, buttons, and more to build user interfaces faster with Tailwind CSS support.
72 |
73 | 1. Install Flowbite as a dependency using NPM by running the following command:
74 |
75 | ```bash
76 | npm install flowbite --save
77 | ```
78 |
79 | 2. Import the default theme variables from Flowbite inside your main `input.css` CSS file:
80 |
81 | ```css
82 | @import "flowbite/src/themes/default";
83 | ```
84 |
85 | 3. Import the Flowbite plugin file in your CSS:
86 |
87 | ```css
88 | @plugin "flowbite/plugin";
89 | ```
90 |
91 | 4. Configure the source files of Flowbite in your CSS:
92 |
93 | ```css
94 | @source "../node_modules/flowbite";
95 | ```
96 |
97 | 5. Update the `app.component.ts` file to use the `initFlowbite` function to enable the interactive components via data attributes:
98 |
99 | ```javascript
100 | import { Component } from '@angular/core';
101 | import { OnInit } from '@angular/core';
102 | import { initFlowbite } from 'flowbite';
103 |
104 | @Component({
105 | selector: 'app-root',
106 | templateUrl: './app.component.html',
107 | styleUrls: ['./app.component.css']
108 | })
109 | export class AppComponent implements OnInit {
110 | title = 'web-app';
111 |
112 | ngOnInit(): void {
113 | initFlowbite();
114 | }
115 | }
116 | ```
117 |
118 | This will allow you to enable components such as the modals, navigation bars, dropdowns to dynamically set up the functionality via our data attributes interface.
119 |
120 | ## Using with Angular SSR
121 |
122 | To enable using Flowbite with SSR (Server-Side Rendering) you need to create a custom service that will handle the dynamic import of Flowbite:
123 |
124 | ```javascript
125 | // src/app/services/flowbite.service.ts
126 | import { Injectable, Inject, PLATFORM_ID } from '@angular/core';
127 | import { isPlatformBrowser } from '@angular/common';
128 |
129 | @Injectable({
130 | providedIn: 'root'
131 | })
132 | export class FlowbiteService {
133 | constructor(@Inject(PLATFORM_ID) private platformId: any) {}
134 |
135 | loadFlowbite(callback: (flowbite: any) => void) {
136 | if (isPlatformBrowser(this.platformId)) {
137 | import('flowbite').then(flowbite => {
138 | callback(flowbite);
139 | });
140 | }
141 | }
142 | }
143 | ```
144 |
145 | **Important**: if you are using SSR make sure that this is the only way you're importing Flowbite in your Angular application to prevent the document object not being available on the server side.
146 |
147 | After that, you can use this service in your component to start using the Flowbite API and data attributes:
148 |
149 | ```javascript
150 | // src/app/components/some-component/some-component.component.ts
151 | import { Component, OnInit } from '@angular/core';
152 | import { FlowbiteService } from '../../services/flowbite.service';
153 |
154 | @Component({
155 | selector: 'app-some-component',
156 | templateUrl: './some-component.component.html',
157 | styleUrls: ['./some-component.component.css']
158 | })
159 | export class SomeComponent implements OnInit {
160 | constructor(private flowbiteService: FlowbiteService) {}
161 |
162 | ngOnInit(): void {
163 | this.flowbiteService.loadFlowbite((flowbite) => {
164 | initFlowbite();
165 | });
166 | }
167 | }
168 | ```
169 |
170 | This will prevent the "document is undefined" error that happens after upgrading to `v2.4.1` for SSR applications.
171 |
172 | ## UI components
173 |
174 | Now that you have installed all of the frameworks and libraries you can start using the whole collection of UI components and templates from the [Flowbite UI Library](https://flowbite.com/docs/getting-started/introduction/) and [Blocks](https://flowbite.com/blocks/marketing/feature/).
175 |
--------------------------------------------------------------------------------
/angular.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "version": 1,
4 | "newProjectRoot": "projects",
5 | "projects": {
6 | "flowbite-app": {
7 | "projectType": "application",
8 | "schematics": {},
9 | "root": "",
10 | "sourceRoot": "src",
11 | "prefix": "app",
12 | "architect": {
13 | "build": {
14 | "builder": "@angular-devkit/build-angular:application",
15 | "options": {
16 | "outputPath": "dist/flowbite-app",
17 | "index": "src/index.html",
18 | "browser": "src/main.ts",
19 | "polyfills": [
20 | "zone.js"
21 | ],
22 | "tsConfig": "tsconfig.app.json",
23 | "assets": [
24 | {
25 | "glob": "**/*",
26 | "input": "public"
27 | }
28 | ],
29 | "styles": [
30 | "src/styles.css"
31 | ],
32 | "scripts": [],
33 | "server": "src/main.server.ts",
34 | "outputMode": "server",
35 | "ssr": {
36 | "entry": "src/server.ts"
37 | }
38 | },
39 | "configurations": {
40 | "production": {
41 | "budgets": [
42 | {
43 | "type": "initial",
44 | "maximumWarning": "500kB",
45 | "maximumError": "1MB"
46 | },
47 | {
48 | "type": "anyComponentStyle",
49 | "maximumWarning": "4kB",
50 | "maximumError": "8kB"
51 | }
52 | ],
53 | "outputHashing": "all"
54 | },
55 | "development": {
56 | "optimization": false,
57 | "extractLicenses": false,
58 | "sourceMap": true
59 | }
60 | },
61 | "defaultConfiguration": "production"
62 | },
63 | "serve": {
64 | "builder": "@angular-devkit/build-angular:dev-server",
65 | "configurations": {
66 | "production": {
67 | "buildTarget": "flowbite-app:build:production"
68 | },
69 | "development": {
70 | "buildTarget": "flowbite-app:build:development"
71 | }
72 | },
73 | "defaultConfiguration": "development"
74 | },
75 | "extract-i18n": {
76 | "builder": "@angular-devkit/build-angular:extract-i18n"
77 | },
78 | "test": {
79 | "builder": "@angular-devkit/build-angular:karma",
80 | "options": {
81 | "polyfills": [
82 | "zone.js",
83 | "zone.js/testing"
84 | ],
85 | "tsConfig": "tsconfig.spec.json",
86 | "assets": [
87 | {
88 | "glob": "**/*",
89 | "input": "public"
90 | }
91 | ],
92 | "styles": [
93 | "src/styles.css"
94 | ],
95 | "scripts": []
96 | }
97 | }
98 | }
99 | }
100 | },
101 | "cli": {
102 | "analytics": "0c1a4a7c-f19f-486b-a00e-99cdfabba783"
103 | }
104 | }
105 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "tailwind-angular-starter",
3 | "version": "2.0.0",
4 | "description": "A free and open-source starter project to help you get started with the core Flowbite Library components and Angular",
5 | "license": "MIT",
6 | "repository": "https://github.com/themesberg/tailwind-angular-starter",
7 | "homepage": "https://flowbite.com/docs/getting-started/angular/",
8 | "contributors": [
9 | "Zoltán Szőgyényi (https://x.com/zoltanszogyenyi)"
10 | ],
11 | "author": "Bergside Inc.",
12 | "scripts": {
13 | "ng": "ng",
14 | "start": "ng serve",
15 | "build": "ng build",
16 | "watch": "ng build --watch --configuration development",
17 | "test": "ng test",
18 | "serve:ssr:flowbite-app": "node dist/flowbite-app/server/server.mjs"
19 | },
20 | "private": true,
21 | "dependencies": {
22 | "@angular/common": "^19.2.0",
23 | "@angular/compiler": "^19.2.0",
24 | "@angular/core": "^19.2.0",
25 | "@angular/forms": "^19.2.0",
26 | "@angular/platform-browser": "^19.2.0",
27 | "@angular/platform-browser-dynamic": "^19.2.0",
28 | "@angular/platform-server": "^19.2.0",
29 | "@angular/router": "^19.2.0",
30 | "@angular/ssr": "^19.2.0",
31 | "@tailwindcss/postcss": "^4.0.9",
32 | "express": "^4.18.2",
33 | "flowbite": "^3.1.2",
34 | "postcss": "^8.5.3",
35 | "rxjs": "~7.8.0",
36 | "tailwindcss": "^4.0.9",
37 | "tslib": "^2.3.0",
38 | "zone.js": "~0.15.0"
39 | },
40 | "devDependencies": {
41 | "@angular-devkit/build-angular": "^19.2.0",
42 | "@angular/cli": "^19.2.0",
43 | "@angular/compiler-cli": "^19.2.0",
44 | "@types/express": "^4.17.17",
45 | "@types/jasmine": "~5.1.0",
46 | "@types/node": "^18.18.0",
47 | "jasmine-core": "~5.6.0",
48 | "karma": "~6.4.0",
49 | "karma-chrome-launcher": "~3.2.0",
50 | "karma-coverage": "~2.2.0",
51 | "karma-jasmine": "~5.1.0",
52 | "karma-jasmine-html-reporter": "~2.1.0",
53 | "typescript": "~5.7.2"
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/themesberg/tailwind-angular-starter/d45b00cd302ee2dd939cbe961b36f0fa588d06e9/public/favicon.ico
--------------------------------------------------------------------------------
/src/app/accordion/accordion.component.css:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/themesberg/tailwind-angular-starter/d45b00cd302ee2dd939cbe961b36f0fa588d06e9/src/app/accordion/accordion.component.css
--------------------------------------------------------------------------------
/src/app/accordion/accordion.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
30 |
31 |
36 |
39 |
40 | Flowbite is an open-source library of interactive components built on
41 | top of Tailwind CSS including buttons, dropdowns, modals, navbars, and
42 | more.
43 |
44 |
45 | Check out this guide to learn how to
46 | get started
51 | and start developing websites even faster with components on top of
52 | Tailwind CSS.
53 |
54 |
55 |
56 |
57 |
82 |
83 |
88 |
89 |
90 | Flowbite is first conceptualized and designed using the Figma software
91 | so everything you see in the library has a design equivalent in our
92 | Figma file.
93 |
94 |
95 | Check out the
96 | Figma design system
101 | based on the utility classes from Tailwind CSS and components from
102 | Flowbite.
103 |
104 |
105 |
106 |
107 |
132 |
133 |
138 |
139 |
140 | The main difference is that the core components from Flowbite are open
141 | source under the MIT license, whereas Tailwind UI is a paid product.
142 | Another difference is that Flowbite relies on smaller and standalone
143 | components, whereas Tailwind UI offers sections of pages.
144 |
145 |
146 | However, we actually recommend using both Flowbite, Flowbite Pro, and
147 | even Tailwind UI as there is no technical reason stopping you from
148 | using the best of two worlds.
149 |
Supercharge your hiring by taking advantage of our limited-time sale for Flowbite Docs + Job Board. Unlimited access to over 190K top-ranked candidates and the #1 design job board.
Supercharge your hiring by taking advantage of our limited-time sale for Flowbite Docs + Job Board. Unlimited access to over 190K top-ranked candidates and the #1 design job board.
32 | With less than a month to go before the European Union enacts new consumer privacy laws for its citizens, companies around the world are updating their terms of service agreements to comply.
33 |
34 |
35 | The European Union’s General Data Protection Regulation (G.D.P.R.) goes into effect on May 25 and is meant to ensure a common set of data rights in the European Union. It requires organizations to notify users as soon as possible of high-risk data breaches that could personally affect them.
36 |
72 | This is some placeholder content the
73 | Profile tab's associated content. Clicking another tab will toggle the visibility of this one for the
76 | next. The tab JavaScript swaps classes to control the content
77 | visibility and styling.
78 |
79 |
80 |
86 |
87 | This is some placeholder content the
88 | Dashboard tab's associated content. Clicking another tab will toggle the visibility of this one for the
91 | next. The tab JavaScript swaps classes to control the content
92 | visibility and styling.
93 |
94 |
95 |
101 |
102 | This is some placeholder content the
103 | Settings tab's associated content. Clicking another tab will toggle the visibility of this one for the
106 | next. The tab JavaScript swaps classes to control the content
107 | visibility and styling.
108 |
109 |
110 |
116 |
117 | This is some placeholder content the
118 | Contacts tab's associated content. Clicking another tab will toggle the visibility of this one for the
121 | next. The tab JavaScript swaps classes to control the content
122 | visibility and styling.
123 |