` which will make the generate CSS from UnoCSS failed to match the attributes. To solve this, you might want to try [`transformer-attributify-jsx`](https://github.com/unocss/unocss/tree/main/packages/transformer-attributify-jsx) along with this preset.
### Properties Conflicts
If the name of the attributes mode ever conflicts with the elements' or components' properties, you can add `un-` prefix to be specific to UnoCSS's attributify mode.
For example:
```html
This conflicts with links' `text` prop
Text color to red
```
Prefix is optional by default, if you want to enforce the usage of prefix, set
```ts
presetAttributify({
prefix: 'un-',
prefixedOnly: true, // <--
})
```
You can also disable the scanning for certain attributes by:
```ts
presetAttributify({
ignoreAttributes: [
'text'
// ...
]
})
```
## TypeScript Support (JSX/TSX)
Create `shims.d.ts` with the following content:
> By default, the type includes common attributes from `@unocss/preset-uno`. If you need custom attributes, refer to the [type source](https://github.com/antfu/unocss/blob/main/packages/preset-attributify/src/jsx.ts) to implement your own type.
### Vue
Since Volar 0.36, [it's now strict to unknown attributes](https://github.com/johnsoncodehk/volar/issues/1077#issuecomment-1145361472). To opt-out, you can add the following file to your project:
```ts
// html.d.ts
declare module '@vue/runtime-dom' {
interface HTMLAttributes {
[key: string]: any
}
}
declare module '@vue/runtime-core' {
interface AllowedComponentProps {
[key: string]: any
}
}
export {}
```
### React
```ts
import type { AttributifyAttributes } from '@unocss/preset-attributify'
declare module 'react' {
interface HTMLAttributes
extends AttributifyAttributes {}
}
```
### Vue 3
```ts
import type { AttributifyAttributes } from '@unocss/preset-attributify'
declare module '@vue/runtime-dom' {
interface HTMLAttributes extends AttributifyAttributes {}
}
```
### SolidJS
```ts
import type { AttributifyAttributes } from '@unocss/preset-attributify'
declare module 'solid-js' {
namespace JSX {
interface HTMLAttributes extends AttributifyAttributes {}
}
}
```
### Svelte & SvelteKit
```ts
import type { AttributifyAttributes } from '@unocss/preset-attributify'
declare global {
namespace svelte.JSX {
interface HTMLAttributes extends AttributifyAttributes {}
}
}
```
### Astro
```ts
import type { AttributifyAttributes } from '@unocss/preset-attributify'
declare global {
namespace astroHTML.JSX {
interface HTMLAttributes extends AttributifyAttributes { }
}
}
```
### Preact
```ts
import type { AttributifyAttributes } from '@unocss/preset-attributify'
declare module 'preact' {
namespace JSX {
interface HTMLAttributes extends AttributifyAttributes {}
}
}
```
### Attributify with Prefix
```ts
import type { AttributifyNames } from '@unocss/preset-attributify'
type Prefix = 'uno:' // change it to your prefix
interface HTMLAttributes extends Partial, string>> {}
```
## Credits
Initial idea by [@Tahul](https://github.com/Tahul) and [@antfu](https://github.com/antfu). Prior implementation in Windi CSS by [@voorjaar](https://github.com/voorjaar).
## License
MIT License © 2021-PRESENT [Anthony Fu](https://github.com/antfu)