Skip to main content

clsx

Transforms all x-clsx props to className with clsx applied.

export default function App() {
  return (
    <button x-clsx={["bg-blue-500", "text-white"]}>
      Hello
    </button>
  )
}

Installation

npm install react-beyond @react-beyond/clsx

Usage

import { Beyond } from 'react-beyond'
import { classFor } from '@react-beyond/clsx'

<Beyond features={[clsx()]}>
  <App />
</Beyond>

Options

  • id - The id of the feature HOC. Defaults to "clsx".