Docs Quickstart Figma Flowbite
1.3.0
Getting started
Customize
Components
API Reference NEW
components / Class

FlowbiteThemeDirective

Decorators:@Directive
Selectors:[flowbiteTheme]
Implements:OnInit

Use to give a clean API on the current application theme

Properties

NameTypeDescription
currentTheme
r
Signal<FlowbiteTheme>

Get the application theme based on signals

Methods

getLocalStorageTheme()

Get theme from the localStorage

Presentation
getLocalStorageTheme(): FlowbiteTheme;
Returns
FlowbiteTheme -

The current theme saved in the localStorage with the key color-theme

ngOnInit()

implements OnInit

No documentation has been provided.

Presentation
ngOnInit(): void;
Returns
void

setTheme()

Set the theme inside the page

Presentation
setTheme(theme: FlowbiteTheme): void;
Parameters
NameTypeDescription
theme
FlowbiteTheme

Theme to apply

Returns
void

toggleTheme()

Toggle the theme saved in the localStorage and available in currentTheme

Presentation
toggleTheme(theme?: FlowbiteTheme | undefined): void;
Parameters
NameTypeDescription
theme
FlowbiteTheme | undefined

If provided, force the theme instead of toggling it between light and dark mode

Returns
void
Flowbite

© 2019-2024 Flowbite™ is a registered trademark. All Rights Reserved.