🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@kobalte/tailwindcss

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kobalte/tailwindcss

A TailwindCSS plugin for styling Kobalte components with data-* attributes by using modifiers like ui-expanded:*

0.9.0
latest
Source
npm
Version published
Weekly downloads
1.5K
30.52%
Maintainers
1
Weekly downloads
 
Created
Source

@kobalte/tailwindcss

A TailwindCSS plugin for styling Kobalte components with data-* attributes by using modifiers like ui-expanded:*.

Installation

npm install -D @kobalte/tailwindcss
# or
yarn add -D @kobalte/tailwindcss
# or
pnpm add -D @kobalte/tailwindcss

Usage

Add the plugin to your tailwind.config.js:

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [],
  theme: {
    extend: {},
  },
  plugins: [
    // default prefix is "ui"
    require("@kobalte/tailwindcss"),

    // or with a custom prefix:
    require("@kobalte/tailwindcss")({ prefix: "kb" }),
  ],
};

Style your component:

import { Popover } from "@kobalte/core";

export const MyPopover = () => (
  <Popover>
    <Popover.Trigger class="ui-disabled:bg-slate-100">Open</Popover.Trigger>
    <Popover.Content class="ui-expanded:shadow-md">...</Popover.Content>
  </Popover>
);

You can use the following modifiers:

ModifierInverse modifier
ui-validui-not-valid
ui-invalidui-not-invalid
ui-requiredui-not-required
ui-disabledui-not-disabled
ui-readonlyui-not-readonly
ui-checkedui-not-checked
ui-indeterminateui-not-indeterminate
ui-selectedui-not-selected
ui-pressedui-not-pressed
ui-expandedui-not-expanded
ui-highlightedui-not-highlighted
ui-currentui-not-current
ui-placeholder-shownui-not-placeholder-shown

It's also possible to use inverse modifiers in the form of ui-not-*, group and peer modifiers in the form of ui-group-* and ui-peer-*.

Documentation

For full documentation, visit kobalte.dev.

Acknowledgment

This plugin is an adaptation of @headlessui/tailwindcss, MIT Licensed, Copyright (c) 2020 Tailwind Labs.

Changelog

All notable changes are described in the CHANGELOG.md file.

Keywords

solid

FAQs

Package last updated on 20 Oct 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts