Skip to main content
@capgo/tailwind-capacitor UI & System Open source

Tailwind Capacitor Capacitor plugin

Install Tailwind Capacitor as a shadcn registry. Copy Vue components and Tailwind v4 safe-area utilities into your project so you own the source.

  • Web · Supported
  • iOS · Supported
  • Android · Supported
Open live component demo

Registry install

Core registry items, then any component slug.

  • bunx shadcn-vue@latest add https://raw.githubusercontent.com/Cap-go/tailwind-capacitor/9791d43d67279d7725d6a1f7865ff10deaf36ba5/public/r/capacitor-tailwind.json
  • bunx shadcn-vue@latest add https://raw.githubusercontent.com/Cap-go/tailwind-capacitor/9791d43d67279d7725d6a1f7865ff10deaf36ba5/public/r/capacitor-provider.json
  • bunx shadcn-vue@latest add https://raw.githubusercontent.com/Cap-go/tailwind-capacitor/9791d43d67279d7725d6a1f7865ff10deaf36ba5/public/r/capacitor-shared.json
  • bunx shadcn-vue@latest add https://raw.githubusercontent.com/Cap-go/tailwind-capacitor/9791d43d67279d7725d6a1f7865ff10deaf36ba5/public/r/capacitor-icons.json
  • bunx shadcn-vue@latest add https://raw.githubusercontent.com/Cap-go/tailwind-capacitor/9791d43d67279d7725d6a1f7865ff10deaf36ba5/public/r/capacitor-button.json

Guide

How to use Tailwind Capacitor in Capacitor

Tailwind Capacitor (shadcn registry)

Tailwind Capacitor ships Tailwind CSS v4 utilities for Capacitor safe areas and platform variants, plus Vue, React, and Angular UI components, as a shadcn registry. You copy source into your app with the shadcn CLI.

