Giter VIP home page Giter VIP logo

pandacss-react-aria-components's Introduction

pandacss-react-aria-components

A Panda preset for React Aria Components (RAC) to make styling states of components easier, with autocompleting conditions courtesy of Panda.

Installation

npm i -D pandacss-react-aria-components
# or
yarn add -D pandacss-react-aria-components
# or
pnpm add -D pandacss-react-aria-components

Usage

Add the preset to your panda.config.js file.

import { defineConfig } from "@pandacss/dev";
import racPreset from "pandacss-react-aria-components";

export default defineConfig({
  presets: [racPreset()],
});

With the preset added, you can now access all states easily.

<div className={css({
  _selected: {
    background: "blue.500"
  },
  _disabled: {
    background: "gray.100"
  }
})}>

Options

// default config
export default defineConfig({
  presets: [
    racPreset({
      includePandaPresetBase: true,
      prefix: "",
      includeCombinators: true,
    }),
  ],
});

Panda Preset Base (includePandaPresetBase)

By default, Panda provides conditions of their own within @pandacss/preset-base that overlap with RAC. These conditions can be merged gracefully with RAC, applying conditionally based on whether the element belongs to a RAC component.

Prefix (prefix)

Assign a prefix for the conditions. This will disable merging with @pandacss/preset-base conditions as it is no longer necessary.

Combinators (includeCombinators)

Add new variants for Tailwind-like group and peer combinators, such as _groupFocusWithin and _peerSelected. @pandacss/preset-base provides a few that won't be overridden to support RAC if this is set to false.

Acknowledgements

License

BSD Zero Clause License

Please note the other licenses present within the NOTICE file.

pandacss-react-aria-components's People

Contributors

cgatian avatar kianomg avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

cgatian

pandacss-react-aria-components's Issues

Preset type incompatible with 0.44.0

First issue! ๐Ÿ˜„

Thank you for building out this library!

Looks like the type's changed in Panda CSS where they expect a name in the Preset.

0.41

export interface Preset extends ExtendableOptions, PresetOptions {}

0.44

export interface Preset extends ExtendableOptions, PresetOptions {
  name: string
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.