TW-Elements README

项目的 README,来自 github.com/mdbootstrap/TW-Elements。合并为一个 markdown 文件:README.md。

TW Elements tw-elementsTotal Downloads Latest Release

TW Elements is a huge collection of free, interactive components for Tailwind CSS.

  • 500+ UI components
  • 117+ design blocks
  • Dark mode support
  • Easy theming & customization
  • Simple, 1 minute install
  • Free for personal & commercial use

Get started with TW Elements now!


Table of Contents


Community

If you want to help the project grow, start by simply sharing it with your peers!

Thank you!


Components

A collection of stunning components made with attention to the smallest details. Forms, cards, buttons, and hundreds of others – in TW Elements you will find all the essential elements necessary for every project.

Datepicker Dropdown Modal
Datepicker Dropdown Modal
Charts Tooltips Carousel
Charts Tooltips Carousel
Accordion Tabs Stepper
Accordion Tabs Stepper
Tailwind CSS Time picker Tailwind CSS Tables Tailwind CSS Navbar
Timepicker Footer Navbar
Tailwind CSS Time picker Tailwind CSS Tables Tailwind CSS Navbar
Alerts Avatar Badges
Tailwind CSS Time picker Tailwind CSS Tables Tailwind CSS Navbar
Button group Buttons Cards
Tailwind CSS Time picker Tailwind CSS Tables Tailwind CSS Navbar
Chips Collapse Gallery
Tailwind CSS Time picker Tailwind CSS Tables Tailwind CSS Navbar
Jumbotron Link List group
Tailwind CSS Time picker Tailwind CSS Tables Tailwind CSS Navbar
Notifications Paragraphs Placeholders
Tailwind CSS Time picker Tailwind CSS Tables Tailwind CSS Navbar
Popover Progress Rating
Tailwind Component Tailwind Component Tailwind Component
Scroll to top Social buttons Spinners
Tailwind Component Tailwind Component Tailwind Component
Timeline Toast Tooltip
Tailwind Component Tailwind Component Tailwind Component
Video Video carousel Checkbox
Tailwind Component Tailwind Component Tailwind Component
File input Input group Login form
Tailwind Component Tailwind Component Tailwind Component
Radio Range Registration form
Tailwind Component Tailwind Component Tailwind Component
Search Select Switch
Tailwind Component Tailwind Component Tailwind Component
Textarea Tables Ripple
Tailwind Component Tailwind Component Tailwind Component
Animations Masks Shadows
Tailwind Component Tailwind Component Tailwind Component
Datatables Lightbox Rating
Tailwind Component Tailwind Component Logo Clouds
Scrollbar Popconfirm More coming soon

Design blocks

Responsive Landing page blocks built with Tailwind CSS. Plenty of design blocks examples such as Teams, services, projects, faq, and many more.

Hero Pricing Call to action
Hero Pricing Call to action
Features Contact News/blog
Features Contact News/blog
Team Tabs Stepper
Team Stats Testimonials
Content Newsletter Projects
Content Newsletter Projects
Headers FAQ Logo Clouds
Headers FAQ Logo Clouds
Headers FAQ Logo Clouds
Banners Mega Menu More coming soon

Integrations

TW Elements integrations with popular technologies.


Installation

NPM
  1. Before starting the project make sure to install Node.js (LTS) and TailwindCSS.

  2. Run the following command to install the package via NPM:

npm install tw-elements
  1. TW Elements is a plugin and should be included inside the tailwind.config.js file. It is also recommended to extend the content array with a js file that loads dynamic component classes:
module.exports = {
  content: ["./src/**/*.{html,js}", "./node_modules/tw-elements/js/**/*.js"],
  plugins: [require("tw-elements/plugin.cjs")],
  darkMode: "class",
};
  1. Dynamic components will work after adding the js file:
<script src="./TW-ELEMENTS-PATH/js/tw-elements.umd.min.js"></script>

Alternatively, you can import it in the following way (bundler version):

import 'tw-elements';
MDB GO / CLI

Create, deploy and host anything with a single command.

  1. To start using MDB GO / CLI install it with one command:
npm install -g mdb-cli
  1. Log into the CLI using your MDB account:
mdb login
  1. Initialize a project and choose Tailwind Elements from the list:
mdb init tailwind-elements-free
  1. Install the dependencies (inside the project directory):
npm install
  1. Run the app:
npm start
  1. Publish when you're ready:
mdb publish
CDN

You can easily test TW Elements by adding CDN scripts to your classic HTML template without the need for installing any packages.

Add the stylesheet files below in the head section:

<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,900&display=swap" rel="stylesheet" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tw-elements/css/tw-elements.min.css" />
<script src="https://cdn.tailwindcss.com"></script>
<script>
  tailwind.config = {
    darkMode: "class",
    theme: {
      fontFamily: {
        sans: ["Roboto", "sans-serif"],
        body: ["Roboto", "sans-serif"],
        mono: ["ui-monospace", "monospace"],
      },
    },
    corePlugins: {
      preflight: false,
    },
  };
</script>

Require the js bundled file right before the body closing tag:

<script src="https://cdn.jsdelivr.net/npm/tw-elements/js/tw-elements.umd.min.js"></script>

TW-Elements (mdbootstrap/TW-Elements)

正在搜索数据库…

这是什么?TW Elements 是一个庞大的免费集合,包含 500 多个 Tailwind CSS 界面组件和 117 多个设计模块(表单、卡片、导航栏、模态框、轮播图等),可以直接放进任何项目中使用。
它是独立的框架,还是 Tailwind 的附加组件?它是基于 Tailwind CSS 构建的组件库,并不是用来替代 Tailwind 的。你可以保留现有的 Tailwind 设置,TW Elements 则在此基础上提供现成的组件和设计模块。
怎样把它添加到我的项目中?TW Elements 宣传自己是“简单的一分钟安装”:你只需把该包(及其 Tailwind 插件)添加到已有的 Tailwind CSS 项目中,就能立即使用 Modal、Carousel、Datepicker、Navbar 等组件。
我需要先配置好 Tailwind CSS 吗?需要。TW Elements 是为 Tailwind CSS 准备的组件集,因此在添加它的组件和类名之前,必须先有一个可以正常运行的 Tailwind 构建环境。
只用 CSS 就能工作,还是也需要 JS?Modal、Carousel、Dropdown、Datepicker 等交互式组件依赖 TW Elements 的 JavaScript,而不只是 Tailwind 类名,所以你需要在 Tailwind CSS 之外,同时引入它的 JS 包。
它支持 React 或 Vue,而不仅仅是原生 HTML/JS 吗?支持。除了核心的原生 JS/HTML 版本,项目还维护 React 和 Vue 版本(体现在其 tailwind-react 和 tailwind-vue 构建中)。
这真的可以免费用于商业用途吗?可以。TW Elements 采用 MIT 许可证,并明确声明可免费用于个人和商业用途。
包含哪些组件和设计模块?500 多个组件,例如 Datepicker、Modal、Carousel、Navbar、Accordion、Tabs、Timepicker、Tooltips 和 Toasts,另外还有 117 多个现成的设计模块,如登录表单和图库等。
它开箱即支持深色模式吗?支持。每个组件都内置深色模式支持,并提供便捷的主题和自定义选项。
它和 Tailwind UI 有什么不同?与 Tailwind UI 收费的组件集不同,TW Elements 完全免费且采用 MIT 许可证,这使它成为最受欢迎的第三方 Tailwind CSS UI 套件之一,在 GitHub 上获得了超过 1.3 万颗星。
大小
79 MB
星标
13.2K
时长
14年
提交 · 90 天