Install commands on Capgo track Cap-go/tailwind-capacitor main at commit 9791d43d67279d7725d6a1f7865ff10deaf36ba5 (merge commit for PR #130).

Live component demo

Open the interactive registry demo to preview every registry item with iOS or Material styling and light or dark mode.

Use the framework tabs on the demo page or the docs getting started for Vue (shadcn-vue), React (shadcn), and Angular (registry-add via the tailwind-capacitor package) install commands.

Prerequisites

  • Vue 3 app with Tailwind CSS v4 (@tailwindcss/vite or PostCSS)
  • A project-level components.json from the shadcn-vue CLI (npx shadcn-vue@latest init)
  • Path alias @/* pointing at your src/ folder
  • No tailwind.config.js required

Install base styles

npx shadcn-vue@latest add https://raw.githubusercontent.com/Cap-go/tailwind-capacitor/9791d43d67279d7725d6a1f7865ff10deaf36ba5/public/r/capacitor-tailwind.json
npx shadcn-vue@latest add https://raw.githubusercontent.com/Cap-go/tailwind-capacitor/9791d43d67279d7725d6a1f7865ff10deaf36ba5/public/r/capacitor-provider.json
npx shadcn-vue@latest add https://raw.githubusercontent.com/Cap-go/tailwind-capacitor/9791d43d67279d7725d6a1f7865ff10deaf36ba5/public/r/capacitor-shared.json
npx shadcn-vue@latest add https://raw.githubusercontent.com/Cap-go/tailwind-capacitor/9791d43d67279d7725d6a1f7865ff10deaf36ba5/public/r/capacitor-icons.json

In your app global stylesheet, replace the @import "tailwindcss" line with the capacitor bundle import. Keep your other custom CSS. The bundle already includes Tailwind, so do not keep a separate Tailwind import:

@import '@/capacitor/styles/tailwind-capacitor.css';

Install components used in the example

App, Page, Navbar, and Button are separate registry items. Install each one:

npx shadcn-vue@latest add https://raw.githubusercontent.com/Cap-go/tailwind-capacitor/9791d43d67279d7725d6a1f7865ff10deaf36ba5/public/r/capacitor-app.json
npx shadcn-vue@latest add https://raw.githubusercontent.com/Cap-go/tailwind-capacitor/9791d43d67279d7725d6a1f7865ff10deaf36ba5/public/r/capacitor-page.json
npx shadcn-vue@latest add https://raw.githubusercontent.com/Cap-go/tailwind-capacitor/9791d43d67279d7725d6a1f7865ff10deaf36ba5/public/r/capacitor-navbar.json
npx shadcn-vue@latest add https://raw.githubusercontent.com/Cap-go/tailwind-capacitor/9791d43d67279d7725d6a1f7865ff10deaf36ba5/public/r/capacitor-button.json

Components land under src/capacitor/vue/components/. The provider lands under src/capacitor/vue/shared/. Shared classes land under src/capacitor/shared/. Icons land under src/capacitor/vue/components/icons/.

Vue usage

Import the files that shadcn add writes. The library example app generates @/capacitor/index.js as a convenience barrel. That file is not created when you install registry items into your own project.

Button has no fill prop. The default style is solid. Use the boolean outline or clear props for the other styles.

<script setup>
import TailwindCapacitorProvider from '@/capacitor/vue/shared/TailwindCapacitorProvider.vue'
import App from '@/capacitor/vue/components/App.vue'
import Page from '@/capacitor/vue/components/Page.vue'
import Navbar from '@/capacitor/vue/components/Navbar.vue'
import Button from '@/capacitor/vue/components/Button.vue'
</script>

<template>
  <TailwindCapacitorProvider>
    <App theme="ios" class="safe-areas">
      <Page>
        <Navbar title="Home" />
        <Button>Continue</Button>
      </Page>
    </App>
  </TailwindCapacitorProvider>
</template>

Safe areas

  • Put safe-areas on the root page shell.
  • Use pt-safe, pb-safe, pl-safe, and pr-safe for insets. There is no px-safe utility.
  • Platform variants: ios:, android:, capacitor:, mobile:.

Registry hosting

Built JSON files live in public/r/ (Vue), public/r/react/, and public/r/angular/ on GitHub:

https://raw.githubusercontent.com/Cap-go/tailwind-capacitor/<commit>/public/r/<name>.json

More

FAQ

Tailwind Capacitor plugin FAQ

Is tailwind-capacitor an npm Capacitor plugin?

The v4 registry ships source you add with shadcn. Legacy v1 npm Tailwind plugins still exist for Tailwind v3, but this page tracks the GitHub registry.

Which framework does the live demo use?

The Capgo demo page runs the Vue registry in an isolated shell. Install commands on the demo and docs cover Vue, React, and Angular.

How do I install the Tailwind Capacitor plugin in a Capacitor app?

This is a shadcn registry, not a native Capacitor plugin. Do not run bun add or bunx cap sync. In a Vue 3 app with Tailwind CSS v4 and a project-level components.json, run npx shadcn-vue@latest add with the raw GitHub registry URLs for capacitor-tailwind, capacitor-provider, capacitor-shared, and capacitor-icons, then add components the same way. The Install section on this page has framework tabs for Vue, React, and Angular.

Does @capgo/tailwind-capacitor work with React, Vue and Angular?

The v4 registry ships Vue, React, and Angular components from public/r/, public/r/react/, and public/r/angular/. The Capgo plugin page and docs list pinned install commands for each framework.

Is @capgo/tailwind-capacitor free and open source?

Yes. The source is public on GitHub at https://github.com/Cap-go/tailwind-capacitor/. Vue components install with npx shadcn-vue add; React with npx shadcn add; Angular with registry-add from the tailwind-capacitor package. This version is not published to npm. Bug reports and pull requests are welcome.

Ship Tailwind Capacitor changes without waiting for app review

Once the plugin is in your store build, Capgo live updates push your JavaScript, HTML and CSS changes to users in minutes.

Start with Capgo