Robin Malfait f4291112c5 Class name functions (#257)
* allow className to be a function

Every component that accepts a className should be able to pass in a
function. This function will retrieve the render prop arg for this
component. The function should resolve to a string in the end.

This makes the API a bit nicer if you just need to change the classNames
based on some internal state.

E.g.:

```js
// Before
<Menu.Button as={Fragment}>
  {({ open }) => (
    <button className={open ? 'font-bold' : 'font-normal'}>
      Hello
    </button>
  )}
</Menu.Button>

// After
<Menu.Button className={({ open }) => open ? 'font-bold' : 'font-normal'}>
  Hello
</Menu.Button>
```

* cleanup types

* merge React imports

* update changelog
2021-04-02 15:55:15 +02:00
2021-03-22 15:01:38 +01:00
2021-01-30 14:46:54 +01:00
2021-04-02 15:55:15 +02:00
2020-09-16 18:19:33 +02:00
2020-09-16 18:19:33 +02:00
2021-04-02 15:55:15 +02:00
2020-09-16 18:19:33 +02:00
2021-02-11 19:36:20 +01:00
2020-09-16 18:19:33 +02:00
2021-04-02 15:18:47 +02:00

Headless UI

A set of completely unstyled, fully accessible UI components, designed to integrate beautifully with Tailwind CSS.

Packages

Name Version Downloads
@headlessui/react npm version npm downloads
@headlessui/vue npm version npm downloads
S
Description
Completely unstyled, fully accessible UI components, designed to integrate beautifully with Tailwind CSS.
Readme 6.5 MiB
Languages
TypeScript 95.3%
Vue 4.3%
JavaScript 0.3%
Shell 0.1%