Flowbite 虽然支持各个前端框架集成,但更全面的其实是 tailwind 方式的 html 集成。因为还有更广泛的 laravel、django、fastapi、flask 需要支持,这些只能套 html 模版,再加一点轻 js 就可以了。
Astro 集成
flowbite-astro-admin-dashboard
https://themesberg.github.io/flowbite-astro-admin-dashboard/
Flowbite 是 Tailwind CSS 和 React 的响应式组件库,在设计时考虑了简单性和易用性。它提供了一组可靠的组件,非常适合构建现代 Web 应用程序。
Flowbite 的组件采用移动优先方法构建,可确保您的应用程序看起来很棒,并在所有设备上无缝运行。
该库包括警报、头像、徽章、卡片、下拉列表等组件,使其成为任何项目的多功能选择。
如何使用 Flowbite:
在继续之前,请确保您已安装 Node.js 和 Tailwind 并设置了 React 项目。现在,通过运行以下命令安装 Flowbite:
npm install flowbite
接下来,需要在文件中将 flowbite 作为插件:tailwind.config.js
module.exports = {
plugins: [ require('flowbite/plugin')];
}
现在,将 Flowbite 源路径添加到您的内容数据中:
module.exports = {
content: [
// ...
'node_modules/flowbite-react/**/*.{js,jsx,ts,tsx}',
],
};
最后,转到 Flowbite React 网站并复制所需组件的代码。例如,这是 Flowbite React 组件中的 一张卡片:
<div className="max-w-sm">
<Card imgSrc="https://flowbite.com/docs/images/blog/image-1.jpg">
<h5 className="text-2xl font-bold tracking-tight text-gray-900 dark:text-white">
Noteworthy technology acquisitions 2021
</h5>
<p className="font-normal text-gray-700 dark:text-gray-400">
Here are the biggest enterprise technology acquisitions of 2021 so far, in
reverse chronological order.
</p>
</Card>
</div>