### Start Demo Application (npm) Source: https://tw-elements.com/docs/standard/getting-started/local-installation Starts the TW Elements demo application. This command requires that dependencies have been installed and assumes Step 1 (repository cloning) has been completed. ```bash npm start ``` -------------------------------- ### Install Bun and Check Version Source: https://tw-elements.com/docs/standard/getting-started/quick-start Ensures Bun is installed and accessible in your environment. This is a prerequisite for using Bun for project management and installations. ```shell bun --version ``` -------------------------------- ### Start Documentation Server (npm) Source: https://tw-elements.com/docs/standard/getting-started/local-installation Launches the local documentation server for TW Elements. This requires Hugo to be installed and dependencies to be set up. It's recommended to run 'npm run build' beforehand. ```bash npm run docs:start ``` -------------------------------- ### Link CSS and Install TW Elements Source: https://tw-elements.com/docs/standard/getting-started/quick-start Links the compiled CSS file in the HTML head and installs the `tw-elements` package using Bun. This makes the TW Elements library available for use in your project. ```html
... ... ``` ```shell bun install tw-elements ``` -------------------------------- ### Create Vite Project with Bun Source: https://tw-elements.com/docs/standard/getting-started/quick-start Initializes a new Vite project using the 'create vite' command with Bun. It selects the 'Vanilla' framework and 'JavaScript' variant, then installs dependencies. ```shell bun create vite my-project cd my-project bun install ``` -------------------------------- ### Install Tailwind CSS and Initialize Source: https://tw-elements.com/docs/standard/getting-started/quick-start Installs Tailwind CSS, PostCSS, and Autoprefixer as development dependencies using Bun. It then initializes Tailwind CSS, creating the `tailwind.config.js` file. ```shell bun install -D tailwindcss postcss autoprefixer bunx tailwindcss init -p ``` -------------------------------- ### Create and Run SvelteKit Application Source: https://tw-elements.com/docs/standard/integrations/sveltekit-integration These commands set up a new SvelteKit project and start the development server. Ensure you have Node.js LTS installed. This snippet uses npm for package management. ```bash npm create svelte@latest my-project cd my-project npm install npm run dev ``` -------------------------------- ### Create Vite Project and Install Dependencies Source: https://tw-elements.com/docs/standard/getting-started/quick-start Initializes a new Vite project using npm and installs Tailwind CSS with its peer dependencies (PostCSS and Autoprefixer). This sets up the basic structure for a modern web application. ```bash npm create vite@latest my-project cd my-project npm install -D tailwindcss postcss autoprefixer npx tailwindcss init -p ``` -------------------------------- ### Publish the Project using MDB CLI (Terminal) Source: https://tw-elements.com/docs/standard/getting-started/quick-start Once your project is ready, this command deploys and publishes your application using the MDB CLI. This makes your project accessible online. ```bash mdb publish ``` -------------------------------- ### Link CSS and Install TW Elements Package Source: https://tw-elements.com/docs/standard/getting-started/quick-start Links the main CSS file (`style.css`) within the `index.html` head and installs the `tw-elements` package using npm. This makes the TW Elements library available for use in the project. ```html ... ... ``` ```bash npm install tw-elements ``` -------------------------------- ### Install MDB CLI Globally (Terminal) Source: https://tw-elements.com/docs/standard/getting-started/quick-start This command installs the MDB GO / CLI tool globally on your system using NPM. This CLI tool allows for creating, deploying, and hosting projects with a single command. ```bash npm install -g mdb-cli ``` -------------------------------- ### Update package.json for Bun Development Server Source: https://tw-elements.com/docs/standard/getting-started/quick-start This JSON snippet modifies the `scripts` section of a `package.json` file to utilize `bunx` for starting the development server and building the project. This allows for faster script execution using the Bun runtime. ```json "scripts": { "dev": "bunx --bun vite", "build": "bunx --bun vite build" } ``` -------------------------------- ### Install Project Dependencies (npm) Source: https://tw-elements.com/docs/standard/getting-started/local-installation Installs all project dependencies listed in the 'package.json' file using npm. Ensure Node.js (LTS) is installed and you are in the project's root directory. ```bash npm install ``` -------------------------------- ### Start Development Server Source: https://tw-elements.com/docs/standard/getting-started/optimization Starts the development server for the project, allowing for live reloading and testing. This is a standard npm script command. ```bash npm start ``` -------------------------------- ### Install Documentation Dependencies (npm) Source: https://tw-elements.com/docs/standard/getting-started/local-installation Installs dependencies specifically required for running the TW Elements documentation. This command should be run after the main project dependencies. ```bash npm run docs:install ``` -------------------------------- ### Run Development Server with Bun Source: https://tw-elements.com/docs/standard/getting-started/quick-start This terminal command initiates the development server for a Vite project using Bun. It ensures that Tailwind CSS is correctly connected and the application is served locally for development. ```bash bun run dev ``` -------------------------------- ### Install Django Source: https://tw-elements.com/docs/standard/integrations/django-integration Installs the Django web framework using pip, the Python package installer, within the activated virtual environment. ```bash pip install django ``` -------------------------------- ### Initialize a New Project with TW Elements using MDB CLI (Terminal) Source: https://tw-elements.com/docs/standard/getting-started/quick-start This command initializes a new project using the MDB CLI, specifically choosing 'tailwind-elements' as the project type. This sets up a new project configured for TW Elements. ```bash mdb init tailwind-elements ``` -------------------------------- ### Install Project Dependencies Source: https://tw-elements.com/docs/standard/getting-started/optimization Installs all the necessary project dependencies listed in the package.json file. This is a standard command for Node.js projects. ```bash npm install ``` -------------------------------- ### Initialize TW Elements Components with initTWE Method (JavaScript) Source: https://tw-elements.com/docs/standard/getting-started/quick-start This snippet demonstrates how to import and use the initTWE method to initialize TW Elements components, such as Input. It shows how to pass options like 'allowReinits' to the initialization method. This is useful for dynamic applications with routing. ```javascript import { Input, initTWE } from "tw-elements"; initTWE({ Input }, { allowReinits: true }); ``` -------------------------------- ### Install remix-utils Source: https://tw-elements.com/docs/standard/integrations/remix-integration Installs the `remix-utils` library, which provides helper components like `ClientOnly` for managing client-side rendering in Remix applications. ```bash npm i remix-utils ``` -------------------------------- ### Install i18next Dependencies Source: https://tw-elements.com/docs/standard/getting-started/internationalization Installs the necessary i18next framework and fetch backend plugin for loading translation resources. Requires Node.js and npm. ```bash npm install --save-dev i18next i18next-fetch-backend ``` -------------------------------- ### Add Carousel Component and Initialize TW Elements Source: https://tw-elements.com/docs/standard/getting-started/quick-start Includes an example of a carousel component in HTML and instructs to call the `initTWE` method in your JavaScript. This demonstrates how to use TW Elements components and initialize them. ```html