How do I add daisyUI to a SAFE project?
DaisyUI is a component library for Tailwind CSS.
To use the library from within F# we will use Feliz.DaisyUI (Github).
-
Open a terminal at
./src/Client
-
Add daisyUI JS dependencies using NPM:
npm i -D daisyui@latest
-
Add Feliz.DaisyUI .NET dependency...
- via Paket:
dotnet paket add Feliz.DaisyUI
- via NuGet:
dotnet add package Feliz.DaisyUI
- via Paket:
-
Update the
tailwind.config.js
file'smodule.exports.plugins
array; addrequire("daisyui")
tailwind.config.jsmodule.exports = { content: [ '.index.html', './**/*.fs', ], theme: { extend: {}, }, plugins: [ require('daisyui'), ], }
-
Open the daisyUI namespace wherever you want to use it.
YourFileHere.fsopen Feliz.DaisyUI
-
Congratulations, now you can use daisyUI components!
Documentation can be found at https://dzoukr.github.io/Feliz.DaisyUI/