Preferences
A person's preferences, such as light or dark, density or reduced motion, saved on their device and written as data attributes before the first paint, so a saved choice never flashes the default.
npx shadcn add https://kinoui.com/r/preferences.jsonCopy install command
Examples
Appearance settings
Put <Preferences> at the top of the page with the ready-made colour scheme, density, feel, shape and motion preferences, and bind each control to usePreference. Here the card keeps its own, so the rest of the page stays as it is.
Your own preference
Make one with createPreference and style what it wraps by its attribute, here a list or a grid that stays as it was left.
Installation
Copy code
npx shadcn@latest add https://kinoui.com/r/preferences.json- Files
components/kino/preferences.tsx
New to Kino? Installation covers what your project needs first and the @kino namespace.
API reference
Preferences
usePreference
createPreference
Data attributes
Accessibility
- Reduce motion only adds to what the device asks: while the device asks for less motion, the setting is on and can’t be turned off, and its control says why.
- A changed colour scheme switches every colour at once, with no fade, while a press or a highlight in motion finishes.
- A saved choice is on the page before it paints, so a dark theme never flashes light and a control never slides to its saved value on load.
useMotionTransitionreadsdata-motionon<html>; a nesteddata-motion="reduce"reduces CSS only.