# knobs > knobs is a dev-only panel inside the page that shows your site on an iPhone or a Pixel, tomorrow morning, in Arabic or in dark mode. It emulates devices, locales, time, color schemes, network and motion settings from inside the page. Grab hands a coding agent an element with its html, components and source places, and an agent api lets a browser tool drive the knobs. A Chrome extension puts the same panel on any site and sets some knobs for real. - [npm](https://www.npmjs.com/package/@vinena/knobs): the @vinena/knobs package - [Chrome Web Store](https://chromewebstore.google.com/detail/knobs/cpdmafeojnbdnnhldafobkaajiemcidj): the knobs extension - [GitHub](https://github.com/vinenastudio/knobs): the source of the package, the extension and this site ## Reference: start Install @vinena/knobs, mount it in development only, and load the early script where the page needs it. knobs is a dev-only panel for flipping browser preferences from inside the page. one script tag and the knobs are there. no css to add, no code to change. zero runtime dependencies. ### two ways to use it - **the npm package, in your app.** you add `@vinena/knobs` to the project and mount it in development only. the knobs are emulated inside the page, in any browser. the rest of this page sets it up. - **the chrome extension, on any site.** it puts the same panel on every page you open, with some knobs set for real by the browser, no code changed. see [chrome extension](https://knobs.dev/docs/extension). ### install with an ai agent: paste this setup prompt into claude code, codex or cursor, and it installs @vinena/knobs and mounts it in development only. it is the copy installation prompt button on the home page and at the top of /docs/start too. ``` Read https://knobs.dev/llms-full.txt first: it is the full knobs reference. Then install @vinena/knobs in this project. It is a dev-only panel that emulates browser preferences from inside the page. 1. Detect the package manager from the lockfile and add @vinena/knobs as a dev dependency (npm i -D @vinena/knobs, or the pnpm, yarn or bun equivalent). 2. Mount it once, on the client, in development only: - Next.js: make a small client component (the file starts with "use client"). In it, import dynamic from "next/dynamic", then const Knobs = process.env.NODE_ENV === "development" ? dynamic(() => import("@vinena/knobs/react").then((m) => m.Knobs), { ssr: false }) : null; and render {Knobs && }. Render that component once in app/layout (App Router) or pages/_app (Pages Router). - Everything else with a bundler (Vite, TanStack Start, React Router, SvelteKit): call if (import.meta.env.DEV) import("@vinena/knobs").then(({ mount }) => mount()); in the client entry, or in a mount effect of the root component in an SSR app. Use the bundler's own dev flag where import.meta.env.DEV does not exist. - A plain page with no bundler: skip the npm install and add to the page. It mounts itself. Keep it out of the deployed page. 3. Keep knobs out of production builds. A static import stays in the bundle even behind a dev check, so gate the import itself as above. If the project has a build script, run it and check that the output has no knobs. 4. If the app reads media queries, the time or the user agent while it boots, or renders with React, add the early script as the first element in , in development only: 5. Change nothing else in the project for the setup. 6. Open the app in your browser tool, such as Playwright or the Chrome DevTools MCP, and drive window.knobs (or window.devknobs where window.knobs is not knobs' api). For each check, call window.knobs.reset(), then window.knobs.setState(), then await window.knobs.ready(). Check a phone ({ device: "iphone-17" }), dark mode ({ scheme: "dark" }) and a right-to-left language ({ locale: { lang: "ar", dir: "rtl" } }). The locale knob can reload the page, so wait for the load. window.knobs.grab() what breaks, fix it and check again. Then call window.knobs.reset(). 7. Then tell me what you changed, what you fixed and how to open the panel: press Shift+K or click the handle on the right edge of the window. In the open panel, / searches the knobs. Shift+G grabs an element. ``` or by hand: ```sh npm i -D @vinena/knobs ``` then add the mount line with one command, in a next or vite project. it changes the code for development only: ```sh npx @vinena/knobs init ``` ### usage three ways in. all of them are meant for dev only, so gate them yourself. script tag: ```html ``` the global build mounts itself on load and puts the api on `window.knobs`. import: ```js import { mount } from '@vinena/knobs'; if (import.meta.env.DEV) mount(); ``` react, one element: ```jsx import { Knobs } from '@vinena/knobs/react'; export function Root({ children }) { return ( <> {process.env.NODE_ENV === 'development' && } {children} ); } ``` `Knobs` is a client component. it mounts the knobs on the first effect, unmounts them on cleanup, and renders nothing. a static import stays in the production bundle even behind that check, because the bundler still has to keep the module. in next.js, gate the import itself: ```jsx 'use client'; import dynamic from 'next/dynamic'; const Knobs = process.env.NODE_ENV === 'development' ? dynamic(() => import('@vinena/knobs/react').then((m) => m.Knobs), { ssr: false, }) : null; export function DevPanel() { return Knobs && ; } // render once in app/layout or pages/_app ``` once it is mounted, press `⇧K` or click the handle on the right edge of the window to open the panel. see [the panel](https://knobs.dev/docs/panel). ### the api `mount(options?)`, `unmount()`, `getState()`, `setState(patch)`, `reset()`, `replay()`, `grab(elements, options?)`, `describe()`, `ready()`, `PRESETS`. `replay()` is what the panel calls replay animations. `describe()` and `ready()` are for agents, see [agents](https://knobs.dev/docs/agents). ```js setState({ scheme: 'dark' }); setState({ geo: { preset: 'tokyo' } }); setState({ geo: { error: 'denied' } }); setState({ timeZone: 'Asia/Kathmandu' }); setState({ clock: { mode: 'frozen', at: Date.parse('2026-12-24T18:00') } }); setState({ clock: { mode: 'offset', speed: 60 } }); setState({ network: { online: 'offline' } }); setState({ device: 'iphone-16-pro', orientation: 'landscape' }); setState({ width: 390, height: 844 }); setState({ locale: { lang: 'ar' } }); setState({ ua: { preset: 'iphone-safari' } }); ``` state lives in `sessionStorage` under `devknobs` and `knobs`, so it survives reloads and dies with the tab. pass `mount({ persist: false })` to keep it in memory. ### options `mount()` and `` take the same options: | option | default | what it does | | ----------- | --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `hotkey` | `k` | letter that with shift toggles the panel. a key set in the panel wins, see [shortcuts](https://knobs.dev/docs/panel) | | `open` | the stored state, closed at first | start the panel open or closed | | `persist` | `true` | keep the knobs in `sessionStorage` | | `state` | none | knobs to apply on top of the stored state | | `grab` | `true` | press a key to grab elements, see [grab](https://knobs.dev/docs/grab) | | `grabKey` | `shift+g` | the key that grabs, such as `alt+shift+g`. a key set in the panel wins | | `grabColor` | the stored one, `auto` at first | the color of grab's boxes: `auto`, `blue`, `green`, `pink`, `orange`, `purple`, `cyan`, or a hex of your own such as `#ff8c00` | | `handle` | `true` | show the handle on the window's edge while the panel is closed. a choice made in the panel's settings wins, see [settings](https://knobs.dev/docs/panel) | | `native` | none | a host that sets knobs for real, such as a browser extension. see [the native option](https://knobs.dev/docs/start) below | | `host` | `false` | mount as the page's host, as the knobs extension does. a copy the page mounts after it puts up no panel of its own: it hands over its `hotkey`, `grabKey`, `grab`, `open` and `grabColor`, its api calls, such as `setState`, go to the host, and its `unmount()` leaves the host's panel. without a host, a second copy, such as a dev server's hot update loads, takes over from the first | #### the native option `native` is for a host that sets knobs for real, such as a browser extension: `{ text, offline, media, viewport, ua }`, each a function. a knob it has a function for leaves the page alone and goes to it, with each new value: - `text` gets the size in px or `system`. - `offline` gets a boolean. - `media` gets the `scheme`, `motion`, `contrast` and `transparency`. - `viewport` gets `{ width, height, dpr, mobile, touch, touchPointer }` (a side or the ratio `null` for the window's own) for a size or a device with nothing drawn around the page, in place of the frame, and `null` otherwise: a device's body or browser, a foldable, a vision filter, a zoom, the frame knob or a docked panel keep the frame as ever. - `ua` gets the browser the page's requests go out as, `{ userAgent, platform, mobile, brands, uaPlatform, hints }` from the ua knob or a device's browser, or `null` for the browser's own, with the switch below off too. the page's `navigator` keeps knobs' patches either way, and a promise it returns holds the frame's next load until it settles, so the server sees the new one. unmount hands each its default. such a host hides the user's own scheme and motion from the panel as well, so it reads them where its knobs do not reach and passes them to `setSystemMedia({ scheme, motion })` (`light` or `dark`, `reduce` or `no-preference`), which the panel and grab then take in place of their media queries; `null` goes back to those. with a `setting`, `{ label, hint, change }`, the panel's settings show a switch under the handle's, on at first, that turns the driver off and on, every knob kept: off, the driver is handed its defaults and knobs emulates its knobs in the page, as with no driver. `change(on)` hears the user's choice for the host to keep, and `setNative(on, note)` hands one back, `note` showing in place of the hint (such as why it went off) until `null`. `refused(url)` is asked each time the frame's page refuses to load, with the address the frame was given, and resolves to `{ why, details, retry }` or `null`: `why` is a line under the notice, `details` what its "copy details" button copies, and `retry`, `{ label, run, now }`, a button that runs `run` and then loads the frame again, at once with no press when `now` is true. `framed(open)` hears the frame open, before its first load, and go; a promise it returns as the frame opens holds that load until it settles. ### early script optional. a page that reads a media query or the time while it boots, before knobs mounts (a theme script, a module that checks `prefers-reduced-motion` once, a store that stamps `Date.now()`), only sees the knob if the patch is already in place. put the early script first in ``: ```html ``` it is also `@vinena/knobs/early` in the package. what it does: - it applies the stored scheme, motion, contrast and transparency on the spot, and in a device's frame its pointer and hover, with no panel: the `matchMedia` and `matches` patches, `color-scheme` on ``, and the stylesheet rewrite as sheets arrive. - it sets the stored clock the same way, through `Date` and `Temporal.Now`, and the stored user agent on `navigator`, so a page that sniffs it while it boots sees the preset. - it puts a React devtools hook in place for [grab](https://knobs.dev/docs/grab), when the page has none, so React reports to it from its first render. - before all of that it sets what the [storage presets](https://knobs.dev/docs/requests-and-storage#presets) marked apply on load hold, so the page's own scripts start with them. the full script, however it is loaded, takes those patches over when it mounts instead of patching on top, and lists made in between still get their change events. a `Date` the page kept in between follows the clock still. it covers the media knobs, the clock and the user agent only, and since it reads the stored state, it follows the knobs from the next load on. inside a frame that gets the scheme natively, it leaves the scheme to the browser, as the full script does. when the stored knobs put the page in a frame, the early script also hides the page under the frame's mat from the first paint, so a reload never shows it full width while knobs loads. the frame as the last page left it (the mat, the case and the phone's browser, its screen blank in the page's color) is kept in `sessionStorage` as the page unloads, and put back as it was, when the device, the way it is held and the window's size are the same. otherwise the bare mat stands in. the full script takes it over without a jump, and the screen shows the page loading as Safari does a reload. without knobs after 3 seconds, the page shows again. ## Reference: the panel How the knobs panel opens, moves, lists its knobs, searches, docks to the side of the window and takes its keys. ### opening and moving it the panel starts closed, as a handle on the right edge of the window, 128px below its top, and opens from that height. a window too short for that has the panel rise until it fits. click it or press shift and the hotkey (`⇧K`) to open it, and it stays open across reloads. opening it puts the focus on its add knob button, where typing a knob's name opens the search with it, so `⇧K` then `dark` works in one go, and closing it gives the focus back to what had it before. a panel that comes back open after a reload leaves the focus on the page. drag the handle to move the panel and the handle together up and down the edge of the window. hold shift while dragging to move the handle alone along the panel. with the panel closed, a drag moves the handle, and the panel opens beside it where it left it. drag the panel's edge on the page's side to change its width, which is kept in `localStorage` under `devknobs:prefs` and `knobs:prefs`. the panel has one width: the rows, the settings and every view, such as inspect's elements, the requests and the storage, show at it, so opening or leaving a view never changes it. the handle follows the pointer sideways too. let go past the middle of the window, or fling it toward the other edge, and the panel moves to the left or the right edge; anywhere else it glides back to its own. each time you let go of it, its side and where it sits on it are also kept in `localStorage` under `devknobs:place` and `knobs:place`, so a new tab starts with the panel where you last put it. a tab you did not drag in never writes it. within 24px of an edge, the panel snaps flush with the top or the bottom of the window, and the handle with the top or the bottom corner of the panel, or of the window while the panel is closed. each stays with the edge it snapped to: a panel at the bottom grows upward as rows and editors open, and keeps to the bottom when the window resizes. ### rows the panel lists the knobs that are off their default, one row each, with related knobs together: the device row holds the device, its mock, touch pointer, browser, bars, edge to edge and user agent, the viewport row the width, device pixel ratio, zoom and frame, and the time row the clock with its mode, speed, time zone and server header. the rows stand by group: look (scheme, contrast, transparency, vision, text), motion, locale, location, time, network, device, viewport and debug. a control that does nothing yet stays out of its editor until it does: the clock's mode, speed and "send to server" show once a time is set, the speed only while the clock runs, and zoom and mat once the frame is up. their values stay as set, the row's summary leaves them out while they wait, and search sets them all the same. the clock's "now" readout shows once a time is set, and the time zone's "in use" note only while it follows geo. a fresh session starts with four rows at their defaults, in this order: the device, scheme, text and locale. a row added from the panel goes to the bottom of the list. the `×` of the device row takes the size and device pixel ratio the device brought along with it. that size and ratio are the device row's, so the viewport row lists only for a value set on it, and its `×` leaves the device as it is, its own pixel ratio included. click a row to open its editor in place under it, pushing the rows below it down, and click it again to close it. one editor is open at a time. a click on `×` puts that row back to its default and keeps it in the list; holding `×` for a second, or holding enter or space on it, takes the row off, with a fill growing across the `×` while you hold. a knob named the same as its row shows no label of its own under the row's title. a row set or added from the panel stays in the list, at its default too, until a hold on its `×` takes it off, for the session, and reset all puts every knob back to its default and the four rows back in the list, in their order. with every row taken off the panel says nothing emulated, over the add knob button. drag a row by the six dots at its leading edge, which show on hover and focus and always on a touch screen, to put it elsewhere in the list. with the dots focused, the up and down arrows move the row a place. the order is kept with the rest of the session. ### search the rows stay on top. the add knob button under them opens a field in its place that finds knobs and values, and the results show under the field, the rows and the results each scrolling in its own room. type `dark`, `390`, `+2d`, `tr`, `tokyo`, `rtl`, `pause` or `offline` and enter sets the first result and shows its row. a value typed out in full works too: `500` for a width, `3d` for the clock, `pt-BR`, `Europe/Paris`, or `36.9, 30.7` for a position. a knob's name adds its row and opens its editor, with no value to set, and with nothing typed the list shows every knob by category. arrows move through the results. a value or knob picked adds its row at the bottom, if it is not listed yet, and gives it the focus. escape leaves the search, query and all, back to the add knob button, then closes an open editor, and then the panel. a click anywhere outside the search and its results, or on the `×` at its end, leaves it too. with the focus on any of the panel's buttons, typing a character opens the search with it typed in. ### keys while the panel is out and the focus is in no field: - `/` opens the search - `⇧R` replays the page's animations - `⇧N` shows the [requests](https://knobs.dev/docs/requests-and-storage#requests), and opens the panel for them where it is closed; pressed again while they show, it leaves them - `⇧S` shows the [storage](https://knobs.dev/docs/requests-and-storage#storage) view, and opens the panel for it where it is closed - `⇧E` shows inspect's [elements view](https://knobs.dev/docs/grab#inspect), the DOM tree and the styles, on the element inspect last picked, else the page's body, without picking; it opens the panel where it is closed, and pressed again while the view shows, it leaves it - `⇧O` shows the [settings](https://knobs.dev/docs/panel), with the shortcuts, and opens the panel for them where it is closed; pressed again while they show, it leaves them - shift backspace (or shift delete) resets every knob, from the frame too while the frame is up, meta or ctrl with `+` and `-` zoom it a step in and out, and with `0` fit it again, from the frame too, unless the focus is in a field. every other key goes to the page as it would without the panel. `⇧K` toggles the panel everywhere except in a field of the page, where shift types a capital as ever. in the panel's search, which finds in lower case anyway, `⇧K`, `⇧R`, `⇧N`, `⇧S`, `⇧E`, `⇧O`, `⇧G` and `⇧C` are the panel's keys and are not typed, so `⇧K` closes the panel from it, and a plain `k` is just a letter. the panel's other fields, a list's filter and the user agent and route boxes, take every letter. the footer lists the keys, most used first: `⇧K` for the panel, `/` for search, the grab key, the inspect key, `⇧R` for replay animations and `⇧⌫` for reset, as `Shift K`, `Shift R` and `Shift Backspace` off a Mac. each one is a button too, so a click does what its key does. with the overflow knob on, the count of overflowing boxes sits above them. the panel keeps the real color scheme and motion preference of the browser, whatever the knobs emulate for the page. ### pinning the pin button in the footer, before the gear, docks the panel to its side the way devtools dock: a column from the top of the window to the bottom, flush with the edge, with the rows using the whole height and the footer at the bottom. the settings and a feature's view fill the column the same way, and scroll in it. the pin panel action in the search does the same, and unpin, the same button or action, makes it the floating panel again, where it was. the page gets narrower, for real. it runs in a same-origin frame, the one the width knob uses, that fills the window less the panel, so the viewport itself ends where the panel starts: media queries, `100vw`, and `position: fixed` and `sticky` boxes all follow, which a margin on the page could not give. the window's address still follows the page, and reloads, grab and every knob work as they do in any frame. with no device and no width set, that frame is the page and nothing else: no mat, no readout, no zoom. with a device or a width set, the mat simply ends where the panel starts, and the device is fitted in what is left. pinning loads the page once more when no frame is up yet, like picking a width, and unpinning hands the window its own page back, at the address the frame was on. with a device or a width set already, pinning and unpinning only change the room, and nothing loads. closing a pinned panel (`⇧K`, or the close button by the pin) gives the page the whole window back and keeps the frame, so opening and closing never load anything either. closed, the handle is where it always is. the panel starts 320px wide and goes from 240px to 720px, or less in a narrow window. a width you set is kept, and a double click on the edge puts it back to 320px. open, the pinned panel has no handle out on the page. its edge on the page's side changes its width, as a floating panel's does: drag it, double click it, or focus it and press the arrows. two buttons show by the pin while the panel is pinned: one moves the column to the other side of the window, which the move panel across action in the search does too, and one closes the panel. it is one column, as wide as the panel is, whatever the panel shows. the page's frame follows that width with no load. under a drag it follows the edge, once a frame. it follows the column the same way whenever the column moves on its own: as the panel opens and closes, and as it glides to a new width from the edge's keys, the page's edge is the column's edge in every frame, so the page lays out as it shrinks and grows. taken to the other side, the column crosses over the page while the page slides across, as wide as it was. a page too slow to keep up (two frames in a row over 50ms) takes its final width at once, and so does every page when the system asks for reduced motion. the page never gets narrower than 320px, so the edge stops there. in a window too narrow to leave it that beside the panel (under 640px for a panel 320px wide), the panel lies over the page instead, and the pin's tooltip says so. the pin is kept with the panel's place, in `localStorage` under `devknobs:place` and `knobs:place`, so a new tab starts pinned too. reset all leaves it, as it leaves the side. ### settings the gear button at the end of the footer opens the settings, in place of the rows. the show handle switch there hides the handle while the panel is closed, so nothing of knobs sits on the edge of the page; the panel key (`⇧K`) still opens it, and an open panel shows its handle as ever, to drag it or click it closed. turning the switch off says which key brings the panel back. the choice is kept in `localStorage` under `devknobs:prefs` and `knobs:prefs`, for every tab of the origin, and wins over the `handle` option. reset all leaves it. the dev tab icon switch draws a yellow `DEV` ribbon on every icon link of the page, the apple touch icon too, from the icon's own picture. an icon the page cannot read, from another origin that does not allow it (CORS), keeps its own picture, and below 32px the ribbon has no `DEV` text. it is `panel.devIcon`: `auto`, the default, shows it on a local host only (localhost, `*.localhost`, `*.local`, `0.0.0.0`, a loopback or private network address), `on` on any host, `off` on none, and it holds for this tab. turned off, or with knobs unmounted, every link has its own address back. the real phone mode switch shows only with a host that sends requests as another browser, the extension. on, the device's user agent and client hints go with the frame's own page loads, so a site serves its mobile site; the page around the frame, its service worker and other tabs keep the real browser. some sites may sign you out, as they see one session as two browsers. it is `panel.realPhone`, off by default, one setting for every tab and site, which the host keeps (`native.realPhone`). see [what servers see](https://knobs.dev/docs/extension). ### shortcuts the panel, grab, inspect, replay, requests, storage, elements, settings and reset keys above are the defaults, and each can be set from the panel: the settings list them under shortcuts, click one and press the new key, esc to cancel. - any key or combination works, a key alone too, such as `c`, or `⇧C`. a key alone acts only when no field has the focus, the panel's search included, so it never takes what is typed. F1 to F12 type nothing, so they act in fields too. - where the `hotkey` or `grabKey` option takes `⇧E` or `⇧O`, the elements view takes `⇧L` (then `⇧D`) and the settings `⇧U` (then `⇧P`), as inspect takes `⇧I` where `⇧C` is taken. - the browser's own keys (meta or ctrl with c, v, x, z, a, w, r, t, q, l, n, f, p, s, h, m, a digit or the zoom keys, F5, F11, F12), `/` and a key another shortcut has are refused, with the reason under the row. - a key with shift alone, like the defaults, is the panel's in its search and the page's in a field of the page, and so is one with alt, ctrl or meta; a function key works in fields too. - a grab key with meta, ctrl or alt turns grab on with a hold, as [grab](https://knobs.dev/docs/grab) explains, and any other with a press. the keys set are kept in `localStorage` under `devknobs:keys` and `knobs:keys`, for every tab of the origin, the width knob's frame included at once, and win over the `hotkey` and `grabKey` options. reset all leaves them; the x by a key puts that one back. the extension keeps them in its own storage instead, the same on every site: see [the extension](https://knobs.dev/docs/extension). ### fresh mode to see the page and the panel as a first visit does, add `knobs=fresh` to the address: ``` http://localhost:3000/?knobs=fresh ``` while it is on, knobs leaves `localStorage` alone: the panel's place, its settings and the keys read as their defaults, nothing is written, and what was kept there is back as soon as the parameter goes. every load of the page starts with no knobs set, a reload too. the knobs still hold inside a visit and in the frame, and across the two loads knobs asks for itself: the locale knob's reload, and the frame handing the address it went to back to the page as it goes. the parameter stays in the address while the frame navigates, so that load and a reload after it are in fresh mode too. the footer says `fresh mode: nothing is kept`. it needs no change in the code, and works with the script tag, the import, the react component and the early script. a locale kept by the page in `localStorage` does not follow the locale knob while it is on. ## Reference: knobs Every knob knobs has, the values it takes and exactly how each one is emulated in the page. every knob, the values it takes and how it is emulated. the panel lists them by group; search finds them by name or value, see [the panel](https://knobs.dev/docs/panel). ### the knobs | knob | values | how it is emulated | | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | color scheme | light, dark, system | rewrites every `prefers-color-scheme` media rule in the page's own stylesheets, patches `matchMedia` and `MediaQueryList.prototype.matches` so js reads the same value, and sets `color-scheme` on `` so `light-dark()` flips too. in the frame the browser does it natively, see [the frame](https://knobs.dev/docs/knobs) | | reduced motion | reduce, system | rewrites `prefers-reduced-motion` media rules and patches `matchMedia` the same way | | animation speed | 1, 0.25, 0.1, pause | sets `playbackRate` (through `updatePlaybackRate`, so nothing jumps) on every animation `getAnimations()` returns, css animations and transitions included, in the document and every open shadow root. new ones are taken as they start: `animationstart` and `transitionrun` listeners, a patched `Element.prototype.animate`, and a light sweep every frame while the knob is off 1. scroll-driven animations keep following the scroll. when `window.gsap` exists, its global timeline's `timeScale` follows too. back to 1, every rate goes back to what it was | | contrast | more, system | rewrites `prefers-contrast` media rules and patches `matchMedia` the same way | | reduced transparency | reduce, system | rewrites `prefers-reduced-transparency` media rules and patches `matchMedia` the same way. a browser that does not know the feature drops those rules while it parses them, so there only `matchMedia` follows the knob | | locale | any bcp 47 tag, plus a direction | sets `lang` and `dir` on `` and puts them back if the page writes them over, patches `navigator.language` / `navigator.languages`, and makes the tag the default locale of every `Intl` service, the `toLocaleString` family and `localeCompare` (a call that names its own locale keeps it). direction comes from `Intl.Locale` text info, with ar, he, fa and ur as the fallback. also writes the tag into the stores i18n libraries read and reloads when it changes: the paraglide cookie always, paraglide and i18next local storage, the i18next session key and cookie when the page has them, and `NEXT_LOCALE` on next.js pages. back to system, each store gets its old value, unless the page changed it since | | pseudo | on, off | rewrites the page's text and its `placeholder`, `title`, `aria-label` and `alt` attributes to accented, padded, bracketed strings (`[Ŝéţţîñĝš ···]`), once the page is loaded and idle so hydration never sees it. new and changed text follows. skips scripts, styles, textareas, contenteditable and options without a value, whose text is what their form sends. text the page reads back and writes again stays one layer deep. off puts the originals back, in nodes the page detached since too | | geolocation | a city preset, custom coordinates, a route, system | patches `navigator.geolocation`. answers come a task later, `maximumAge` can hand back the last position and `timeout: 0` without one fails like a real device. active watches hear every knob move, and `clearWatch` stops them. a route takes `lat,lng` per line or a pasted gpx file and plays it on a loop at a set speed, with `heading` and `speed` in the coordinates and a new position for watches every second | | geo error | none, denied, unavailable, timeout | calls the error callback with an error that reads like `GeolocationPositionError` (`code`, `message`, the code constants). timeout waits for `options.timeout`, and never fires without one, like a fix that never comes. works with geo on system too. `navigator.permissions.query({ name: "geolocation" })` reports granted, or denied for denied, and fires `change` when the knob moves | | time zone | follow geo, system, an iana zone | follows the geo preset's zone unless set. replaces the page's `Date`: local getters and setters, `getTimezoneOffset`, `new Date(y, m, d, ...)`, `Date.parse` and `new Date(string)` for strings with no zone of their own, `toString`, `toDateString`, `toTimeString` and `toLocale*String` all use the emulated zone, with gaps and overlaps resolved the way browsers do. utc methods, `toISOString` and `toJSON` are untouched, and `instanceof Date` holds for dates made before. also patches `Intl.DateTimeFormat` (so `resolvedOptions().timeZone` reports the zone) and `Temporal.Now` where the browser has it. with the locale knob set too, a formatter or `toLocale*String` call that names neither gets both the knob's locale and its zone | | clock | system, +1h to +30d, a date and time, offset or frozen, speed 1, 60, 3600 | `Date.now()`, `new Date()` and `Date()` read the clock, and so do `Temporal.Now.instant()` and the zoned and plain readers. offset runs on from the set instant at its speed, frozen stays there. a date built from an argument (`new Date(ms)`, `new Date(y, m, d)`, a string) names its own instant and is left alone. one `Date` proxy serves this knob and the time zone knob, and either can go first or come off first. the presets count from the real now. the clock is stored as the instant it was set to and the real time it was set at, so a reload carries on where it was and the frame reads the same time. `setState({ clock: { at } })` takes epoch ms and stamps that real time itself. durations keep real time, see [limits](https://knobs.dev/docs/limits) | | online | offline, system | mimicry only: `navigator.onLine` reads false and `online` / `offline` fire on `window`. requests still succeed | | connection, save data | slow-2g, 2g, 3g, 4g / on, off, system | mimicry only, and chromium only: `navigator.connection` reports the effective type with a matching `rtt` and `downlink`, and `saveData`, and fires `change`. nothing is throttled | | text size | px, system | emulates the browser's default font size setting. a root `font-size` in %, em, rem or a keyword, or none at all, is taken against the knob's size (62.5% at 20 gives 12.5px), and a px root size is left alone, as the real setting does. em and rem in media queries and `matchMedia` move with it | | text spacing | on, off | applies the wcag 1.4.12 text spacing values: line height 1.5, letter spacing 0.12em, word spacing 0.16em, 2em after paragraphs | | viewport width | px, full | renders the page in a same-origin iframe of that width, so media queries, fixed elements, `vw` units and container queries all see a real viewport. the other knobs follow the page into the frame. a width wider than the window is scaled down to fit, see zoom below. back to full, the window goes wherever the frame navigated | | viewport height | px, full | makes the frame that tall, centered in the window both ways, so `innerHeight`, `100vh`, `svh`, `dvh` and height media queries see it. a frame taller or wider than the window is scaled down to fit both ways | | device | a preset, none | sets the width, height and device pixel ratio of a phone, tablet, laptop or desktop together, and a touch screen where it has one. see [devices](https://knobs.dev/docs/devices) | | orientation | portrait, landscape | turns a frame that has a width and a height, a device's or a custom one. it follows the size, so a size set across reads as landscape | | posture | closed, open | folds a foldable shut on its cover screen or open on its inner one, which turns the frame as its hinge stays put. only the iPhone Duo folds. see [devices](https://knobs.dev/docs/devices) | | mock | on, off | draws a phone's or tablet's body around its frame. on by default, and only offered while a phone or tablet is picked. see [devices](https://knobs.dev/docs/devices) | | touch pointer | on, off | the mouse acts as a finger inside a touch device's frame, like the devtools device toolbar: a round cursor, touch events, `pointerType: "touch"`, no hover, drag to scroll. on by default, and only offered while a device with a touch screen is picked. see [devices](https://knobs.dev/docs/devices) | | browser | compact, bottom, top, off on an iPhone; top, bottom, off on an Android phone | draws the phone's browser in its screen around the page, Safari on an iPhone and Chrome on an Android phone, and makes the frame the viewport that browser leaves the page. on by default with the browser's own default layout, and only offered while a phone is picked. see [devices](https://knobs.dev/docs/devices) | | bars | auto, expanded, minimized | auto follows the page's scroll as the phone does: a scroll down of 16 px minimizes the bars, which gives the page more height, and a scroll up of 40 px, the top of the page, a tap on the minimized address or a new page brings them back. expanded and minimized hold them one way. only offered while the browser is drawn | | edge to edge | on, off | on an iPhone held sideways, runs the page under Safari's top row of bars. off starts it under them. offered only while Safari is drawn sideways, as upright the page is always Safari's measured viewport and the switch does nothing; a stored value is kept. on by default. see [devices](https://knobs.dev/docs/devices) | | frame | off, on | puts the page in the same frame at full width, for the native color scheme without picking a width | | device pixel ratio | 1, 2, 3, system | sets `zoom` on the frame, which multiplies `devicePixelRatio` inside it while its css size stays put, so resolution queries and `srcset` follow. a wrapper scales the drawing back. brings the frame up | | zoom | fit, 50, 75, 100, 125, 150 | how big the frame is drawn, like the zoom of the devtools device toolbar. fit draws it whole, with a margin, up to its own size. a percent draws it at exactly that, and the letterbox scrolls both ways where it is bigger. the page inside keeps its viewport, media queries and device pixel ratio. the control in the letterbox's readout, ctrl or meta with the wheel or a trackpad pinch over the letterbox (around the pointer), and the zoom keys set it too | | mat | blue, green, magenta, purple, red, graphite, your own | the color of the cutting mat the frame lies on, its lines and numbers in a light tint of the same hue, wider on a p3 screen. green is the classic cutting mat green. it changes in place, with no reload. the plus after the swatches adds a color of your own, from the browser's color picker or typed as a hex or `rgb()`: it shows on the mat while you pick, and its lines and numbers go dark on a light color. up to 8 are kept per site, in `localStorage` under `devknobs:colors` and `knobs:colors`, and the x on one takes it off | | user agent | iphone safari, android chrome, ipad safari, mac safari, mac chrome, windows chrome, windows edge, linux firefox, googlebot, a custom string, system | patches `userAgent`, `appVersion`, `platform`, `vendor` and `maxTouchPoints` on `Navigator.prototype`, and `navigator.userAgentData`: its brands, `mobile`, `platform`, `toJSON` and `getHighEntropyValues` (platform version, model, architecture, bitness, full version list), all from the same browser. safari and firefox have no `userAgentData`, so their presets take it away. the ipad is the one iPadOS shows sites by default, a mac with touch points. a custom string sets `userAgent` and `appVersion` alone, as chrome devtools does: platform, vendor and touch points stay the browser's, and a `userAgentData` the browser has reports no brands. the field under the list shows while custom is picked, starting from the string in use, and editing it keeps it the custom one. back to system, every property is the browser's own again. in a device's frame a new user agent reloads the frame, see [devices](https://knobs.dev/docs/devices) | | vision | protanopia, deuteranopia, tritanopia, achromatopsia, blur, none | an svg color matrix (machado et al. 2009, as chromium devtools uses) or a 2px blur, as a `filter` on the frame, so fixed elements inside keep their place and the panel stays readable. brings the frame up | | overflow | on, off | finds what makes the page scroll sideways: every box that sticks out of the viewport on the right or the left with no box on the way up that clips or scrolls it, counting only the box that starts the overflow, not the children that fill it. each one gets a red mark drawn in a knobs layer over the page (its own styles are never touched), the console names them once, and the panel shows the count in its debug row and footer. it looks again on resize, scroll and page changes. with the frame up it runs inside the frame and reports the count up | | outlines | on, off | injects one style rule that outlines every element | | grab color | auto, blue, green, pink, orange, purple, cyan, your own | the color of grab's boxes and glow, wider on a p3 screen. auto is blue, and green on an element with blue behind it, so the box shows. a picked color stays whatever the page. the frame's grab follows. the plus adds a color of your own, as the mat's does, in a list of its own | | replay animations | action, `⇧R` | cancels and replays every animation `getAnimations()` returns, in the document and every open shadow root, then gives the finished css animations it no longer returns (pseudo-elements too) one `animation: none` style pass so they run again. scroll-driven animations are left alone | | requests | action, `⇧N` | shows the requests the page made, as a view in the panel. see [requests](https://knobs.dev/docs/requests-and-storage#requests) | | storage | action, `⇧S` | shows `localStorage`, `sessionStorage`, the cookies a page can read, IndexedDB and Cache Storage in the panel, clears site data, and keeps presets of values that can apply on every load. see [storage](https://knobs.dev/docs/requests-and-storage#storage) | new stylesheets are picked up as they arrive, so knobs keep working through hot reloads and lazily loaded css. a list from `matchMedia` gets a real `change` event, sent with its own `dispatchEvent`, whenever a knob moves its verdict, so `onchange`, `addListener` and the `once` and `signal` options all work. while a feature is emulated, the browser's own change events for it are held back, since they carry the real verdict. ### the frame width, height, device, frame, device pixel ratio and vision render the page in a same-origin iframe, a real viewport, and lean on what browsers do natively for frames: - color scheme: the frame element's `color-scheme` becomes the framed page's `prefers-color-scheme` (css color adjust, csswg #7493; chrome 129+, firefox 105+). a probe frame checks for it once. where it works, knobs sets it on the frame and leaves the page's css and `matchMedia` alone, so cross-origin stylesheets and shadow roots follow too. safari gets the rewrite. - device pixel ratio: `zoom` on an iframe multiplies the ratio inside it (csswg #9644, chromium since 2024). a browser seen not to hand it down loses the zoom, and the knob does nothing there. - fit and zoom: `transform: scale()`, never `zoom`, so the ratio inside stays the screen's and clicks land where they are drawn. a frame with a height is fitted to the window both ways, with a margin, and one with a set width stays clear of the open panel. the readout says the device, the size and the ratio, `iPhone 16 Pro · 402 × 874 · 3x`, and its zoom control the scale: `fit 89%`, or the zoom picked. the frame is sandboxed without `allow-top-navigation`, so a frame-busting script cannot reload the window into its frame forever. a click still can, so `target="_top"` links work. chrome logs one warning that a frame with scripts and same-origin access could lift its own sandbox. the address bar and the tab title follow the frame, so a reload lands where the frame was. a page that refuses to be framed (`x-frame-options`, `frame-ancestors`) gets a notice with a button that closes the frame. the page underneath is `inert` and `content-visibility: hidden` until the frame goes, and its scroll position comes back after. meanwhile its modal dialogs open as plain ones and its popovers stay hidden, as both would paint over the frame. ### the clock and your server optional, and dev only. the clock lives in the page, so a server that decides whether a trial ran out or a feature is unlocked keeps its own time. turn on "send to server" (`setState({ clock: { header: true } })`) and every `fetch` and `XMLHttpRequest` to the page's own origin carries the clock's instant: ``` x-knobs-now: 2026-10-04T09:30:00.000Z ``` the old header, `x-devknobs-now`, is sent too, with the same value, for now. a request to any other origin never gets it: a custom header there sets off a CORS preflight, and would hand your clock to someone else's server. nothing goes out while the clock is on system, and the switch shows once a time is set. the server reads it with a few lines of its own, behind a dev check. generic `Request` (hono, remix, sveltekit, `Bun.serve`): ```ts const now = (request: Request) => { const header = process.env.NODE_ENV === 'development' ? request.headers.get('x-knobs-now') : null; return header ? new Date(header) : new Date(); }; ``` tanstack start server function: ```ts import { createServerFn } from '@tanstack/react-start'; import { getRequestHeader } from '@tanstack/react-start/server'; export const getTrial = createServerFn().handler(async () => { const header = import.meta.env.DEV ? getRequestHeader('x-knobs-now') : undefined; const now = header ? new Date(header) : new Date(); // ... }); ``` next.js route handler: ```ts // app/api/trial/route.ts export async function GET(request: Request) { const header = process.env.NODE_ENV === 'development' ? request.headers.get('x-knobs-now') : null; const now = header ? new Date(header) : new Date(); // ... } ``` the first load of a page is a navigation, not a fetch, so it never carries the header, and server rendering on that load keeps real time. never honor the header in production. any client can send any header, so a server that trusts it lets anyone pick the day their trial ends. gate it on a flag that is false in production builds, as above. every knob has a live card on the [home page](https://knobs.dev/#try). ## Reference: devices The device presets, their mocks and bezels, the phone browsers drawn around the page, the touch pointer and how the iPhone Duo folds. ### the presets the device knob sets a size, a ratio and a touch screen in one pick. the list in the panel groups them by kind, and search finds them by name, kind or platform (`iphone`, `pixel`, `ipad`, `macbook`, `phone`, `tablet`, `android`). `landscape` turns the frame, and a size typed out such as `390x844` sets a custom one. the presets are also `PRESETS.device`. | device | css px | dpr | touch | | ----------------- | ------------------------- | ----- | ----- | | iPhone 18 Pro | 402 × 874 | 3 | yes | | iPhone 18 Pro Max | 440 × 956 | 3 | yes | | iPhone Duo | 466 × 678, open 951 × 669 | 3 | yes | | iPhone Air | 420 × 912 | 3 | yes | | iPhone 17 | 402 × 874 | 3 | yes | | iPhone 17 Pro | 402 × 874 | 3 | yes | | iPhone 17 Pro Max | 440 × 956 | 3 | yes | | iPhone 16 | 393 × 852 | 3 | yes | | iPhone 16 Plus | 430 × 932 | 3 | yes | | iPhone 16 Pro | 402 × 874 | 3 | yes | | iPhone 16 Pro Max | 440 × 956 | 3 | yes | | iPhone SE | 375 × 667 | 2 | yes | | Pixel 10 | 412 × 924 | 2.625 | yes | | Pixel 10 Pro | 427 × 952 | 3 | yes | | Pixel 10 Pro XL | 448 × 998 | 3 | yes | | Pixel 10a | 412 × 924 | 2.625 | yes | | Pixel 9 | 412 × 924 | 2.625 | yes | | Pixel 9 Pro | 427 × 952 | 3 | yes | | Pixel 9 Pro XL | 448 × 998 | 3 | yes | | iPad mini | 744 × 1133 | 2 | yes | | iPad Air 11 | 820 × 1180 | 2 | yes | | iPad Pro 13 | 1032 × 1376 | 2 | yes | | MacBook Air 13 | 1470 × 956 | 2 | no | | laptop | 1366 × 768 | 1 | no | | desktop | 1920 × 1080 | 1 | no | each size is the whole screen in css px, the device held its usual way: phones and tablets upright, laptops and desktops across. a phone shows its browser in that screen too, see below, and a laptop's menu bar and window frame would take some of the height as well. a phone or tablet picked after another is held the same way, anything else comes up its usual way, unless the patch names an orientation. a width or height set by hand that is no longer the device's drops the device and keeps the size, and a device pixel ratio set by hand keeps the device. ### the iphone duo the iPhone Duo folds. it comes up closed, on its cover screen, and the device row's `unfold` and `fold`, or `posture`, open it onto its inner screen and shut it again. like a book, its hinge stays where it is, so the cover screen held upright opens to the inner screen held across, and held across, it opens upright. it folds in view: the page goes under a cover in its own color, the half past the hinge swings toward you about it, and the page comes back laid out on the other screen. in its bezels the half that swings is Apple's own Duo, rendered offline every degree from Apple's model, with the page on its turned screen, once those frames have loaded, and a copy of the bezel till then. search finds it as `unfold`, `fold`, `open`, `closed` or `duo open`. a session kept from when the two screens were two devices, `iphone-duo-closed` and `iphone-duo-open`, comes back as the Duo in that posture. ### mock and bezels a phone or tablet comes up in a mock of its body, drawn in svg around the frame: the front glass in its band, the dynamic island, the punch hole, the camera or the home button, and the side buttons. each device has its own bezels, corners and parts, taken from apple's dimensional drawings and android's display config, so an iPhone SE has its square screen, round corners, tall forehead and chin and home button. it turns with the frame, is fitted and zoomed with it, and never takes a pointer. the viewport stays the device's size. the mock switch in the device editor turns it off. laptops and desktops have none. every iPhone and every Pixel wears its maker's own bezel instead: Apple's product bezels from Apple Design Resources, Apple's marketing image of the iPhone SE, and the Pixel frames of Google's Android Studio emulator. each is drawn at its own size, 3 image px per css px on the newer iPhones, 3.52 on the SE and 2.62 or 3 on a Pixel, with its screen opening exactly on the frame, so no model is ever stretched onto another. the punch hole, the home button and the buttons are the image's own. it loads from `dist/bezels` the first time the device is shown with the mock on, the drawn mock standing in its place until then, and the drawn mock stays where an image does not load. the Duo's fold frames load with it, from `dist/bezels/duo-fold`, about 2.7 MB. the images are not under this project's license, see [THIRD_PARTY_NOTICES.md](https://github.com/vinenastudio/knobs/blob/main/packages/devknobs/THIRD_PARTY_NOTICES.md): delete `assets/bezels` and run `bun run build`, which then names no image, and every phone draws its own mock again. ### the phone's browser a phone shows the page in its browser, drawn in the screen around the frame: Safari's status bar and Liquid Glass bars on an iPhone, and Android's status bar, Chrome's toolbar and the chin on a Pixel. the home indicator and the gesture handle are left out, as they go once you switch apps and here none are switched. the browser knob picks the layout, Safari's compact, bottom or top and Chrome's top or bottom, or off for the whole screen. the readout says the size the page gets. upright, the page gets Safari's real viewport, measured in iOS 27.0 (the same as in iOS 26.5) on an iPhone 17 Pro: 402 × 714 in compact, 402 × 654 with the bar at the bottom and 402 × 660 at the top (the page starts under the address bar, at 122), 754, 754 and 768 minimized. `innerHeight`, `visualViewport`, `100dvh` and `position: fixed; bottom: 0` follow the bars as on the phone. `screen.width` and `screen.height` are the device's own size, 402 × 874 on a 17 Pro: an iPhone keeps it upright however it is held, an Android phone turns it; the iPhone Duo reports its cover screen, 466 × 678, on either screen. under the bars, where the frame ends, the page runs on to the bottom of the screen, as a picture of the document past the viewport that follows the scroll, or the color of a fixed bar at the bottom of the viewport, carried down as on the phone. the strip over the page takes the color of a fixed or sticky bar at the top, else the page's background. minimized, the strip goes: the content at the top of the page shows under the status bar, in a wash of the page's color that fades out over 100 px, and the status bar's glyphs follow it. iOS 27 draws no scroll edge under the bottom bars, so the page runs on under them at full strength, on the iPhone Duo too. the edge to edge switch is offered only with the iPhone held sideways, where it still changes the frame: on, by default, the page runs under the top row of bars; off, it starts under it. upright it is not offered, and a value set earlier is kept for the next turn. Chrome always gives its real viewport, as its toolbar is opaque: a Pixel 9 is 412 × 777 with the toolbar and 412 × 857 without. the 9s' status bars are AOSP's own. Google publishes none for the 10s, so theirs are derived from where the punch hole sits, as AOSP lines the 9s' bars up with theirs. the iPhone Duo has Safari 27.1's own layout, the only one it offers, as measured on the iOS 27.1 simulator. upright on the cover screen the status and Safari's buttons stack in a column on the right, under the camera hole: the time, a ring for the battery round wifi with the signal's four dots in its gap, back, reader, and new tab with tabs. the address floats at the bottom of the page. the page never runs under the column, which takes the page's color. held across, the cover turns its top to the right, the camera hole to the bottom right, and has no status and no column: one bar along the top holds back, reader, the address, share, new tab and tabs. the inner screen has one bar at the top, held either way: back, reader, the address, new tab with tabs, then the time and the ring; minimized, only a small domain pill is left. the edge to edge switch is not offered on the Duo. the page gets the simulator's viewports: 382 × 580 on the cover screen upright (618 minimized, WebKit's, as the simulator's cover takes no swipe), 678 × 386 and 440 across, 669 × 871 and 900 on the inner screen upright, 951 × 589 and 618 across. the bars minimize and come back with the page's scroll, or stay one way with the bars knob. Safari's address capsule, or the bottom layout's card, is one glass shape that becomes the minimized pill: its box and corners tween over 500 ms when it minimizes and 400 ms when it expands (the transitions.dev very slow and slow durations) on css's ease, the address glides and shrinks from 17 to 13 px in it, the page menu, reload and the bottom buttons fade out early and in late, and the capsules beside it fade and drift 10 px. a scroll the other way mid way turns it back from where it is. Chrome's toolbar slides away under the status bar, or down with the chin, on the same timing. as the page's height changes with the bars, it gets one resize for each change, at the start when its viewport grows and at the end when it shrinks, so no gap shows, and its own scrolling as it settles never flips the bars again. with reduced motion in the browser the bars just switch. turned across, Safari keeps one row at the top and leaves room for the island at both sides. Chrome's numbers come from the Chromium and AOSP sources. the screen around the bars takes the page's own background, read again on each load, navigation and scheme change. Safari is drawn as iOS 27.0 has it on the simulator: its glass takes its tint from the page under it and from the scheme, #f8f8f8 over white and gray with black glyphs over black in light, gray with white glyphs over white and #222222 over black in dark, and a saturated page's own hue, lighter in light. compact ends in the tabs button, the page menu is three lines, and the status bar's glyphs are iOS 27's, about 7% bigger than iOS 26's, with a flat battery: the charged part in the glyph's color, the rest gray, no outline. the iOS 27 simulator does not draw the dynamic island, so the island keeps its iOS 26.5 size. the address shows the frame's host, back and forward step through the frame's history and reload reloads it, and the rest is drawn only. the glyphs are drawn for knobs, none come from Apple or Google. tablets, laptops and desktops have no browser drawn. ### user agent and reloads a device sets the user agent knob to its own browser too: iPhone or iPad Safari, Android Chrome, Mac Safari on the MacBook, Windows Chrome on the laptop and desktop. taking the device away puts the user agent back to system, unless it was changed since. a page reads some of a device once, as it loads: a script sniffs the user agent or the touch screen, a canvas sets up for the pixel ratio. so the frame reloads, keeping where it is, when a pick changes any of the user agent, the touch screen or the ratio: iPhone to Pixel, a device to the laptop, the user agent or ratio knob on its own, a reset. one pick reloads once, and a frame still on its first load finishes it first. iPhone 16 to iPhone 16 Pro, a turn, the zoom, the mock, the browser bars, the touch pointer, the scheme and every other knob follow live with no reload. the page above patches each new page in the frame before its first script runs, as soon as the frame's window has it: the user agent fields, `ontouchstart`, the touch points and the pointer and hover answers of `matchMedia`, so even an inline script at the top of `` reads the device, with no early script. on its first load, on a reload and on a link followed inside the frame alike. the copy of knobs in the frame takes those patches over when it mounts. tested in chrome. without a frame, a new user agent does not reload the page: reload it yourself, or load the [early script](https://knobs.dev/docs/start#early-script). ### touch screens a device with a touch screen gets one inside its frame: `(pointer: coarse)`, `(any-pointer: coarse)`, `(hover: none)` and `(any-hover: none)` match, in stylesheets and `matchMedia` alike, through the same rewrite as the prefers knobs, `'ontouchstart' in window` is true, and `navigator.maxTouchPoints` reads 5, or what the user agent preset says while one is set. the page above the frame keeps its own pointer. its scrollbars take no room either, as a phone's lie over the page: every scroller in the frame, the page itself included, has its scrollbar hidden from before the page's first script, so `documentElement.clientWidth` and `innerWidth` both read the device's width. the page scrolls as before, by the wheel and the touch pointer. laptops and desktops keep their scrollbars. the mouse acts as a finger there too, as in the devtools device toolbar. the cursor over the frame is a round dot, a little smaller and darker while pressed. a press sends `touchstart`, `touchmove` and `touchend` (`touchcancel` when the browser cancels it) to the element it went down on, for the whole gesture, and page listeners read `pointerType: "touch"` on pointer events. a finger does not hover, so no move, over, out, enter or leave event reaches the page without a press. a press that stays within 10px is a tap and clicks as usual. one that moves further scrolls the nearest element that can scroll that way, both ways where it can, within the `touch-action` of every element on the way up, and flings on with the speed it was let go at until the next press. the page gets a `pointercancel` then, its mouse events stop, and no click follows a drag. after a tap the page gets `mousemove`, `mousedown` and `mouseup` once the finger is up, after `touchend`, as a phone sends them, but the browser still focuses and places the caret at the press, so a `preventDefault` on `mousedown` does not keep the focus where it was. a touch listener that calls `preventDefault` keeps the page from scrolling, and on `touchstart` or `touchend` stops the mouse events and the click as a touch screen does. text does not get selected and nothing starts a native drag along the way. a press on a range slider, editable text or a scrollbar, or with any button but the main one, is left to the browser: the page's own pointer and mouse moves pass through untouched, and the pointer type stays the mouse's. while grab is on the mouse is a mouse again, until grab ends. the touch pointer switch in the device editor turns it off, and the panel never gets it. ### how the iphone duo folds the Duo's case is never rendered in your browser. it is rendered once, offline, from Apple's own iPhone Duo model, the Star White USDZ from Apple's AR viewer, in a three.js scene adapted from jadon7's [iphone-duo](https://github.com/jadon7/iphone-duo) ([live demo](https://iphone-duo-tawny.vercel.app/)): one frame every degree from shut to open, 181 of them, its screens cut out, and the half that stays with each, one image of it for every angle where it differs. its metal and the black glass round its screens are shaded from Apple's bezel pictures, and shut, its hinge wraps into the spine those show, so both ends of a fold look as the Duo does at rest. each frame is packed small, as its outline round a clear middle at 1.5 px per css px, and ships as an image. three.js runs only in that script, never in the package. in the page, the hinge sets the angle, at one constant speed, or through Apple's hinge spring under a hand on the fold slider. knobs shows the frame nearest it, and the page sits in that frame's screen. the turning screen shows a picture of the page through a small WebGL2 blur, or plain layers where WebGL2 is not, and it stays still behind the turning glass, as on Apple's product page. the half that stays keeps the live page. only the frames within about 10 degrees of the current angle, and 10 more ahead, are decoded, about 55 MB at most, and at rest the Duo is Apple's bezel picture. thanks to jadon7: the scene, the fold rig and the screen projection come from jadon7's iphone-duo, MIT. see [THIRD_PARTY_NOTICES.md](https://github.com/vinenastudio/knobs/blob/main/packages/devknobs/THIRD_PARTY_NOTICES.md), and [`scripts/render-duo-fold/README.md`](https://github.com/vinenastudio/knobs/blob/main/packages/devknobs/scripts/render-duo-fold/README.md) to render the frames again. ## Reference: grab and inspect Grab an element for a coding agent with its html, components and source places, or inspect its box and css in the panel. ### grab press `⇧G` (`Shift G` off a Mac) to grab an element for a coding agent. hover it, click it, and its html, the components that rendered it and where they live are on the clipboard, one line per element: ``` [ in SaveButton (at src/App.jsx:5:5) in App (at src/App.jsx:28:7)] ``` paste that into the agent and it can find the code. the clipboard also carries the same context as json, under `application/x-knobs-grab` and react-grab's own `application/x-react-grab`. grab turns on with the press, and stays on until a copy, escape or `⇧G` again. holding the key down does not turn it off. in a field of the page `⇧G` types a capital and grab stays off, and in the panel's search it is grab's. a grab key with meta, ctrl or alt, such as `alt+shift+g` or a copy shortcut like `meta+c`, turns on once it is held for 100ms, and a quick press of a copy shortcut is still a copy. the hold is 500ms while a field has the focus and 700ms while text is selected, and a key that copied something waits for the key to repeat, or to be let go after 200ms. grab then stays on until a copy or escape. the search finds it too: `grab` or `pick`. grab is an action, not a row: it is never listed, and never kept, so a reload starts with it off. while it is on: - the element under the pointer gets a box and a label with its tag and its component, and the cursor is a crosshair. knobs' own panel and frame are passed over, open shadow roots are reached into, and so are the children a hit test passes over: those that take no pointer events, or sit under a clear layer or a pseudo element stretched over a card. - a click copies the element, and grab ends. the page's own click, mouse and pointer handlers never hear of it, and its hover handlers neither. - shift and a click gather elements, lighter boxes, and a second one takes one back out. `⇧↩` (`Shift Enter` off a Mac) gathers the boxed element or takes it back out, and backspace or delete takes it out. letting go of shift copies nothing: what is gathered stays until a copy, escape or its removal. - drag a box on the page, with shift or without, to gather every element fully inside it: the outermost ones, in page order, 30 at most. those it would take show lighter boxes while you drag. ones gathered before stay, and a drag never copies. knobs' own ui, hidden elements, shadow roots and frames are left out. - each gathered element shows its number, 1, 2, 3 in the order it was gathered, in a badge at its box's top left. the numbers close up when one goes. - a tray at the bottom of the window lists them: the number, the tag and the component, and a remove button. under the list are one note for them all and a "Copy N" button. `n` writes the note. `⌘↩` (`Ctrl Enter` off a Mac) in the tray copies. escape in the tray goes back to picking, and what is typed in it never moves the box or copies. the tray wears the page's theme: dark on a dark page, light on a light one. - a click without shift, enter, `c` or the tray's button copies them all, the clicked one last where it is new, and grab ends. - up goes to the parent, down back the way it came or to the first child, left and right (and tab, shift-tab) to the previous and the next element, siblings first, then the sibling of the nearest parent that has one. enter or `c` copies. - a check and "Copied" show by the element for a moment, the box still on it. one element with no note copies as its line alone. more than one, or a note, and each element is numbered, and the note goes last after a blank line. an empty note is left out: ``` 1. [ in SaveButton (at src/App.jsx:5:5)] 2. [Docs in Nav (at src/Nav.jsx:12:9)] Note: same spacing for all of these ``` the json carries the note as `note`. the context of the element under the pointer is worked out while the pointer rests there, so a click copies it whole, inside the click, as Safari wants. where it is not ready yet, the click copies it without lines and columns, by component names, and the rest is worked out for the next copy. grab runs in the page that owns React. with the width knob's frame up, the page above hands grab to the frame, and the box and the copy happen there. escape in the frame ends it. pass `grabKey: "alt+shift+g"` for another key, or `grab: false` to leave it out. `grab(elements)` copies elements from code and resolves with the payload, its `content` and `entries`. it comes back even when the copy fails, with `copied` false, and is null only when the elements give nothing. the overlay and the context load the first time grab is used. for the full owner stack, with a file, a line and a column for each component, React has to report to a devtools hook from its first render. the React devtools extension has one. without it, load the [early script](https://knobs.dev/docs/start#early-script) first, which puts one in place. with neither, grab names the components it finds on the element and falls back to a selector. the line shows a selector only when it is built from a test id, a label, a stable id or another meaningful attribute (href, src, role, name, title, alt); each entry's `selector` has one for the element in any case. the copied line keeps to the app's own code: the component the element is written in, at the line and column of its jsx, then the components that rendered it, three at most, with paths from the project's root. a library's frames, React's and nameless ones stay out, a place shows once, and class names a tool generated (StyleX, CSS modules, emotion, styled-components) are dropped. where a dev server's source map has no place for an element, as a route split from its file can, the place is looked up in the source the map carries. off React, grab reads the source places that Astro, Svelte and Vue put on the page in development: the element's file and line (Svelte adds the column, Vue has no line), then the files above it, such as the layout that uses the component: ``` [
in Filters (at src/components/Filters.astro:1) in Base (at src/layouts/Base.astro:5) selector: [aria-label="Filters"]] ``` Astro's dev toolbar takes these places off the page once it loads. knobs keeps them when it mounts before the toolbar loads, as the extension does. mounted later, knobs loads the page's own address once more and reads them from its html. where nothing names the element, as on a built or a plain html page, the line says where it sits instead: its text when the html shows none, the nearest heading and the landmark around it: ``` [
text: "All Buttons Inputs" heading: "Library" landmark: main selector: [aria-label="Filters"]] ``` grab is adapted from [react-grab](https://github.com/aidenybai/react-grab) and reads React's internals through [bippy](https://github.com/aidenybai/bippy), both by Aiden Bai and MIT, see [THIRD_PARTY_NOTICES.md](https://github.com/vinenastudio/knobs/blob/main/packages/devknobs/THIRD_PARTY_NOTICES.md). ### send each grab every grab, from the keys or from `grab()`, fires one `knobs:grab` event on `window` as the copy starts, before it is known whether the copy worked. its `detail` is the payload: `content`, `entries` and `note` where there is one. it cannot be canceled. ```js window.addEventListener('knobs:grab', (event) => { console.log(event.detail.content, event.detail.entries, event.detail.note); }); ``` the `grabSend` mount option sends each grab on as well, so nobody has to paste: - a URL gets a POST with `Content-Type: application/json` and `credentials: "same-origin"`, its body `{ "type": "knobs.grab", "payload": ... }`. only the page's own origin, a relative path included, and http(s) on `localhost`, `127.0.0.1` or a `.localhost` name are taken; any other URL is ignored with one warning in the console. - a function is called with the payload, and may return a promise. ```js mount({ grabSend: '/api/grab' }); mount({ grabSend: (payload) => socket.send(JSON.stringify(payload)) }); ``` the script tag build takes it from a `data-grab-send` attribute: ```html ``` a send never stops the copy. once it went, the toast says `Copied · Sent` (`Sent` alone where the copy failed). where it fails, a thrown error, a rejected promise, a network error or a status that is not 2xx, the toast says `Send failed`. a page whose own mount defers to the extension hands its `grabSend` to the extension's copy, as it does its keys. ### migrating from react-grab knobs covers it: the same grab, the same line format, the same clipboard type. remove the `react-grab` script or package, and mount knobs. pass `grabKey: "meta+c"` (`"ctrl+c"` off a Mac) to keep react-grab's key. ### inspect press `⇧C` (`Shift C` off a Mac) to see the css of an element. it picks as grab does, with the same box, arrows and escape, and its label says `styles` before the element. a click copies nothing: the element's styles open in the panel, in place of the rows, at the panel's width. drag its edge for another width, which the rows keep too. picking is a mode, as in the browsers' own tools. a click picks the element and ends the picking: nothing is left drawn on the page, and the page takes clicks again. the element stays in the styles view. to pick another, press the select button at the left of the view's bar, the dashed square with a pointer, or `⇧C` again. the button is pressed while the picking is on, and `⇧C` while picking stops it. escape ends the picking and keeps the element shown, the next escape clears the filter if it has text, and the next goes back to the rows, as the back button on top does. going back ends the picking and keeps the element: inspect's row says its name, and opens the view on it again without picking. with no element, the row starts the picking. `⇧E` opens the view without picking too, on the element held, else on the page's body, and opens the panel for it where it is closed. pressed again while the view shows, it closes the view. the row says `picking` while the mode is on, and `off` with nothing picked. the view points at the page only while the pointer is on what stands for an element: a crumb, the box's diagram, or the name in the view's head box that element on the page, and the box goes when the pointer leaves. an element that left the page is said so, in a line you press to pick another. with no element the view has no bar, and its one line starts the picking. the search finds inspect as `inspect`, `styles` or `css`, the footer has its key, and the shortcuts in the settings set another. grab and inspect are never on together: starting one ends the other. while grab is on `c` is grab's copy. while inspect is on, the element under the pointer shows its box as the browsers' own tools draw it: the content in blue, the padding in green, the border in yellow and the margin in orange, see-through, under the box's own line. a negative margin makes no area on its side. an element in several pieces, as a link over two lines is, is drawn by its bounding box, and so is one a transform turns or scales, unless the browser has `getBoxQuads`, which gives its own corners. an element with `display: contents` or of no size has no box, only its label. an element the view points at is drawn the same way, with no label. grab draws none of this. the label by the box is a small card in inspect. its first line is the element and its size. under it, once the pointer rests, only what applies: - `color` and `background`, each with a swatch, as a hex or as `rgb()` with its alpha. where the element has no background of its own, it is the one that shows through from an ancestor, said quietly - `font`: the family, then the size over the line height, the weight, and the letter spacing where it is not `normal` - `contrast`: the wcag ratio of the text on its background, with a check where it meets level AA at the text's size and weight, or a cross - `margin` and `padding`, top, right, bottom, left, where any side has some the color, the font and the contrast are for an element with text of its own. what the `font` row can know: it is the first family of the computed `font-family` that `document.fonts.check` says is there, or the first generic one such as `sans-serif`. for a web font the answer is exact: it is there once it has loaded. for a family the page did not load, most browsers answer yes whether the system has it or not, so the row trusts the name. and no browser tells a page which font a glyph really fell back to, so text that mixes scripts may be drawn in more fonts than the one named. the background is the `background-color` only: an image or a gradient behind the text is not seen, and the contrast is then against the color under it. the styles start with the element's box, under `box`, which folds away and stays the way you leave it: the margin, the border, the padding and the content one inside the other, each with the length of its four sides in css px, a dash for 0, the content with its width by its height, and around them the offsets of a positioned element. the pointer on the box draws the element's on the page, and on one area that one alone. where the panel is too narrow for the lengths, they leave the areas, and those of the area the pointer or the focus is on stand in a line under them. under that are the element's `box-sizing` and `display`, and its `position` where it is not `static`. the box is read again with the styles, and when the element changes size. the view has two modes, set by the control beside the filter, and the one you pick is kept. `simple`, the one it starts in, lists only the styles that apply to the element, by what they do, with what it inherits folded under them, and after a value that reads a custom property what it comes to. `advanced` shows, in the order the cascade settles them: - the element's `style` attribute, as `element.style` - every rule that reaches it, the strongest first, with the selectors of a list that do not match muted, the `@layer`, `@media`, `@supports` and `@container` it sits in above it, and the stylesheet's file after it - declarations another one overrides, struck through - the rules of its `::before` and `::after` - what each ancestor hands down, under `inherited from` and its name a color has a swatch before it. in both modes a property's name has a color of its own, the one the names in a request's headers and a cookie's fields have, and every custom property a value reads through `var()` is a piece you can rest the pointer on or reach with the tab key, as is the name of a `--custom` declaration: the tooltip says what the element sees for it right then, with a swatch for a color and under it the selector that sets it, or `not set` and what its fallback comes to. in `advanced` a click on one goes to the block that sets it, and no click copies. the crumbs under the tree are the element's ancestors, each a click away, and the filter keeps the declarations that have its text in their name or value. the view reads the styles again when the element or an ancestor changes, when a stylesheet in the head does, when the window is resized and when a knob moves. with the width knob's frame up, inspect picks in the frame and the styles show in the panel. what a knob of knobs writes on ``, the root size of the text size knob and the `color-scheme` of the scheme knob, is left out. #### the elements tree the view is laid out as the browsers' own Elements panel: the DOM tree on top, the element's breadcrumbs under it, and the styles under those. the tree is the page's document, or the frame's page with the width knob's frame up, from `` and `` down, with the element picked selected and every node on the way to it open. each line is a node as the Elements panel writes it: `` in its colors, a triangle on what opens, `…` for one that is closed, an element's one short text inside its line, other text in quotes, ``, `#shadow-root (open)` for an open shadow root, and `::marker`, `::before` and `::after` where they have content. an open element ends on a line of its own, ``. long values and texts are cut short with `…`. past 500 children a line says `Show all nodes (N more)`. knobs' own nodes, its panel, boxes, frame and styles, are never in it. the pointer on a line boxes its element on the page, margin and padding as the picking draws them. a click selects a line and the styles follow it, and a pick on the page or a crumb selects its element in the tree. the arrows move as in the Elements panel: up and down a line, right opens a line or goes into it, left closes it or goes to its parent, Home and End to the ends. the selected line ends with `== $0`, and `$0` on the page's window is that node while the view is open, unless the page has a `$0` of its own. its `copy`, or cmd or ctrl and c in the tree, copies the node's outer html, as Copy element does. the tree follows the page as it changes, and a node that changed lights for a moment. drag the line under the tree, or focus it and press ↑ ↓ (⇧ for bigger steps), for more or less of it. #### edit the html the tree can be edited as in the browsers' own tools, and each edit goes on the page at once, into the same changes as the style edits: - a double-click on a line's text, or ↩ on its line, makes the text a field. ↩ puts it on the page and esc leaves it. only that text changes: the element's other children stay. an empty text is refused - a double-click on an attribute makes it a field with `name="value"`, as in the tag, a `"` in the value written `"` and a `&` as `&`. change the value or the name, write several `name="value"` pairs in one field, or clear the field to take the attribute out. `class` is edited like any other attribute - a text or a value with line breaks, as in a `
` or an svg path, opens
  in a field that keeps them, where ↩ breaks the line, and `⇧↩`
  (`Shift Enter` off a Mac) or its `apply` button puts it on the page
- `a` on the selected line adds an attribute, in a field before the tag's end
- `F2` edits the element as html: an editor with its outer html, in the
  panel's monospace, its lines numbered and its tags, attributes, values and
  comments colored. ↩ breaks the line with the line's indent, one level more
  after an opening tag, and between a tag and its end tag puts the end on a
  line of its own. `>` after `` after the caret (not for
  a void element such as `` or `
`), and `"` after `=` in a tag writes the closing quote too, which typing it steps over. the grip under the editor drags its height, and `expand` makes it as tall as the panel (`shrink` makes it as it was); both are kept for the next time. `⇧↩` (`Shift Enter` off a Mac), its `apply` button, or a click elsewhere puts the new html in the element's place and selects it; esc leaves it. html with no element in it, or with knobs' own `data-knobs` or `data-devknobs` attributes, is refused: applying it with `⇧↩` or the button turns the field red and keeps it open, while a click elsewhere closes it without the edit. undo puts the very element back, unless the page moved the new nodes since - `h` hides the selected element and all in it, and shows it again: `visibility: hidden` through an attribute of knobs', so the page's own `style` stays as it is. its line goes faint - Delete or Backspace deletes the selected node, and the line after it is selected. undo puts it back where it stood - `⇧↑` and `⇧↓` (`Shift Up` and `Shift Down` off a Mac) move the selected element before the element above it or after the one below it, among the elements in its parent; texts between them stay where they are. a ` ``` with a bundler: ``` if (import.meta.env.DEV) import('@vinena/knobs').then(({ mount }) => mount()); ``` in react, render `` from `@vinena/knobs/react` once, in development only. it renders nothing and mounts the knobs on its first effect. a static import stays in the production bundle even behind a dev check, so in next.js load it with `dynamic()` behind the check. #### open it press `⇧K` or click the handle on the right edge of the window. in the open panel, `/` searches the knobs and `⇧G` grabs an element. see [the panel](https://knobs.dev/docs/panel). the knobs live in `sessionStorage`, so they survive reloads and go away with the tab. #### early script a page that reads a media query, the time or the user agent while it boots, before knobs mounts, only sees the knob if the patch is already in place. put this first in ``, in development only: ``` ``` #### from code `mount()` and `` take options such as `hotkey`, `open` and `persist`. the api sets knobs too: `setState({ scheme: 'dark' })`, `reset()`, `getState()`. agents get `describe()` and `ready()`, see [agents](https://knobs.dev/docs/agents). ## The knobs panel: open, move, search and pin your knobs URL: https://knobs.dev/docs/panel ### the panel #### open and move it the panel starts closed, as a handle on the right edge of the window. click it or press `⇧K` to open it. it stays open across reloads. - drag the handle to move the panel along the edge, or past the middle to the other side. - drag the panel's inner edge to change its width, from 240px to 720px, or less in a narrow window. it starts at 320px, and a double click on the edge puts it back. #### rows and search the panel lists the knobs that are off their default, one row each. click a row to open its editor, `×` puts it back to its default, and holding `×` for a second takes the row off. drag a row by its six dots to move it. the add knob button opens a search. type `dark`, `390`, `+2d`, `tokyo` or `offline`, and enter sets the first result. #### keys while the panel is out and the focus is in no field: | key | what it does | | --- | --- | | `⇧K` | opens and closes the panel | | `/` | opens the search | | `⇧G` | grabs an element, see [grab](https://knobs.dev/docs/grab) | | `⇧R` | replays the page's animations | | `⇧N` | shows the [requests](https://knobs.dev/docs/requests-and-storage) | | `⇧S` | shows the [storage](https://knobs.dev/docs/requests-and-storage) | | `⇧E` | shows the elements view, see [inspect](https://knobs.dev/docs/grab#inspect) | | `⇧O` | shows the settings | | `⇧` backspace | resets every knob | `⇧N`, `⇧S`, `⇧E` and `⇧O` open the panel where it is closed, and the same key again leaves the view. every other key goes to the page. the gear in the footer opens the settings, where you can change every key but `/`, to any key or combination, a key alone too, and hide the handle. the browser's own keys and a key another shortcut has are refused. with the extension, the keys you set are the same on every site. the dev tab icon switch there puts a `DEV` ribbon on the tab's icon: on local hosts only by default, or on any host or none, for this tab. turned off or unmounted, the page has its own icons back. with the extension, the real phone mode switch sends the device's user agent with the frame's page loads, so sites serve their mobile site; some sites may sign you out. it is one setting for every tab and site. #### pinning the pin button in the footer docks the panel to its side, the way devtools dock. the page gets narrower for real, so media queries and fixed boxes follow. press it again to float the panel. #### fresh mode add `knobs=fresh` to the address to see the page and the panel as a first visit does. nothing is kept while it is on. ``` http://localhost:3000/?knobs=fresh ``` ## Every knobs knob: dark mode, locale, time zone and more URL: https://knobs.dev/docs/knobs ### knobs every knob and what it does. search finds them by name or value, see [the panel](https://knobs.dev/docs/panel). #### look and motion | knob | what it does | | --- | --- | | [color scheme](https://knobs.dev/use/dark-mode) | light or dark, in your css and in `matchMedia` | | [reduced motion](https://knobs.dev/use/reduced-motion) | `prefers-reduced-motion: reduce` | | animation speed | runs animations at 0.25 or 0.1, or pauses them | | contrast | `prefers-contrast: more` | | reduced transparency | `prefers-reduced-transparency: reduce` | | text size | the browser's default font size | | text spacing | the wcag 1.4.12 text spacing values | | [vision](https://knobs.dev/use/color-blindness-simulator) | a color blindness filter or a blur | | replay animations | `⇧R` runs every animation again | #### locale, place and time | knob | what it does | | --- | --- | | [locale](https://knobs.dev/use/rtl) | any language tag and a direction, `Intl` included | | [pseudo](https://knobs.dev/use/pseudolocalization) | turns the page's text into `[Ŝéţţîñĝš ···]` | | [geolocation](https://knobs.dev/use/fake-geolocation) | a city, your own coordinates, or a route | | geo error | denied, unavailable or timeout | | [time zone](https://knobs.dev/use/time-zone) | any iana zone, or the geo city's zone | | [clock](https://knobs.dev/use/time-zone) | jump ahead, pick a date, freeze it, or speed it up | #### browser and debug | knob | what it does | | --- | --- | | online | the page reads offline, requests still succeed | | connection, save data | `navigator.connection` reads 2g to 4g, chromium only, no throttling | | [user agent](https://knobs.dev/use/user-agent-switcher) | iphone safari, googlebot, or your own string | | requests, storage | `⇧N` and `⇧S` show what the page sent and stored | | overflow | finds the boxes that scroll the page sideways | | outlines | outlines every element | | grab color | the color of [grab](https://knobs.dev/docs/grab)'s boxes | #### viewport and device these put the page in a frame, a real viewport, so media queries and `vw` follow. see [devices](https://knobs.dev/docs/devices). | knob | what it does | | --- | --- | | [viewport width, height](https://knobs.dev/use/window-sizes) | a size in px | | [device, orientation](https://knobs.dev/use/mobile-simulator) | a phone, tablet or laptop, turned | | posture | folds a foldable | | mock, browser, bars | the phone's body and its browser | | edge to edge | the page under Safari's top row, sideways | | touch pointer | the mouse acts as a finger | | device pixel ratio | 1, 2 or 3 | | frame, zoom, mat | the frame alone, its zoom, the mat's color | #### the clock and your server turn on "send to server" and `fetch` and `XMLHttpRequest` calls to the page's own origin carry the clock's time. the first page load does not. read it on your server: ``` const now = (request: Request) => { const header = process.env.NODE_ENV === 'development' ? request.headers.get('x-knobs-now') : null; return header ? new Date(header) : new Date(); }; ``` never honor the header in production. any client can send it. ## Device presets in knobs: iPhone, Pixel, iPad and laptop URL: https://knobs.dev/docs/devices ### devices #### pick a device the device knob sets a size, a ratio and a touch screen in one pick. the presets come in six families: - iPhone, such as iPhone 18 Pro (402 × 874) and iPhone SE (375 × 667) - Pixel, such as Pixel 10 (412 × 924) - iPad, such as iPad mini (744 × 1133) - MacBook Air 13 (1470 × 956) - laptop (1366 × 768) and desktop (1920 × 1080) the panel's device list has them all, and search finds them by name, kind or platform, such as `pixel` or `tablet`. #### landscape and custom sizes `landscape` turns the frame. type a size such as `390x844` for a custom one. #### mocks, bezels and the phone's browser a phone or tablet comes up in a mock of its body: the glass, the island or punch hole, the buttons. every iPhone and Pixel wears its maker's own bezel. the mock switch in the device editor turns it off. a phone also shows the page in its browser: Safari's bars on an iPhone, Chrome's toolbar on a Pixel. the browser knob picks the layout, or off for the whole screen, and the bars minimize as the page scrolls. #### touch and the user agent a touch device gets a touch screen inside its frame: `(pointer: coarse)` matches, and the mouse acts as a finger, with a round dot for a cursor. a press scrolls and flings, and a tap clicks. a device sets the user agent to its own browser too. the frame reloads when a pick changes the user agent, the touch screen or the ratio. #### the iPhone Duo the iPhone Duo folds. it comes up closed on its cover screen, and `unfold` and `fold` in the device row open it onto its inner screen and shut it again, with the fold drawn in view. ## Grab and inspect elements for a coding agent with knobs URL: https://knobs.dev/docs/grab ### grab and inspect #### grab press `⇧G` (`Shift G` off a Mac), hover an element and click it. its html, the components that rendered it and where they live go on the clipboard: ``` [ in SaveButton (at src/App.jsx:5:5) in App (at src/App.jsx:28:7)] ``` paste that into your agent and it can find the code. - drag a box, or shift and a click, to gather several elements. each gets a number, and a tray at the bottom lists them, with one note for them all. `n` writes the note. - enter, `c` or the tray's copy button copies them all, numbered, the note last. - the arrows move to the parent, a child or a sibling. - escape or `⇧G` again turns grab off. ``` 1. [ in SaveButton (at src/App.jsx:5:5)] 2. [Docs in Nav (at src/Nav.jsx:12:9)] Note: same spacing for all of these ``` for a file, a line and a column on every component, React needs a devtools hook from its first render: the React devtools extension, or the [early script](https://knobs.dev/docs/start). #### change the key ``` mount({ grabKey: 'alt+shift+g' }); ``` `grab: false` leaves grab out. `grab(elements)` copies elements from code. #### send each grab every grab also fires one `knobs:grab` event on `window` as the copy starts, with what it copies as its `detail`: ``` window.addEventListener('knobs:grab', (event) => { console.log(event.detail.content, event.detail.entries, event.detail.note); }); ``` `grabSend` sends each grab somewhere too, so nobody has to paste. a URL gets a POST of `{ "type": "knobs.grab", "payload": ... }` as json; it has to be the page's own origin, or http(s) on `localhost`, `127.0.0.1` or a `.localhost` name. a function gets the payload: ``` mount({ grabSend: '/api/grab' }); mount({ grabSend: (payload) => socket.send(JSON.stringify(payload)) }); ``` with the script tag, set it on the tag: ``` ``` the copy still happens. the toast says `Copied · Sent` once it went, and `Send failed` when it did not. #### coming from react-grab knobs has the same grab, the same line format and the same clipboard type. remove `react-grab`, mount knobs, and pass `grabKey: "meta+c"` (`"ctrl+c"` off a Mac) to keep react-grab's key. #### inspect press `⇧C` (`Shift C` off a Mac) and click an element to see its css in the panel, as the browser's Elements panel shows it: - the DOM tree on top, the element selected, with its breadcrumbs under it - its box: margin, border, padding and content, with their sizes - its styles, in `simple` mode (what applies) or `advanced` (every rule, in cascade order) while you pick, the box is drawn on the page in the browser's colors, and a card shows the color, font, contrast and spacing. click a value to edit it, the checkbox at a line's start turns it off and on, and `+ add property` adds one. as you type a name or a value, a list suggests what the browser takes: every property it knows and the page's custom properties, then for a value its keywords, named colors and `var(--x)`; an empty field shows the whole list. ↑ and ↓ pick one, ↩ or Tab takes it, or the first where it completes what you typed (Tab in a name goes on to the value), and esc closes the list. the changes at the foot count the edits, `changes (N)`: click it to show each edit as `-` and `+` lines, and it stays as you leave it. `Z` undoes and `⇧Z` (`Shift Z` off a Mac) redoes while the focus is in the view and not in a field (⌘Z and Ctrl Z do not), and `copy prompt for agent` copies a prompt that asks your agent to put them in the code. `+ new rule` adds a rule for the element, its selector from the element's classes. the chips `:hover`, `:focus`, `:focus-visible`, `:active` and `:focus-within` over the rules force a state: each makes the page draw the element in that state, and the styles show the rules of that state as applying. a forced state is no edit, and it ends when you pick another element or close the view. the DOM tree can be edited too: double-click a text or an attribute to edit it, and on the selected line `a` adds an attribute, `F2` edits it as html, `h` hides it, Delete deletes it and `⇧↑` / `⇧↓` move it among its siblings, or use the bar under the tree. the html editor colors the html and numbers its lines; ↩ keeps the indent, `>` closes the tag, `⇧↩` applies and esc leaves. drag the grip under it to resize it, or click `expand` to give it the panel's height. drag an element's line by its handle, `⋮⋮`, to move it before or after another element, or into one. those edits go into the same changes, and the prompt asks your agent to change the component, as a re-render may undo an edit of the DOM. ``, `` and `` and knobs' own nodes and attributes cannot be replaced, hidden, deleted or moved. the switch `keep edits after reload` in the panel's settings keeps the edits for the page: after a reload they are made again where the page still has them, and the changes say how many came back and which could not be found. it is off at first, and off forgets them. html and attribute edits are never made on load: they wait in the changes until you click `apply`, as a page script could have planted them, and one that could run a script is never made. a page keeps its first 200 edits, up to 256 KB, for 20 pages at most; forced states are never kept. edits made in knobs' frame, for a pinned panel or a device, are kept while it shows the same page, and made again in the frame after a reload. kept edits hold the page's text, attribute values and markup as edited. with the npm package they are in the page's `localStorage`, with the extension in its own storage. ## See network requests and edit storage with the knobs panel URL: https://knobs.dev/docs/requests-and-storage ### requests and storage #### requests press `⇧N` (`Shift N` off a Mac) to see what the page asks for: a row a request, the newest on top, with its method, name, status and time. filter by address, method or status. click a row to open it, laid out as Chrome DevTools' network panel: | tab | shows | | --- | --- | | Headers | general, response and request headers | | Payload | query string, request payload, form data | | Preview | json as a tree, images, html | | Response | the body as text | | Initiator | the call stack that made the request | | Timing | queueing, connection, waiting, download | copy puts a request on the clipboard as plain text, ready for an AI chat. secret looking headers and parameters are copied as ``, but bodies are copied as they are, so check before you paste. #### what gets recorded `fetch` and `XMLHttpRequest` are seen whole. an `EventSource` is a row with its messages. images, scripts and other things the page loads get timing and sizes only. the last 300 requests stay in memory, and nothing is sent anywhere. load the [early script](https://knobs.dev/docs/start) to catch the page's first request. #### storage press `⇧S` to see what the page keeps in the browser, as one tree: - local storage and session storage: read, edit, add and delete - cookies: the ones the page can read, editable - IndexedDB and cache storage: read only one filter works over every table. clear site data empties it all after one question. knobs' own keys are hidden and kept. #### presets save as preset keeps the storage items and cookies the filter shows, under a name. apply one with a press, or turn on apply on load to set it on every load. export and import them as json to share with teammates. ## Drive knobs from a coding agent with Playwright or MCP URL: https://knobs.dev/docs/agents ### agents #### drive the knobs a coding agent can drive the knobs through any browser tool that runs js in the page, such as playwright's `page.evaluate` or the chrome devtools mcp's `evaluate_script`, and fix what breaks. - `describe()` lists every knob as json: its key, the values it takes, its default, and what applying it reloads: `none`, `frame` or `page`. - `setState()` throws a `TypeError` at a value the state does not take, and then changes nothing. `setState(getState())` takes the whole state back. - `ready()` resolves with the state once the page has caught up with the knobs. it rejects when knobs is not mounted, and past 10 seconds, so a timeout never passes for success. - [`grab()`](https://knobs.dev/docs/grab) takes an element, an array or a NodeList of them. - `edits()` gives the style and html edits made in inspect's view as json, to put in the code, a new rule (`css-rule`) and a moved element (`move`) included. `setEdits(list)` makes such a list again on a fresh load, where the page still has each edit's target and value before, and resolves to `{ applied, skipped }`; `undoEdit()` undoes the last one. it makes html and attribute edits at once, but never one that could run a script (`could run a script`), and after a delete, move or html edit that was not made, it skips every later one. - `forceState(element, ['hover'])` makes an element render as hovered, focused or pressed, for a screenshot; `forceState(null)` ends it. - `reset()` sets the knobs back and leaves the panel as it is. ``` window.knobs.setState({ scheme: 'dark', panel: { open: false, handle: false } }); await window.knobs.ready(); ``` every way in puts the api on `window.knobs` while knobs is mounted: the script tag, `mount()` and ``. so does the copy inside the width knob's frame, and the [chrome extension](https://knobs.dev/docs/extension) on any page it runs on. where `window.knobs` is not knobs' api (the page has a `knobs` of its own, or knobs is older than 0.7.1, such as an extension not yet on 0.7.1), use `window.devknobs`, which every copy sets. #### the agent skill the package ships an agent skill that walks an agent through the loop: learn the knobs, set a condition, wait, check the page, grab what is broken, fix it, reset. it is at `node_modules/@vinena/knobs/skills/knobs/SKILL.md` ([on GitHub](https://github.com/vinenastudio/knobs/blob/main/packages/devknobs/skills/knobs/SKILL.md)). copy it into the project's skills to install it, for claude code: ``` mkdir -p .claude/skills && cp -R node_modules/@vinena/knobs/skills/knobs .claude/skills/ ``` ## knobs Chrome extension: the knobs panel on any website URL: https://knobs.dev/docs/extension ### chrome extension #### what it does the same knobs panel on any page you open, with no change to the site's code. the toolbar button opens it, and closing it from there turns knobs off for the tab: every knob back to its default, and a page loaded as another browser loads again. Chrome and Edge only. #### install install it from the [chrome web store](https://chromewebstore.google.com/detail/knobs/cpdmafeojnbdnnhldafobkaajiemcidj). it works in Chrome and Edge. tabs open before the install get the panel at their next load. #### with the npm package the npm package is for your own app, in any browser. the extension is for any site, in Chrome and Edge. if the page runs knobs too, the extension's panel wins, and the page's calls such as `setState` go to it. to try a local build of knobs on your own site, set prefer to page in the panel's settings: the page's copy then runs the panel, with real browser settings off. it needs a page copy newer than 0.5.1 or a local build, and applies to every site in the Chrome profile. the panel's footer says which copy runs it. the edits the Elements view keeps after a reload are in the extension's storage, per page, not in the page's `localStorage`, unless the page's own copy runs the panel (prefer page), which keeps them in the page's `localStorage`. a page script can change them for a short time after you click or press a key on that page, so kept html and attribute edits wait for your click on `apply` in the panel. turn the view's switch off to forget a page's edits; clearing the site's data does not. #### what Chrome sets for real the npm package fakes every knob inside the page. the extension hands these to Chrome instead: - text size: `rem`, `em` and em media queries all follow, with no jump after paint. - offline: requests really fail. - the preferences: color scheme, contrast, reduced motion and reduced transparency. - viewport: a plain size, or a device with no mock or browser drawn around it, becomes the tab's own viewport, with no reload. - user agent: the one you pick in the ua knob goes to the tab's own host, so servers see it too. a device in the frame sends none, so no site signs you out; the frame's page still reads the device's browser. turn on "real phone mode" in the panel's settings to send it with the frame's page loads, so sites serve their mobile site; some sites may sign you out. while text size, offline, a preference or the viewport is set, Chrome shows its "started debugging this browser" bar. to avoid it, turn off "real browser settings" in the panel's settings, and those knobs work in the page as with the npm package. the user agent still reaches servers. #### permissions - `debugger`: the knobs set for real. - `declarativeNetRequestWithHostAccess` and ``: the user agent and framing rules. - `offscreen`: reads your own scheme and motion. - `storage`: each tab's knobs, the real or in-page switch, and the edits pages keep after a reload. - `webNavigation`: drops framing rules when a tab loads another page, and sees the width knob's frame sent to another host of the same site. pages that refuse frames still load in the width knob's frame: while it is open, the extension removes `X-Frame-Options` from that tab's frame loads of the page's host, and `Content-Security-Policy` where its `frame-ancestors` leaves the page out. a site that sends the frame's first load to another host of its own, such as its mobile one for a phone, takes the tab there, with your knobs. later loads sent elsewhere get the notice. ## knobs limits and FAQ: what a page panel cannot fake URL: https://knobs.dev/docs/limits ### limits and faq knobs works from inside the page, so some things stay out of its reach. #### main limits - only same-origin stylesheets can be rewritten. a cross-origin `` keeps its real media behaviour. - a `MediaQueryList` made before knobs mounted gets no change event. reload, or load the [early script](https://knobs.dev/docs/start) first. - the time zone and the clock live in the page. workers, service workers and the server keep the real ones. - the clock moves the time a page reads, not the time that passes. timers keep real time. - the user agent knob changes what page code reads. the server still sees the real `User-Agent`, unless you use the [extension](https://knobs.dev/docs/extension). - the speed knob slows what the Web Animations API sees. a `requestAnimationFrame` loop keeps its own pace. - the touch pointer is made in the page. css `:hover` still follows the mouse, and there is one finger only, with no pinch. - the phone's browser bars do not open their menus, and there is no keyboard. - the phone's browser gives the page Safari's real viewport, but `100svh`, `100lvh`, `100vh` and `clientHeight` follow the frame's height. under the bars the screen is one solid color, not the page itself. edge to edge only works with the phone held sideways. - the frame loads the page a second time, so in-memory state is not shared between the two. #### what only devtools can do - device pixel ratio outside chromium - `forced-colors`, high contrast and print media - trusted touch events and pinch - network throttling and a real offline - the time zone of workers #### faq does it ship to production? not unless you put it there. gate the import itself, since a static import stays in the bundle even behind a dev check. see [start](https://knobs.dev/docs/start). does it need react? no. it is vanilla typescript with zero runtime dependencies. react only adds component names to [grab](https://knobs.dev/docs/grab). does it send data anywhere? no. there is no analytics and no telemetry. see [privacy](https://knobs.dev/docs/privacy). why does my page load twice? the width, height, device and some other knobs render the page in a same-origin frame, which loads it again. ## knobs privacy: what the panel, extension and site collect URL: https://knobs.dev/docs/privacy ### privacy #### the npm package knobs has no analytics and no telemetry, and it sends nothing about you or your page anywhere, but for the page address in send feedback (below). the few requests it makes for itself, such as device images and source maps for grab, never leave the page's origin or the host knobs' script came from. send feedback is the one link that does. - the requests view keeps the last 300 requests in memory. nothing is stored or sent. - what you copy goes to your clipboard and nowhere else. - send feedback opens our feedback page (feedback.vinena.studio) in a new tab with the current page address attached, without its query or fragment; that address reaches us only when you send the feedback. - the clock's "send to server" switch, off at first, adds an `x-knobs-now` header, and the old `x-devknobs-now`, to calls to the page's own origin only. - it keeps its settings in your browser, for the page's origin: the knobs under `knobs` and a few `knobs:` keys (scroll position, locale and reload notes, the last frame's look) in `sessionStorage`, and `knobs:` keys such as the panel's settings, place, shortcuts, colors and storage presets in `localStorage`. each is written under its old name too, `devknobs` or `devknobs:`, and the old name is the one knobs reads. while `keep edits after reload` is on for a page, its edits are there too, under `knobs:edits:` and its path: the page's text, attribute values and markup as edited, up to 64K characters each, at most 200 edits and 256 KB per page, until you turn the switch off or the page is forgotten past 20 pages. forced states are never kept, and edits made in knobs' frame are kept only if it showed the same page (its origin and path) as they were made, and are stored as long as the page's own. kept html and attribute edits are never made on load without your click on `apply`, as a page script could plant them. - the locale knob writes the language into the stores i18n libraries read: the paraglide cookie always, the paraglide and i18next `localStorage` keys and the i18next `sessionStorage` key and cookie only when the page already has them, and `NEXT_LOCALE` on next.js pages or when that cookie exists. it gives each its old value back when you set it to system, within the same tab session only. #### the chrome extension the extension's own code makes no network requests. its device images ship inside it. the panel is knobs, so it loads what the npm package loads, from the page. - session storage, cleared when Chrome closes: each tab's knobs, which host has knobs' frame open in each tab, and each tab's user agent with its page's host. - local storage: the real or in-page switch, and a page's edits while its `keep edits after reload` switch is on, in the extension's own storage and not the page's, at most 200 edits and 256 KB per page, until you turn the switch off or the page is forgotten past 20 pages; clearing the site's data does not remove them. forced states are never kept, and edits made in knobs' frame are kept only if it showed the same page (its origin and path) as they were made, and are stored as long as the page's own. they are written only in the short time after a click or key press of yours on that page, which a page script can use too. html and attribute edits wait for your click on `apply`, and none that could run a script is kept or made. - the panel it puts on a page keeps the same `knobs` and `knobs:` keys in that page's own storage as the npm package does. Chrome's debugger attaches only when you ask for something that needs it, and Chrome shows its bar while it is on. while on, it notes the last few loads of the tab's frames in memory, to say why a frame was refused: the address, redirects, the status, the headers that bear on framing, the `sec-fetch` values sent, why a load failed, and Chrome's console lines about it. to read the `sec-fetch` values it keeps the headers of up to 50 recent requests in memory, cookies and authorization included. those headers are never stored or sent. when a frame is refused, the extension hands the record of that load to the panel in the page, which shows it under the notice, and "copy details" puts it on your clipboard. servers see another user agent only while you set the ua knob yourself or a device makes the whole tab (nothing drawn around it, in real mode); a device in the frame sends none, unless you turn on real phone mode. response headers change only while knobs' frame is open. see [chrome extension](https://knobs.dev/docs/extension) for the permissions. #### knobs.dev only knobs.dev counts visits, with a self-hosted [OpenPanel](https://openpanel.dev/) through the site's own `/api/op`. it records page views, link and button clicks, and the tour's progress. the proxy hands your IP address and user agent to the analytics server, and no cookies. the server logs each request's method, path, status and duration, the Cloudflare request id, and the country, network and data center Cloudflare reports. it logs no IP address, no user agent and no cookies. four of the demo's request buttons leave the site on purpose, and only when pressed: two ask `https://example.com/`, and two ask `https://demo.invalid/`, which never resolves. the demo panel is knobs itself, so it keeps the same `knobs` keys in your browser as above. the site keeps the `PARAGLIDE_LOCALE` cookie for 400 days, `knobs:tour` in `localStorage`, and the storage demo's data only when you press its buttons. questions go to the [GitHub issues](https://github.com/vinenastudio/knobs/issues). ## How to test dark mode, time zones and RTL on your site URL: https://knobs.dev/blog/test-dark-mode-time-zones-rtl ### How to test dark mode, time zones and RTL on your site Updated October 29, 2026 To emulate dark mode, open Chrome DevTools, open the Rendering tab, and set **Emulate CSS media feature prefers-color-scheme** to dark. To change the time zone, give a location a Timezone ID in DevTools Settings > Locations and pick it in the Sensors panel. To test right-to-left, set `dir="rtl"` on the `` element. None of these changes your system settings. Each one applies only to the tab you are inspecting. Below are the exact steps as of October 2026, how to put the same conditions in automated tests, and what each method misses. #### Dark mode: emulate prefers-color-scheme Sites switch to dark styles with the `prefers-color-scheme` media query. You can make a tab report dark without changing your system theme. ##### Chrome and Edge 1. Open DevTools: Command+Option+I on a Mac, Ctrl+Shift+I on Windows and Linux. 2. Press Command+Shift+P (Ctrl+Shift+P) to open the Command Menu, type `rendering`, and choose **Show Rendering**. Or press Esc to open the Drawer and choose **More Tools > Rendering**. 3. Scroll to **Emulate CSS media feature prefers-color-scheme** and pick `prefers-color-scheme: dark`. CSS media rules update at once. A script that read `matchMedia('(prefers-color-scheme: dark)')` only at page load will not see the change, so reload the page. Google's guide also says to reload. The same Rendering tab has the neighbors you will want next: `prefers-reduced-motion`, `prefers-contrast`, `forced-colors` (a stand-in for Windows high contrast) and **Emulate CSS media type** set to print. ##### Firefox In the Inspector, the Rules view toolbar has two buttons that simulate the light and the dark color scheme for the page. The **@** button next to them opens the full emulation panel, which also simulates print media. If `privacy.resistFingerprinting` is on, Firefox forces light, so turn it off to test dark. ##### Safari In Web Inspector's Elements tab, the toggles at the top right of the main area include **Override user preferences**. It opens a popover where you set the color scheme, reduced motion and increased contrast. The overrides last while Web Inspector is open. The **Force print media styles** toggle sits next to it. ##### What to check in dark mode - Images and logos with a transparent background on a dark page. - Form fields, scroll bars and native controls: set `color-scheme: light dark` on `:root`, or they stay light. - Colors set in JavaScript, charts and canvas, which media queries do not reach. - Third-party embeds, which follow their own rules. - Text contrast in both themes, not only the one you designed first. #### Time zones and locale Dates break at time zone edges: a deadline that shows as "tomorrow" in Tokyo, a calendar day that moves at midnight, a daylight saving week. You can test them without changing your computer's clock. ##### Chrome DevTools: Sensors Chrome sets the time zone and the locale together with a location. 1. Open DevTools, then click the gear (Settings) and choose **Locations**. 2. Click **Add location**. 3. Fill in **Location name**, **Latitude**, **Longitude**, **Timezone ID** (an IANA name such as `Asia/Tokyo` or `America/New_York`) and **Locale** (a BCP 47 tag such as `ja-JP` or `ar-EG`). 4. Click **Save**. 5. Press Command+Shift+P, type `sensors`, and choose **Show Sensors**. 6. In the **Location** list, pick your new location. Now check it in the Console: ``` Intl.DateTimeFormat().resolvedOptions().timeZone; // "Asia/Tokyo" new Date().toString(); // local time in Tokyo ``` Limits: - It changes what the page reads, not the time itself. To test "next Monday" you still need to move the clock, which DevTools does not do. - Your server keeps its own zone. A date that the server renders will not move. - The Locale field overrides the locale that `Intl` formatting uses. Check what else follows it on your page: run `navigator.language` in the Console before you rely on it. ##### Your operating system To test the whole browser and every tab, change the zone on the computer. On a Mac: System Settings > General > Date & Time, turn off **Set time zone automatically using your current location**, then choose a city. Remember to turn it back on. #### Right-to-left layouts Arabic, Hebrew, Persian and Urdu read right to left. A layout that looks right in English can put icons, margins and arrows on the wrong side. ##### Flip the direction by hand Browsers have no "emulate RTL" switch. You flip the page yourself: 1. Open DevTools and go to the Elements panel. 2. Double-click the `` tag's attributes and add `dir="rtl"`. Or in the Console: ``` document.documentElement.dir = 'rtl'; document.documentElement.lang = 'ar'; ``` The direction holds until the page reloads or your framework writes `dir` back. If your app sets `lang` and `dir` from its own locale, switch the app's locale instead, so you test the real path. ##### What to check in RTL - Spacing written with `margin-left` and `padding-right` instead of logical properties (`margin-inline-start`, `padding-inline-end`). Physical properties do not flip. - Icons with a direction, such as arrows, "back" and "next", which should mirror. Icons like a clock or a play button should not. - Horizontal carousels and scroll positions, which start on the right. - Numbers, phone numbers, code and URLs inside RTL text, which stay left to right. - Text truncation, `text-align: left` that should be `start`, and focus order. A direction flip with English text finds most layout bugs. Real Arabic or Hebrew text also tests fonts, line height and length. A pseudo-locale, where every string is padded and accented, finds text that is not translated at all. #### The same conditions in automated tests For tests that run on every change, set these per browser context. In Playwright: ``` const context = await browser.newContext({ colorScheme: 'dark', timezoneId: 'Asia/Tokyo', locale: 'ar-EG', }); ``` Playwright's docs say `locale` "emulates the browser locale" and `timezoneId` "emulates the browser timezone", not the test runner's. Playwright does not set `dir`; your app has to do that from the locale, which is what you want to test. Playwright's `page.clock` moves the time for date tests. #### Where knobs fits The steps above are spread across the Rendering tab, a settings page, the Sensors panel and the Console. We make [knobs](https://knobs.dev/), an open source, dev-only panel inside your page that puts them in one place and keeps them across reloads. - **Color scheme.** Light or dark, in your CSS, in `matchMedia` and in `light-dark()`, next to reduced motion, contrast and text size. - **Locale and direction.** Any language tag with a direction. It sets `lang` and `dir` on ``, patches `navigator.language`, makes the tag the default for `Intl`, and writes the tag into the stores that common i18n libraries read (paraglide, i18next, `NEXT_LOCALE`), so your app switches its own language too. - **Time zone and clock.** Any IANA zone, and a clock you can move ahead, freeze or speed up, so "tomorrow 9 AM in Tokyo" is one search away. With "send to server" on, requests to your own origin carry the clock's time in a header your dev server can read. - **Agents.** A coding agent can set `{ scheme: 'dark' }` or a locale through `window.knobs.setState()`, wait with `ready()`, and check the page. See [agents](https://knobs.dev/docs/agents). It has limits: the zone and the clock live in the page, so workers and your server keep the real ones, and `forced-colors` and print still need DevTools. [Limits and FAQ](https://knobs.dev/docs/limits) lists them all. Add it with `npm i -D @vinena/knobs` and mount it in development only, see [start](https://knobs.dev/docs/start), or use the [Chrome extension](https://knobs.dev/docs/extension) on any site. To check the same page at phone sizes, see [how to test your website on mobile devices](https://knobs.dev/blog/test-website-on-mobile-devices). #### FAQ ##### How do I emulate dark mode in Chrome? Open DevTools, press Command+Shift+P (Ctrl+Shift+P on Windows), run Show Rendering, and set Emulate CSS media feature prefers-color-scheme to dark. The page's dark styles apply to that tab only, and your system setting stays as it is. ##### How do I change the time zone in Chrome DevTools? Add a location in DevTools Settings > Locations with a Timezone ID such as Asia/Tokyo, then pick it in the Sensors panel's Location list. The page's Date and Intl now use that zone, in that tab only. ##### How do I test a right-to-left layout? Set `dir="rtl"` on the `` element, in the Elements panel or with `document.documentElement.dir = 'rtl'` in the Console. Then check margins, icons, carets and scroll direction. Real Arabic or Hebrew text also tests fonts and line height, which a direction flip alone does not. ##### Can I test dark mode without changing my system settings? Yes. Chrome, Edge and Firefox DevTools each emulate `prefers-color-scheme` per tab. In automated tests, Playwright's `colorScheme` option does the same per browser context. Your Mac or Windows theme stays as it is. ##### Does the DevTools time zone override affect my server? No. It changes what the page's JavaScript reads. Your server still runs in its own zone, so dates the server renders or computes keep the real time zone. To test both, set the server's zone too, for example with the TZ environment variable. #### Sources - Chrome for Developers: [Rendering tab overview](https://developer.chrome.com/docs/devtools/rendering), [Emulate CSS media features](https://developer.chrome.com/docs/devtools/rendering/emulate-css), [Custom locations](https://developer.chrome.com/docs/devtools/settings/locations), [Sensors](https://developer.chrome.com/docs/devtools/sensors) - Microsoft Learn: [Emulate dark or light schemes in the rendered page](https://learn.microsoft.com/microsoft-edge/devtools-guide-chromium/accessibility/preferred-color-scheme-simulation) - Playwright: [Emulation](https://playwright.dev/docs/emulation) - MDN: [prefers-color-scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme), [dir](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir) - knobs: [knobs](https://knobs.dev/docs/knobs), [limits](https://knobs.dev/docs/limits) ## How to test your website on mobile devices from your desktop URL: https://knobs.dev/blog/test-website-on-mobile-devices ### How to test your website on mobile devices from your desktop Updated October 29, 2026 To test your website on mobile devices from your desktop, open it in Chrome DevTools' device mode (Toggle device toolbar) or Safari's Responsive Design Mode to check the layout at phone sizes, then load it in the iOS Simulator or an Android emulator for a real mobile browser engine. Before you ship, open your local dev server on your own phone over Wi-Fi, because no emulator shows everything. Each method below catches different bugs. We list them from fastest to most real, with the exact steps as of October 2026, and say what each one cannot show you. #### 1. Chrome DevTools device mode This is the quickest check, and it is already in Chrome and Edge. 1. Open your page in Chrome. 2. Open DevTools: Command+Option+I on a Mac, Ctrl+Shift+I on Windows and Linux. 3. Click **Toggle device toolbar** (the phone and tablet icon at the top left of DevTools), or press Command+Shift+M (Ctrl+Shift+M) while DevTools has focus. 4. In the **Dimensions** list at the top of the page, pick a device, or leave it on **Responsive** and drag the handles to any size. 5. Click **Rotate** to switch to landscape. What it changes: the viewport size, the device pixel ratio, the user agent of the preset, and touch input. The **Throttle** list adds slower network and CPU ("Mid-tier mobile", "Low-end mobile"). To add your own phone, open the device list, choose **Edit**, then **Add custom device**. What it does not change: Google's own page calls device mode "a first-order approximation" and says "you don't actually run your code on a mobile device". The page still runs in desktop Chrome. Safari's toolbars, the iOS keyboard, `100vh` behavior on iPhone, and iOS-only bugs do not show up here. Firefox has the same tool: Tools > Browser Tools > **Responsive Design Mode**, or Command+Option+M. #### 2. Safari Responsive Design Mode On a Mac, Safari shows the page with WebKit, the engine that every iPhone browser uses. 1. If you do not see the Develop menu, choose Safari > Settings, click **Advanced**, and turn on **Show features for web developers**. 2. Choose **Develop > Enter Responsive Design Mode** (Control+Command+R). 3. Click a device at the top. Click it again to turn it to landscape. 4. Use the pop-up menus to change the pixel ratio and the user agent. It is closer to an iPhone than Chrome's device mode because the engine is the same, but it is still desktop Safari at a small size. There are no iOS toolbars, no safe areas and no on-screen keyboard. #### 3. Responsive viewer extensions "Responsive viewer" Chrome extensions show your page at several sizes side by side, so you can scroll one and see all of them. They are useful for catching a breakpoint that breaks at one width only. They load each size in a frame of the same desktop Chrome, so they inherit every limit of device mode. Some sites also refuse to load in a frame. Use them for layout, not for real phone behavior. #### 4. iOS Simulator and Android emulator These run the real mobile browser, which is where many bugs live. **iOS Simulator (Mac only):** 1. Install Xcode from the Mac App Store. 2. Choose Xcode > Open Developer Tool > **Simulator**. 3. Pick a device in File > Open Simulator, then open Safari in it. 4. Type your dev server address. The Simulator shares your Mac's network, so `http://localhost:3000` works as is. 5. To inspect, open Safari on the Mac and choose **Develop >** the Simulator's name > your page. **Android emulator:** 1. Install Android Studio and create a virtual device in the Device Manager. 2. Start it and open Chrome. 3. Use `http://10.0.2.2:3000`, not `localhost`. Android's documentation calls `10.0.2.2` the "special alias to your host loopback interface". 4. To inspect, open `chrome://inspect` in desktop Chrome. Simulators show you the real Safari and Chrome toolbars, safe areas, the keyboard and engine-level bugs. They do not show real performance or real touch feel. #### 5. Your real phone, on your local network Nothing replaces the phone in your hand. To open your local dev server on it: 1. Connect the phone and the computer to the same Wi-Fi. 2. Start the dev server so it listens on the network, not only on localhost: - Vite: `npm run dev -- --host`, or `server: { host: true }` in `vite.config`. - Next.js: `next dev -H 0.0.0.0`. 3. Find your computer's address. On a Mac: `ipconfig getifaddr en0`. 4. On the phone, open `http://192.168.1.20:5173` (your address and port). Things that trip people up: - **Next.js blocks it.** Next.js blocks cross-origin requests to dev-only assets by default. Add your address to `allowedDevOrigins` in `next.config.js`, for example `allowedDevOrigins: ['192.168.1.20']`. - **The firewall.** macOS may ask to allow incoming connections for Node. Allow it. - **HTTPS-only features.** Camera, geolocation, service workers and the clipboard need a secure context. `http://192.168.x.x` is not one, while `localhost` is. Use an HTTPS tunnel or a local HTTPS proxy for those. - **Guest or office Wi-Fi.** Many such networks block devices from talking to each other. **Inspect the real phone.** For iPhone: on the phone, turn on Settings > Apps > Safari > Advanced > **Web Inspector** (if your Settings app has no Apps entry, open Safari directly in Settings), connect it to the Mac with a cable, then choose **Develop >** your iPhone > the page in Safari on the Mac. For Android: turn on USB debugging, connect it, and open `chrome://inspect` in desktop Chrome. Its **Port forwarding** option lets the phone open `localhost:3000` from your computer over the cable, with no Wi-Fi setup. #### What emulation cannot fake Keep this list in mind before you trust a desktop check: - **Performance.** A desktop CPU is many times faster; CPU throttling is a rough guess. - **The real browser chrome.** Safari's address bar that shrinks on scroll, and the viewport units (`svh`, `lvh`, `dvh`) that follow it. - **The keyboard.** How a form field, a fixed footer or a chat input moves when the on-screen keyboard opens. - **Real touch.** Pinch, momentum scrolling, and `:hover` that sticks after a tap. - **Hardware.** Camera, sensors, notch and Dynamic Island, low power mode, a bad cell connection. Use desktop tools for most of the work, and keep a real phone for the last pass. #### Where knobs fits We make [knobs](https://knobs.dev/), an open source, dev-only panel that runs inside your own page. It covers the part of this work you do many times a day: looking at a page as a phone without leaving the page. - **Devices in your page.** Pick an iPhone, Pixel, iPad or laptop preset, and the page loads in a real viewport of that size, inside a drawing of the phone with Safari's or Chrome's bars, so media queries and `vw` follow. See [devices](https://knobs.dev/docs/devices). - **The rest of the conditions.** The same panel sets dark mode, reduced motion, text size, locale and right-to-left, time zone and clock, and offline. See [all knobs](https://knobs.dev/docs/knobs). - **Any browser, or any site.** The npm package `@vinena/knobs` works in your own app in any browser, and the [Chrome extension](https://knobs.dev/docs/extension) puts the panel on any site, with the viewport set for real by Chrome. - **For coding agents.** An agent can set a device, wait for the page and grab what broke through `window.knobs`. See [agents](https://knobs.dev/docs/agents). It has the same limit as device mode: it runs in your desktop browser. Our [limits page](https://knobs.dev/docs/limits) lists what it cannot fake, such as real touch with pinch and network throttling. Keep the simulator and your phone for the last pass. To test dark mode, time zones and right-to-left layouts next, see [how to test dark mode, time zones and RTL](https://knobs.dev/blog/test-dark-mode-time-zones-rtl). #### FAQ ##### How can I see what my website looks like on a phone from my computer? Open the site in Chrome, open DevTools with Command+Option+I (Ctrl+Shift+I on Windows), and click Toggle device toolbar. Pick a phone from the Dimensions list. Safari has the same thing under Develop > Enter Responsive Design Mode. Both show the layout at phone size, not a real phone browser. ##### How do I open localhost on my phone? Put the phone on the same Wi-Fi as your computer, start the dev server so it listens on the network (for Vite, `npm run dev -- --host`), find your computer's IP with `ipconfig getifaddr en0` on a Mac, and open `http://:` on the phone. ##### Is Chrome's device mode the same as testing on a real phone? No. Google calls device mode a "first-order approximation". It changes the viewport, pixel ratio, user agent and touch, but the page still runs in desktop Chrome on a desktop CPU. Safari on iPhone has its own engine and its own toolbar behavior, so test there before you ship. ##### Is there a Chrome extension to view a site on several devices at once? Yes, several responsive viewer extensions show a page in many frames side by side. They render each size in an iframe of desktop Chrome, so they share the limits of device mode. They are good for a quick layout check across sizes. ##### Can I test iPhone Safari on Windows? Not with Apple's tools. The iOS Simulator and Safari's Web Inspector run only on a Mac. On Windows you can check layouts in Chrome's device mode or use a paid cloud service with real iPhones. #### Sources - Chrome for Developers: [Simulate mobile devices with device mode](https://developer.chrome.com/docs/devtools/device-mode) and [Remote debug Android devices](https://developer.chrome.com/docs/devtools/remote-debugging) - Apple: [Safari Developer Help, Responsive Design Mode](https://support.apple.com/en-us/guide/safari-developer/dev84bd42758/mac), [Use the developer tools in the Develop menu](https://support.apple.com/guide/safari/use-the-developer-tools-in-the-develop-menu-sfri20948/mac), [Inspecting iOS and iPadOS](https://developer.apple.com/documentation/safari-developer-tools/inspecting-ios) - Android Developers: [Set up Android Emulator networking](https://developer.android.com/studio/run/emulator-networking) - Next.js: [allowedDevOrigins](https://nextjs.org/docs/app/api-reference/config/next-config-js/allowedDevOrigins) - Vite: [server.host](https://vite.dev/config/server-options#server-host) ## Color blindness simulator: emulate vision deficiencies URL: https://knobs.dev/use/color-blindness-simulator ### Color blindness simulator The vision knob shows a page as people with a color vision deficiency see it. It draws an SVG color matrix over the page, from Machado et al. 2009, the same model Chromium DevTools uses. A blur is there too. The filter sits on the frame the page runs in, so fixed elements keep their place and the panel stays readable. #### Turn it on On any site, install the knobs [Chrome extension](https://knobs.dev/docs/extension). It works in Chrome and Edge, with no change to the site's code. In your own app, in any browser, install the package and add the mount line for development only: ``` npm i -D @vinena/knobs npx @vinena/knobs init ``` The init command works in a Next or Vite project. Other setups are in [start](https://knobs.dev/docs/start). Then press `⇧K` to open the panel, press `/` and search for "vision". The knobs live in `sessionStorage`, so they survive reloads and go away with the tab. #### Options The knob takes six values: - `protanopia`, `deuteranopia`, `tritanopia` and `achromatopsia`: a color blindness filter, each from the color matrix. - `blur`: a 2px blur. - `none`: the page as it is. Any value other than `none` brings up the frame, a same-origin iframe and a real viewport. It is the same frame the width, height and device knobs use. The knob works in the page with the npm package and with the extension alike. It is not one of the knobs the extension hands to Chrome. Other knobs next to it: contrast, text size and text spacing. Each one is listed in [every knob](https://knobs.dev/docs/knobs). #### Limits - These six filters are all the knob has. It has no levels for a partial deficiency. - The frame loads the page a second time, so in-memory state, such as a half-filled form, is not shared between the two. #### Drive it from an agent A coding agent can set the knob through any browser tool that runs JavaScript in the page, such as Playwright's `page.evaluate` or the Chrome DevTools MCP's `evaluate_script`: ``` window.knobs.setState({ vision: 'deuteranopia' }); await window.knobs.ready(); ``` `ready()` resolves with the state once the page has caught up with the knobs, the frame included. Then take a screenshot. `setState()` throws a `TypeError` at a value the state does not take, and then changes nothing. `reset()` sets the knobs back. See [agents](https://knobs.dev/docs/agents). Next: change what the page reads with a [user agent switcher](https://knobs.dev/use/user-agent-switcher). ## User agent switcher for Chrome and your own dev app URL: https://knobs.dev/use/user-agent-switcher ### User agent switcher The user agent knob changes the browser the page thinks it runs in. It patches `userAgent`, `appVersion`, `platform`, `vendor` and `maxTouchPoints` on `Navigator.prototype`, and `navigator.userAgentData` with its brands, `mobile`, `platform` and `getHighEntropyValues`, all from the same browser. #### Turn it on On any site, install the knobs [Chrome extension](https://knobs.dev/docs/extension). It works in Chrome and Edge, with no change to the site's code. In your own app, in any browser, install the package and add the mount line for development only: ``` npm i -D @vinena/knobs npx @vinena/knobs init ``` The init command works in a Next or Vite project. Other setups are in [start](https://knobs.dev/docs/start). Then press `⇧K` to open the panel, press `/` and search for "user agent". The knobs live in `sessionStorage`, so they survive reloads and go away with the tab. #### Options The knob takes a preset, a custom string or `system`: - Presets: iPhone Safari, Android Chrome, iPad Safari, Mac Safari, Mac Chrome, Windows Chrome, Windows Edge, Linux Firefox and Googlebot. - Custom: any string. It sets `userAgent` and `appVersion` alone, as Chrome DevTools does. Platform, vendor and touch points stay the browser's. - `system`: every property is the browser's own again. Safari and Firefox have no `userAgentData`, so their presets take it away. The iPad preset is the one iPadOS shows sites by default, a Mac with touch points. With the extension, the user agent you pick goes to the tab's own host, so servers see it too. A device in the frame sends none, so no site signs you out. Turn on "real phone mode" in the panel's settings to send the device's user agent with the frame's page loads, so sites serve their mobile site. Some sites may sign you out then. A device sets the user agent to its own browser too, see [mobile simulator](https://knobs.dev/use/mobile-simulator). Every knob is listed in [every knob](https://knobs.dev/docs/knobs). #### Limits With the npm package, the knob changes what page code reads, not what goes over the wire: - The server still sees the real `User-Agent` header, so a mobile redirect or a bot check on the server does not follow the knob. Use the extension for that. - The `Sec-CH-UA` client hint headers stay real. - Workers and service workers keep the real `navigator`. - Without a frame, code that read the user agent before the knob moved keeps what it read. Reload, or load the early script first, see [start](https://knobs.dev/docs/start). #### Drive it from an agent A coding agent can set the knob through any browser tool that runs JavaScript in the page, such as Playwright's `page.evaluate` or the Chrome DevTools MCP's `evaluate_script`: ``` window.knobs.setState({ ua: { preset: 'googlebot' } }); await window.knobs.ready(); ``` For a string of your own, set `{ ua: { preset: 'custom', custom: 'MyBot/1.0' } }`. `ready()` resolves with the state once the page has caught up with the knobs. `setState()` throws a `TypeError` at a value the state does not take, and then changes nothing. `reset()` sets the knobs back. See [agents](https://knobs.dev/docs/agents). Next: put the page in another city with [fake geolocation](https://knobs.dev/use/fake-geolocation). ## Fake geolocation: spoof navigator.geolocation in a page URL: https://knobs.dev/use/fake-geolocation ### Fake geolocation The geolocation knob gives the page a position of your choice. It patches `navigator.geolocation`, so `getCurrentPosition` and `watchPosition` answer with a city, your own coordinates or a route. Answers come a task later, as on a real device, and active watches hear every move of the knob. #### Turn it on On any site, install the knobs [Chrome extension](https://knobs.dev/docs/extension). It works in Chrome and Edge, with no change to the site's code. In your own app, in any browser, install the package and add the mount line for development only: ``` npm i -D @vinena/knobs npx @vinena/knobs init ``` The init command works in a Next or Vite project. Other setups are in [start](https://knobs.dev/docs/start). Then press `⇧K` to open the panel, press `/` and search for a city, such as "tokyo", or type a position, such as `36.9, 30.7`. The knobs live in `sessionStorage`, so they survive reloads and go away with the tab. #### Options The knob takes four kinds of value: - A city preset. - Custom: a latitude, a longitude and an accuracy of your own. - A route: `lat,lng` per line, or a pasted GPX file. It plays on a loop at a set speed, with `heading` and `speed` in the coordinates and a new position for watches every second. - `system`: the browser's real geolocation. `maximumAge` can hand back the last position, and `timeout: 0` without one fails like a real device. `clearWatch` stops a watch. The geo error knob next to it makes the page get an error instead of a position: `denied`, `unavailable` or `timeout`. The error reads like a `GeolocationPositionError`, with `code`, `message` and the code constants. The error works with the position on `system` too. `navigator.permissions.query({ name: "geolocation" })` reports granted, or denied for `denied`, and fires `change` when the knob moves. The time zone knob follows the city's zone unless you set it, see [time zone and clock](https://knobs.dev/use/time-zone). Every knob is listed in [every knob](https://knobs.dev/docs/knobs). #### Limits - The position lives in the page. The knob is not one of the knobs the extension hands to Chrome, so it works in the page with the npm package and with the extension alike. - A `timeout` error waits for `options.timeout`, and never fires without one, like a fix that never comes. #### Drive it from an agent A coding agent can set the knob through any browser tool that runs JavaScript in the page, such as Playwright's `page.evaluate` or the Chrome DevTools MCP's `evaluate_script`: ``` window.knobs.setState({ geo: { preset: 'custom', lat: 36.9, lng: 30.7 } }); await window.knobs.ready(); ``` To test a refusal, set `{ geo: { error: 'denied' } }`. Object knobs take one field at a time. `ready()` resolves with the state once the page has caught up with the knobs. `setState()` throws a `TypeError` at a value the state does not take, and then changes nothing. `reset()` sets the knobs back. See [agents](https://knobs.dev/docs/agents). Next: run a [reduced motion test](https://knobs.dev/use/reduced-motion). ## Reduced motion test: emulate prefers-reduced-motion URL: https://knobs.dev/use/reduced-motion ### Reduced motion test The reduced motion knob makes the page read `prefers-reduced-motion: reduce`, in your CSS and in `matchMedia`. It rewrites every `prefers-reduced-motion` media rule in the page's own stylesheets, and patches `matchMedia` so JavaScript reads the same value. #### Turn it on On any site, install the knobs [Chrome extension](https://knobs.dev/docs/extension). It works in Chrome and Edge, with no change to the site's code. In your own app, in any browser, install the package and add the mount line for development only: ``` npm i -D @vinena/knobs npx @vinena/knobs init ``` The init command works in a Next or Vite project. Other setups are in [start](https://knobs.dev/docs/start). Then press `⇧K` to open the panel, press `/` and search for "reduced motion". The knobs live in `sessionStorage`, so they survive reloads and go away with the tab. #### Options The knob takes two values: - `reduce`: the page reads `prefers-reduced-motion: reduce`. - `system`: the page reads your real setting. New stylesheets are picked up as they arrive, so the knob keeps working through hot reloads and lazily loaded CSS. A list from `matchMedia` gets a real `change` event when the knob moves its verdict. With the extension, Chrome sets reduced motion for real. While it is set, Chrome shows its "started debugging this browser" bar. To avoid the bar, turn off "real browser settings" in the panel's settings, and the knob works in the page as with the npm package. Two knobs next to it help with motion too: - Animation speed runs every animation at 0.25 or 0.1, or pauses it. CSS animations and transitions are included, in the document and every open shadow root. When `window.gsap` exists, its global timeline follows too. - Replay animations, `⇧R`, runs every animation again. Each one is listed in [every knob](https://knobs.dev/docs/knobs). #### Limits knobs works from inside the page, so some things stay out of its reach: - Only same-origin stylesheets can be rewritten. A cross-origin `` keeps its real media behavior. - A `MediaQueryList` made before knobs mounted gets no change event. Reload, or load the early script first, see [start](https://knobs.dev/docs/start). - The speed knob slows what the Web Animations API sees. A `requestAnimationFrame` loop keeps its own pace, and only the WAAPI-backed animations of Motion slow down. - Scroll-driven animations keep following the scroll. #### Drive it from an agent A coding agent can set the knob through any browser tool that runs JavaScript in the page, such as Playwright's `page.evaluate` or the Chrome DevTools MCP's `evaluate_script`: ``` window.knobs.setState({ motion: 'reduce' }); await window.knobs.ready(); ``` To pause every animation instead, set `{ speed: 0 }`. `ready()` resolves with the state once the page has caught up with the knobs. `setState()` throws a `TypeError` at a value the state does not take, and then changes nothing. `reset()` sets the knobs back. See [agents](https://knobs.dev/docs/agents). Next: run a [dark mode test](https://knobs.dev/use/dark-mode) on the same page. ## Dark mode test: emulate prefers-color-scheme in the page URL: https://knobs.dev/use/dark-mode ### Dark mode test The color scheme knob puts a page in light or dark mode, in your CSS and in `matchMedia`. It rewrites every `prefers-color-scheme` media rule in the page's own stylesheets, and patches `matchMedia` so JavaScript reads the same value. It also sets `color-scheme` on ``, so `light-dark()` flips too. #### Turn it on On any site, install the knobs [Chrome extension](https://knobs.dev/docs/extension). It works in Chrome and Edge, with no change to the site's code. In your own app, in any browser, install the package and add the mount line for development only: ``` npm i -D @vinena/knobs npx @vinena/knobs init ``` The init command works in a Next or Vite project. Other setups are in [start](https://knobs.dev/docs/start). Then press `⇧K` to open the panel, press `/` and search for "color scheme". The knobs live in `sessionStorage`, so they survive reloads and go away with the tab. #### Options The knob takes three values: - `light`: the page reads `prefers-color-scheme: light`. - `dark`: the page reads `prefers-color-scheme: dark`. - `system`: the page reads your real setting. New stylesheets are picked up as they arrive, so the knob keeps working through hot reloads and lazily loaded CSS. A list from `matchMedia` gets a real `change` event when the knob moves its verdict, so `onchange` and `addListener` work. When the page is in a frame (the width, height and device knobs), the browser does the work: the frame's `color-scheme` becomes the framed page's `prefers-color-scheme`, in Chrome 129 and later and Firefox 105 and later. Then cross-origin stylesheets and shadow roots follow too. Safari gets the rewrite. With the extension, Chrome sets the color scheme for real. While it is set, Chrome shows its "started debugging this browser" bar. To avoid the bar, turn off "real browser settings" in the panel's settings, and the knob works in the page as with the npm package. Other knobs next to it: reduced motion, contrast and reduced transparency. Each one is listed in [every knob](https://knobs.dev/docs/knobs). #### Limits knobs works from inside the page, so some things stay out of its reach: - Only same-origin stylesheets can be rewritten. A cross-origin `` keeps its real media behavior. - A `MediaQueryList` made before knobs mounted gets no change event. Reload, or load the early script first, see [start](https://knobs.dev/docs/start). - `forced-colors`, high contrast and print media need devtools. #### Drive it from an agent A coding agent can set the knob through any browser tool that runs JavaScript in the page, such as Playwright's `page.evaluate` or the Chrome DevTools MCP's `evaluate_script`: ``` window.knobs.setState({ scheme: 'dark' }); await window.knobs.ready(); ``` `ready()` resolves with the state once the page has caught up with the knobs. `setState()` throws a `TypeError` at a value the state does not take, and then changes nothing. `reset()` sets the knobs back. See [agents](https://knobs.dev/docs/agents). Next: put the page in another [time zone and clock](https://knobs.dev/use/time-zone). ## Change the time zone and fake the date for testing URL: https://knobs.dev/use/time-zone ### Time zone and clock The time zone knob puts the page in another zone, and the clock knob sets the time it reads. Both replace the page's `Date`. Local getters, `getTimezoneOffset`, `toString` and `toLocale*String` use the zone, and `Date.now()` and `new Date()` read the clock. `Intl.DateTimeFormat` and `Temporal.Now`, where the browser has it, follow too. #### Turn it on On any site, install the knobs [Chrome extension](https://knobs.dev/docs/extension). It works in Chrome and Edge, with no change to the site's code. In your own app, in any browser, install the package and add the mount line for development only: ``` npm i -D @vinena/knobs npx @vinena/knobs init ``` The init command works in a Next or Vite project. Other setups are in [start](https://knobs.dev/docs/start). Then press `⇧K` to open the panel, press `/` and type a zone such as `Europe/Paris`, or a jump such as `+2d`. The knobs live in `sessionStorage`, so they survive reloads and go away with the tab. #### Options The time zone knob takes any IANA zone, `geo` to follow the zone of the geolocation city, or `system`. UTC methods, `toISOString` and `toJSON` are left alone. The clock knob takes a jump from +1 hour to +30 days, or a date and time, in one of two modes: - Offset: the clock runs on from the set instant, at speed 1, 60 or 3600. - Frozen: the clock stays at the set instant. A date built from an argument, such as `new Date(ms)` or a string, names its own instant and is left alone. A reload carries on where the clock was. Turn on "send to server" and `fetch` and `XMLHttpRequest` calls to the page's own origin carry the clock's time, in an `x-knobs-now` header. Read it on your server behind a dev check, see [the clock and your server](https://knobs.dev/docs/knobs#the-clock-and-your-server). Never honor the header in production. The geolocation knob sets a city and its zone together, see [fake geolocation](https://knobs.dev/use/fake-geolocation). #### Limits Both knobs live in the page. They are not among the knobs the extension hands to Chrome, so they work the same with the extension and the npm package: - Workers, service workers and the server keep the real zone and time, so a server rendered date can mismatch on hydration. - The clock moves the time a page reads, not the time that passes. `setTimeout`, `setInterval`, `requestAnimationFrame` and `performance.now()` keep real time. - Code that kept `Date` or `Date.now` from before knobs loaded reads the real time. Load the early script first, see [start](https://knobs.dev/docs/start). - The first page load is a navigation, not a fetch, so it never carries the header. #### Drive it from an agent A coding agent can set the knobs through any browser tool that runs JavaScript in the page, such as Playwright's `page.evaluate` or the Chrome DevTools MCP's `evaluate_script`: ``` window.knobs.setState({ timeZone: 'Asia/Kathmandu', clock: { mode: 'frozen', at: Date.parse('2027-01-01T09:00:00Z') }, }); await window.knobs.ready(); ``` `at` is epoch ms. Set `mode` and `at` in one patch, as a new mode starts from what the clock reads now. `ready()` resolves with the state once the page has caught up with the knobs. `reset()` sets the knobs back. See [agents](https://knobs.dev/docs/agents). Next: test the page's text with [pseudolocalization](https://knobs.dev/use/pseudolocalization). ## Pseudo localization for i18n testing in any web page URL: https://knobs.dev/use/pseudolocalization ### Pseudolocalization The pseudo knob turns the page's text into accented, padded, bracketed strings, such as `[Ŝéţţîñĝš ···]`. It rewrites the text and the `placeholder`, `title`, `aria-label` and `alt` attributes. It waits until the page is loaded and idle, so hydration never sees the change. #### Turn it on On any site, install the knobs [Chrome extension](https://knobs.dev/docs/extension). It works in Chrome and Edge, with no change to the site's code. In your own app, in any browser, install the package and add the mount line for development only: ``` npm i -D @vinena/knobs npx @vinena/knobs init ``` The init command works in a Next or Vite project. Other setups are in [start](https://knobs.dev/docs/start). Then press `⇧K` to open the panel, press `/` and search for "pseudo". The knobs live in `sessionStorage`, so they survive reloads and go away with the tab. #### Options The knob is on or off. - On: the page's text and those attributes get the pseudo strings. New and changed text follows. - Off: the original text comes back, also in nodes the page detached since. Text the page reads back and writes again stays one layer deep. The knob works in the page with the npm package and with the extension alike. It is not one of the knobs the extension hands to Chrome. Use it with the locale knob, which takes any BCP 47 language tag and a direction. The locale knob sets `lang` and `dir` on `` and makes the tag the default locale of every `Intl` service. Both are listed in [every knob](https://knobs.dev/docs/knobs). #### Limits - The knob skips scripts, styles, textareas, contenteditable and options without a value. The text of those is what their form sends. - It also changes data values, such as numbers and names. That is not a bug. #### Drive it from an agent A coding agent can set the knob through any browser tool that runs JavaScript in the page, such as Playwright's `page.evaluate` or the Chrome DevTools MCP's `evaluate_script`: ``` window.knobs.setState({ pseudo: true }); await window.knobs.ready(); ``` `ready()` resolves with the state once the page has caught up with the knobs. The agent skill that ships with the package uses `{ pseudo: true }` to find text that is cut off or not translated. Then the agent can `grab()` the broken elements, fix the code and check again. `reset()` sets the knobs back. See [agents](https://knobs.dev/docs/agents). Next: run an [RTL layout test](https://knobs.dev/use/rtl) on the same page. ## RTL layout test: right to left testing in any web page URL: https://knobs.dev/use/rtl ### RTL layout test The locale knob puts the page in another language tag and direction. It sets `lang` and `dir` on ``, and puts them back if the page writes them over. It also patches `navigator.language` and makes the tag the default locale of every `Intl` service. #### Turn it on On any site, install the knobs [Chrome extension](https://knobs.dev/docs/extension). It works in Chrome and Edge, with no change to the site's code. In your own app, in any browser, install the package and add the mount line for development only: ``` npm i -D @vinena/knobs npx @vinena/knobs init ``` The init command works in a Next or Vite project. Other setups are in [start](https://knobs.dev/docs/start). Then press `⇧K` to open the panel, press `/` and search for "rtl". The knobs live in `sessionStorage`, so they survive reloads and go away with the tab. #### Options The knob takes any BCP 47 language tag, such as `ar` or `pt-BR`, and a direction: - `rtl`: right to left. - `ltr`: left to right. - `system`: the direction comes from the tag, through `Intl.Locale` text info, with `ar`, `he`, `fa` and `ur` as the fallback. The tag and the direction are set apart, so you can pair an English tag with `rtl` and keep text you can read. The knob also writes the tag into the stores i18n libraries read, and reloads the page when it changes: the Paraglide cookie, Paraglide and i18next local storage, and `NEXT_LOCALE` on Next.js pages. Back to `system`, each store gets its old value, unless the page changed it since. The knob works in the page with the npm package and with the extension alike. It is not one of the knobs the extension hands to Chrome. Use it with the pseudo knob, which turns the page's text into accented, padded strings, see [pseudolocalization](https://knobs.dev/use/pseudolocalization). Both are listed in [every knob](https://knobs.dev/docs/knobs). #### Limits - The knob does not translate the page. Text changes only where the page's own i18n library reads the tag. - A call that names its own locale, such as `toLocaleString('en-US')`, keeps it. - In fresh mode, a locale the page keeps in `localStorage` does not follow the knob, see [the panel](https://knobs.dev/docs/panel). #### Drive it from an agent A coding agent can set the knob through any browser tool that runs JavaScript in the page, such as Playwright's `page.evaluate` or the Chrome DevTools MCP's `evaluate_script`: ``` window.knobs.setState({ locale: { lang: 'ar', dir: 'rtl' } }); await window.knobs.ready(); ``` A new tag can reload the page. If it does, the evaluate ends with it: wait for the load, then call `ready()` on the new page. `reset()` sets the knobs back, and can reload the page too. See [agents](https://knobs.dev/docs/agents). Next: open the page on a phone with the [mobile simulator](https://knobs.dev/use/mobile-simulator). ## Mobile simulator in Chrome: iPhone, Pixel and iPad frames URL: https://knobs.dev/use/mobile-simulator ### Mobile simulator The device knob shows the page on a phone, a tablet or a laptop. One pick sets the width, height, device pixel ratio and touch screen of that device. The page runs in a same-origin frame, a real viewport, so media queries, `vw` units and fixed elements follow the device's size. #### Turn it on On any site, install the knobs [Chrome extension](https://knobs.dev/docs/extension). It works in Chrome and Edge, with no change to the site's code. In your own app, in any browser, install the package and add the mount line for development only: ``` npm i -D @vinena/knobs npx @vinena/knobs init ``` The init command works in a Next or Vite project. Other setups are in [start](https://knobs.dev/docs/start). Then press `⇧K` to open the panel, press `/` and search for "iphone", "pixel" or "tablet". The knobs live in `sessionStorage`, so they survive reloads and go away with the tab. #### Options The presets come in six families: iPhone, such as iPhone 18 Pro (402 × 874) and iPhone SE (375 × 667); Pixel, such as Pixel 10 (412 × 924); iPad, such as iPad mini (744 × 1133); MacBook Air 13; laptop; and desktop. The full list is in [devices](https://knobs.dev/docs/devices). - Orientation: `landscape` turns the frame. Type a size such as `390x844` for a custom one. - Mock: a phone or tablet comes up in a mock of its body, with the island or punch hole and the buttons. Every iPhone and Pixel wears its maker's own bezel. - Browser: a phone shows the page in its browser, Safari's bars on an iPhone and Chrome's toolbar on a Pixel. The bars minimize as the page scrolls, or stay one way. - Touch pointer: on a touch device, `(pointer: coarse)` matches and the mouse acts as a finger. A press scrolls and flings, and a tap clicks. - Posture: the iPhone Duo folds, and `unfold` and `fold` open and shut it. A device sets the user agent to its own browser too. The frame reloads when a pick changes the user agent, the touch screen or the ratio. With the extension, a device with no mock or browser drawn becomes the tab's own viewport, with no reload. Turn on "real phone mode" in the panel's settings to send the device's user agent with the frame's page loads, so sites serve their mobile site. #### Limits The page runs in your own browser, in a frame, with the phone drawn around it: - The touch pointer is made in the page. CSS `:hover` still follows the mouse, and there is one finger only, with no pinch. - The phone's browser bars do not open their menus, and there is no keyboard. - `100svh`, `100lvh`, `100vh` and `clientHeight` follow the frame's height. - The frame loads the page a second time, so in-memory state is not shared between the two. - Device pixel ratio works in Chromium only. #### Drive it from an agent A coding agent can set the knob through any browser tool that runs JavaScript in the page, such as Playwright's `page.evaluate` or the Chrome DevTools MCP's `evaluate_script`: ``` window.knobs.setState({ device: 'iphone-17', orientation: 'landscape' }); await window.knobs.ready(); ``` To leave the device, call `reset()` or set `{ device: 'none', width: 'full', height: 'full', dpr: 'system' }`. `device: 'none'` alone keeps the device's size, so the frame stays up. See [agents](https://knobs.dev/docs/agents). Next: check your breakpoints with [window sizes](https://knobs.dev/use/window-sizes). ## Window sizes: a responsive viewer for your breakpoints URL: https://knobs.dev/use/window-sizes ### Window sizes The viewport width and height knobs give the page a viewport of any size, with no change to the browser window. The page runs in a same-origin frame of that size, a real viewport, so media queries, fixed elements, `vw` units and container queries all see it. The other knobs follow the page into the frame. #### Turn it on On any site, install the knobs [Chrome extension](https://knobs.dev/docs/extension). It works in Chrome and Edge, with no change to the site's code. In your own app, in any browser, install the package and add the mount line for development only: ``` npm i -D @vinena/knobs npx @vinena/knobs init ``` The init command works in a Next or Vite project. Other setups are in [start](https://knobs.dev/docs/start). Then press `⇧K` to open the panel, press `/` and type a width such as `390` or `500`. The knobs live in `sessionStorage`, so they survive reloads and go away with the tab. #### Options - Width: a size in px, or `full` for the window. - Height: a size in px, or `full`. With a height, `innerHeight`, `100vh`, `svh`, `dvh` and height media queries see the frame's height. - Orientation: turns a frame that has a width and a height. - Device pixel ratio: 1, 2 or 3, so resolution queries and `srcset` follow. - Zoom: how big the frame is drawn, `fit`, or 50, 75, 100, 125 or 150 percent. The page inside keeps its viewport. A frame wider or taller than the window is scaled down to fit. The readout says the device, the size and the ratio, such as `iPhone 16 Pro · 402 × 874 · 3x`. Meta or Ctrl with `+` and `-` zoom the frame a step, and with `0` fit it again. With the extension, a plain size becomes the tab's own viewport, with no reload. While it is set, Chrome shows its "started debugging this browser" bar. To avoid the bar, turn off "real browser settings" in the panel's settings. For a phone or tablet with its body and browser, see [mobile simulator](https://knobs.dev/use/mobile-simulator). Every knob is listed in [every knob](https://knobs.dev/docs/knobs). #### Limits - knobs shows one frame at a time. It does not show several sizes side by side, so set them one after another. - The frame loads the page a second time, so in-memory state, such as a half-filled form, is not shared between the two. - A page that refuses to be framed with `X-Frame-Options` or `frame-ancestors` gets a notice. The extension removes those headers for the frame's loads of the page's host. - Device pixel ratio outside Chromium needs devtools. #### Drive it from an agent A coding agent can set the knobs through any browser tool that runs JavaScript in the page, such as Playwright's `page.evaluate` or the Chrome DevTools MCP's `evaluate_script`: ``` window.knobs.setState({ width: 390, height: 844 }); await window.knobs.ready(); ``` `ready()` resolves with the state once the frame has caught up. To check several sizes, repeat with each one and take a screenshot after each `ready()`. `setState({ width: 'full', height: 'full' })` or `reset()` gives the page the window back. See [agents](https://knobs.dev/docs/agents). Next: see the page through a [color blindness simulator](https://knobs.dev/use/color-blindness-simulator). ## knobs vs Polypane: price, platform and features compared URL: https://knobs.dev/compare/polypane ### knobs vs Polypane Facts checked on 2026-11-13, from each product's own pages. The sources are at the end. In the tables, "not documented" means the vendor's pages we read do not describe it. It does not mean the feature is missing. #### The two products knobs is a free, open source panel for web developers and designers, under the MIT license. It comes as an npm package that runs inside your own app, in any browser, and as a Chrome extension for any site in Chrome and Edge. See [start](https://knobs.dev/docs/start) and [Chrome extension](https://knobs.dev/docs/extension). Polypane is a desktop app for Windows, macOS and Linux. It has a 14 day free trial with no credit card, then Individual, Business (2 to 20 seats) and Enterprise plans. There is no permanent free plan. Students get it free through the GitHub Student Developer Pack. The structured data on its pricing page lists offers from USD 9 to USD 320. | | knobs | Polypane | | --- | --- | --- | | Price | free | 14 day trial, then paid plans | | Platform | npm package in any browser; extension for Chrome and Edge | desktop app: Windows, macOS, Linux | | Latest release | 0.7.6, November 26, 2026 | v31.0.0, September 29, 2026 | #### Features | Feature | knobs | Polypane | | --- | --- | --- | | Device presets | iPhone, Pixel, iPad and laptop, with maker bezels | yes; device frames not documented | | Several sizes at once | no: one viewport per page | yes: "every breakpoint visible and synchronized" | | Dark mode | yes | yes | | Reduced motion | yes, plus animation speed and replay | yes | | Contrast | `prefers-contrast` and reduced transparency | `prefers-contrast` | | Forced colors | no | yes | | Color blindness simulation | protanopia, deuteranopia, tritanopia, achromatopsia, blur | 9 color blindness types, plus visual impairments | | Text size | browser default font size, text spacing | default font size, text scale | | Locale | any language tag, `Intl` included | browser locale (request and `Intl`), page language | | Right to left | yes | yes | | Pseudolocalization | yes | not documented | | Time zone | any IANA zone | not documented | | Fake date and clock | jump ahead, pick a date, freeze, speed up | not documented | | Geolocation | a city, your own coordinates, a route, errors | not documented | | User agent | yes | yes | | Network throttling | no: offline only, and `navigator.connection` values | Fast 4G, Slow 4G, 3G, offline | | Element copy for agents | html, components and source files | not documented | | Agent access | a window API for Playwright or the Chrome DevTools MCP | MCP through chrome-devtools-mcp on port 5858 | | Runs inside your own page | yes, `npm i -D @vinena/knobs` | no, it is a desktop browser | #### Where knobs is limited - knobs shows one viewport per page. It has no view of several sizes side by side. - knobs has no network throttling. It can make the page read offline (with the extension, requests really fail) and set the values `navigator.connection` reads, without slowing anything down. - `forced-colors` and high contrast mode cannot be set from inside a page. The knobs docs send you to the browser's devtools for them. See [limits](https://knobs.dev/docs/limits). #### When to use which These follow from the facts above: - Polypane is a desktop app that shows many synchronized panes. To see several breakpoints at once, Polypane does that and knobs does not. - knobs runs inside your page as a dev dependency, or on any site through the Chrome extension, so it stays in the browser you test in. Each knob has its own page: [mobile simulator](https://knobs.dev/use/mobile-simulator), [window sizes](https://knobs.dev/use/window-sizes), [dark mode](https://knobs.dev/use/dark-mode), [time zone](https://knobs.dev/use/time-zone), [fake geolocation](https://knobs.dev/use/fake-geolocation) and [pseudolocalization](https://knobs.dev/use/pseudolocalization). Coding agents: see [agents](https://knobs.dev/docs/agents). #### Sources - knobs: [every knob](https://knobs.dev/docs/knobs), [devices](https://knobs.dev/docs/devices), [agents](https://knobs.dev/docs/agents), [limits](https://knobs.dev/docs/limits), [Chrome Web Store listing](https://chromewebstore.google.com/detail/knobs/cpdmafeojnbdnnhldafobkaajiemcidj) - Polypane: [pricing](https://polypane.app/pricing/), [changelog](https://polypane.app/docs/changelog/), [features](https://polypane.app/features/), [emulation](https://polypane.app/docs/emulation/), [device presets](https://polypane.app/docs/device-presets/), [simulators](https://polypane.app/docs/simulators/), [MCP server](https://polypane.app/docs/mcp-server/) ## knobs vs Responsively App: platform and features compared URL: https://knobs.dev/compare/responsively ### knobs vs Responsively App Facts checked on 2026-11-13, from each product's own pages and code. The sources are at the end. In the tables, "not documented" means the project's pages we read do not describe it. It does not mean the feature is missing. "Not found in source" means a search of the main branch of Responsively App's code on 2026-11-13 did not find it. That branch also holds the unreleased v2 beta code. It is our search, not a statement by the project. #### The two products knobs is a free, open source panel for web developers and designers, under the MIT license. It comes as an npm package that runs inside your own app, in any browser, and as a Chrome extension for any site in Chrome and Edge. See [start](https://knobs.dev/docs/start) and [Chrome extension](https://knobs.dev/docs/extension). Responsively App is a free, open source desktop app for Mac, Windows and Linux, under the AGPL-3.0 license. Its "Responsively Helper" browser extensions for Chrome, Firefox and Edge send links to the app. | | knobs | Responsively App | | --- | --- | --- | | Price | free | free | | License | MIT | AGPL-3.0 | | Platform | npm package in any browser; extension for Chrome and Edge | desktop app: Mac, Windows, Linux | | Latest release | 0.7.6, November 26, 2026 | v1.18.0, 2026-02-17; v2.0.0-beta.0 pre-release, 2026-09-20 | #### Features | Feature | knobs | Responsively App | | --- | --- | --- | | Device presets | iPhone, Pixel, iPad and laptop, with maker bezels | "30+ built-in device profiles"; frames in v2 beta | | Several sizes at once | no: one viewport per page | yes: "All Devices at once" | | Dark mode | yes | yes, a color scheme toggle | | Reduced motion | yes, plus animation speed and replay | not found in source | | Contrast and forced colors | `prefers-contrast` and reduced transparency; no forced colors | not found in source | | Color blindness simulation | protanopia, deuteranopia, tritanopia, achromatopsia, blur | deuteranopia, protanopia and more | | Text size | browser default font size, text spacing | not found in source | | Locale | any language tag, `Intl` included | a custom Accept-Language header | | Right to left | yes | not found in source | | Pseudolocalization | yes | not found in source | | Time zone | any IANA zone | not found in source | | Fake date and clock | jump ahead, pick a date, freeze, speed up | not found in source | | Geolocation | a city, your own coordinates, a route, errors | not found in source | | User agent | yes | yes, per device | | Network throttling | no: offline only, and `navigator.connection` values | not found in source | | Element copy for agents | html, components and source files | not documented; its MCP server gives screenshots | | Agent access | a window API for Playwright or the Chrome DevTools MCP | built-in MCP server, `npx -y @responsively/mcp`, in the v2 beta | | Runs inside your own page | yes, `npm i -D @vinena/knobs` | no, it is a desktop browser | #### Where knobs is limited - knobs shows one viewport per page. Responsively App shows all devices at once. - knobs has no network throttling. It can make the page read offline (with the extension, requests really fail) and set the values `navigator.connection` reads. - `forced-colors` cannot be set from inside a page. See [limits](https://knobs.dev/docs/limits). #### When to use which These follow from the facts above: - Responsively App is a desktop app that shows one page on many devices at once. - knobs runs inside your page as a dev dependency, or on any site through the Chrome extension, and has knobs for time zone, clock, geolocation and reduced motion. Each knob has its own page: [mobile simulator](https://knobs.dev/use/mobile-simulator), [reduced motion](https://knobs.dev/use/reduced-motion), [time zone](https://knobs.dev/use/time-zone), [fake geolocation](https://knobs.dev/use/fake-geolocation), [right to left](https://knobs.dev/use/rtl) and [pseudolocalization](https://knobs.dev/use/pseudolocalization). #### Sources - knobs: [every knob](https://knobs.dev/docs/knobs), [devices](https://knobs.dev/docs/devices), [agents](https://knobs.dev/docs/agents), [limits](https://knobs.dev/docs/limits), [Chrome Web Store listing](https://chromewebstore.google.com/detail/knobs/cpdmafeojnbdnnhldafobkaajiemcidj) - Responsively App: [site](https://responsively.app/), [README and code](https://github.com/responsively-org/responsively-app), [releases](https://github.com/responsively-org/responsively-app/releases) ## knobs vs Sizzy: price, platform and features side by side URL: https://knobs.dev/compare/sizzy ### knobs vs Sizzy Facts checked on 2026-11-13, from each product's own pages. The sources are at the end. In the tables, "not documented" means the vendor's pages we read do not describe it. It does not mean the feature is missing. #### The two products knobs is a free, open source panel for web developers and designers, under the MIT license. It comes as an npm package that runs inside your own app, in any browser, and as a Chrome extension for any site in Chrome and Edge. See [start](https://knobs.dev/docs/start) and [Chrome extension](https://knobs.dev/docs/extension). Sizzy is a desktop app for macOS (Apple silicon and Intel), Windows and Linux. It costs $15 a month, $144 a year or $499 for a lifetime license. Its pricing says: "There is no free tier and no trial". | | knobs | Sizzy | | --- | --- | --- | | Price | free | $15 a month, $144 a year, $499 lifetime | | Platform | npm package in any browser; extension for Chrome and Edge | desktop app: macOS, Windows, Linux | | Latest release | 0.7.6, November 26, 2026 | not documented; the homepage names Sizzy 74 | #### Features | Feature | knobs | Sizzy | | --- | --- | --- | | Device presets and frames | iPhone, Pixel, iPad and laptop, with maker bezels | yes: "Device frames, minimal headers, custom devices" | | Several sizes at once | no: one viewport per page | yes: "Real device sizes side by side" | | Dark mode | yes | yes | | Reduced motion | yes, plus animation speed and replay | not documented | | Contrast and forced colors | `prefers-contrast` and reduced transparency; no forced colors | not documented | | Color blindness simulation | protanopia, deuteranopia, tritanopia, achromatopsia, blur | not documented | | Text size | browser default font size, text spacing | zoom per device | | Locale | any language tag, `Intl` included | yes | | Right to left | yes | not documented | | Pseudolocalization | yes | not documented | | Time zone | any IANA zone | not documented | | Fake date and clock | jump ahead, pick a date, freeze, speed up | not documented | | Geolocation | a city, your own coordinates, a route, errors | not documented | | User agent | yes | yes: "real viewports and user agents" | | Network throttling | no: offline only, and `navigator.connection` values | yes | | Element copy for agents | html, components and source files | in-app agents get screenshots from your devices | | Agent access | a window API for Playwright or the Chrome DevTools MCP | runs Claude Code or Codex CLI inside the app, with MCP servers and skills; no external MCP server documented | | Runs inside your own page | yes, `npm i -D @vinena/knobs` | no, it is a desktop browser | #### Where knobs is limited - knobs shows one viewport per page. Sizzy shows device sizes side by side. - knobs has no network throttling. It can make the page read offline (with the extension, requests really fail) and set the values `navigator.connection` reads. Sizzy lists network throttling. - `forced-colors` cannot be set from inside a page. See [limits](https://knobs.dev/docs/limits). #### When to use which These follow from the facts above: - Sizzy is a paid desktop app that shows many devices side by side and runs coding agents inside the app. - knobs is free and runs inside your page as a dev dependency, or on any site through the Chrome extension. A coding agent drives it through the browser tool it already uses. See [agents](https://knobs.dev/docs/agents). Each knob has its own page: [mobile simulator](https://knobs.dev/use/mobile-simulator), [window sizes](https://knobs.dev/use/window-sizes), [color blindness simulator](https://knobs.dev/use/color-blindness-simulator), [time zone](https://knobs.dev/use/time-zone) and [fake geolocation](https://knobs.dev/use/fake-geolocation). #### Sources - knobs: [every knob](https://knobs.dev/docs/knobs), [devices](https://knobs.dev/docs/devices), [agents](https://knobs.dev/docs/agents), [limits](https://knobs.dev/docs/limits), [Chrome Web Store listing](https://chromewebstore.google.com/detail/knobs/cpdmafeojnbdnnhldafobkaajiemcidj) - Sizzy: [site](https://sizzy.co/), [pricing](https://sizzy.co/pricing), [llms-full.txt](https://sizzy.co/llms-full.txt) ## knobs vs Responsive Viewer: two Chrome extensions compared URL: https://knobs.dev/compare/responsive-viewer ### knobs vs Responsive Viewer Facts checked on 2026-11-13, from each product's own pages. The sources are at the end. We read Responsive Viewer's site and store page; we did not install it. Several other Chrome Web Store extensions use the same name. This page is about the one from responsiveviewer.org. In the tables, "not documented" means the project's pages we read do not describe it. It does not mean the feature is missing. #### The two products knobs is a free, open source panel for web developers and designers, under the MIT license. It comes as an npm package that runs inside your own app, in any browser, and as a Chrome extension for any site in Chrome and Edge. See [start](https://knobs.dev/docs/start) and [Chrome extension](https://knobs.dev/docs/extension). Responsive Viewer is a Chrome extension, open source under the MIT license. It is free to add. A "Professional" plan, $4.99 monthly or $3.99 yearly, removes ads and adds all mockups, all screens and annotations. | | knobs | Responsive Viewer | | --- | --- | --- | | Price | free | free; Professional plan $4.99 monthly or $3.99 yearly | | License | MIT | MIT | | Platform | npm package in any browser; extension for Chrome and Edge | Chrome extension | | Latest release | 0.7.6, November 26, 2026 | store version 1.1.25, August 12, 2026 | #### Features | Feature | knobs | Responsive Viewer | | --- | --- | --- | | Device presets and frames | iPhone, Pixel, iPad and laptop, with maker bezels | yes: "real screen mockups" | | Several sizes at once | no: one viewport per page | yes: multi-screen preview, with synced scroll and navigation | | Dark mode | yes | not documented | | Reduced motion | yes, plus animation speed and replay | not documented | | Contrast and forced colors | `prefers-contrast` and reduced transparency; no forced colors | not documented | | Color blindness simulation | protanopia, deuteranopia, tritanopia, achromatopsia, blur | not documented | | Text size | browser default font size, text spacing | not documented | | Locale and right to left | any language tag and direction, `Intl` included | not documented | | Pseudolocalization | yes | not documented | | Time zone and clock | any IANA zone; jump ahead, pick a date, freeze, speed up | not documented | | Geolocation | a city, your own coordinates, a route, errors | not documented | | User agent | yes | not documented | | Network throttling | no: offline only, and `navigator.connection` values | not documented | | Element copy for agents | html, components and source files | not documented | | Agent access | a window API for Playwright or the Chrome DevTools MCP | not documented | | Runs inside your own page | yes, `npm i -D @vinena/knobs` | no, it is an extension | #### Where knobs is limited - knobs shows one viewport per page. Responsive Viewer shows several screens at once and keeps their scroll and navigation in sync. - knobs has no network throttling. It can make the page read offline (with the extension, requests really fail) and set the values `navigator.connection` reads. - `forced-colors` cannot be set from inside a page. See [limits](https://knobs.dev/docs/limits). #### When to use which These follow from the facts above: - Both are Chrome extensions. To see one page on several screens at once, Responsive Viewer does that and knobs does not. - knobs is one viewport with knobs for look, locale, time, place and the user agent. It also comes as an npm package for your own app in any browser. Each knob has its own page: [mobile simulator](https://knobs.dev/use/mobile-simulator), [window sizes](https://knobs.dev/use/window-sizes), [dark mode](https://knobs.dev/use/dark-mode), [user agent switcher](https://knobs.dev/use/user-agent-switcher) and [time zone](https://knobs.dev/use/time-zone). #### Sources - knobs: [every knob](https://knobs.dev/docs/knobs), [devices](https://knobs.dev/docs/devices), [limits](https://knobs.dev/docs/limits), [Chrome Web Store listing](https://chromewebstore.google.com/detail/knobs/cpdmafeojnbdnnhldafobkaajiemcidj) - Responsive Viewer: [site](https://responsiveviewer.org/), [Chrome Web Store listing](https://chromewebstore.google.com/detail/responsive-viewer/inmopeiepgfljkpkidclfgbgbmfcennb), [code](https://github.com/skmail/responsive-viewer) ## knobs vs Chrome DevTools device mode and emulation compared URL: https://knobs.dev/compare/chrome-devtools ### knobs vs Chrome DevTools Facts checked on 2026-11-13, from each product's own pages. The sources are at the end. In the tables, "not documented" means the Chrome DevTools pages we read do not describe it. It does not mean the feature is missing. #### The two products knobs is a free, open source panel for web developers and designers, under the MIT license. It comes as an npm package that runs inside your own app, in any browser, and as a Chrome extension for any site in Chrome and Edge. See [start](https://knobs.dev/docs/start) and [Chrome extension](https://knobs.dev/docs/extension). Chrome DevTools is free and part of Chrome, on every desktop system Chrome runs on. Its frontend is open source under the BSD-3-Clause license. | | knobs | Chrome DevTools | | --- | --- | --- | | Price | free | free, part of Chrome | | License | MIT | frontend under BSD-3-Clause | | Platform | npm package in any browser; extension for Chrome and Edge | Chrome on desktop | | Latest release | 0.7.6, November 26, 2026 | ships with Chrome; Stable 158.0.8127.37 on Mac, 2026-11-12 | #### Features | Feature | knobs | Chrome DevTools | | --- | --- | --- | | Device presets and frames | iPhone, Pixel, iPad and laptop, with maker bezels | presets in the Dimensions list; "Show device frame", art missing for some devices | | Several sizes at once | no: one viewport per page | one resizable viewport | | Dark mode | yes | yes, Rendering tab | | Reduced motion | yes, plus animation speed and replay | yes | | Contrast and forced colors | `prefers-contrast` and reduced transparency; no forced colors | `forced-colors`, `prefers-contrast`, `prefers-reduced-transparency` | | Vision simulation | protanopia, deuteranopia, tritanopia, achromatopsia, blur | blurred vision, reduced contrast, protanopia, deuteranopia, tritanopia, achromatopsia | | Text size | browser default font size, text spacing | not documented | | Locale | any language tag, `Intl` included | a Locale field in a custom location | | Right to left | yes | not documented | | Pseudolocalization | yes | not documented | | Time zone | any IANA zone | a Timezone ID in a custom location | | Fake date and clock | jump ahead, pick a date, freeze, speed up | not documented | | Geolocation | a city, your own coordinates, a route, errors | yes, Sensors | | User agent | yes | yes, Network conditions | | Network throttling | no: offline only, and `navigator.connection` values | Fast 3G, Slow 3G, offline, custom profiles | | Element copy for agents | html, components and source files | AI assistance chats about a selected element; needs sign-in, age 18 or over, a supported location, off by default | | Agent access | a window API for Playwright or the Chrome DevTools MCP | chrome-devtools-mcp (Apache-2.0), whose `emulate` tool sets color scheme, forced colors, geolocation, network conditions and CPU | | Runs inside your own page | yes, `npm i -D @vinena/knobs` | no, it is part of the browser | #### Where knobs is limited - knobs has no network throttling and no `forced-colors`. Chrome DevTools has both. - The knobs docs list what only the browser's devtools can do: device pixel ratio outside Chromium, `forced-colors`, high contrast and print media, trusted touch events and pinch, network throttling and a real offline, and the time zone of workers. See [limits](https://knobs.dev/docs/limits). #### How they work together These follow from the facts above: - The knobs extension hands some knobs to Chrome itself: text size, offline, color scheme, contrast, reduced motion, reduced transparency, the viewport and the user agent. See [Chrome extension](https://knobs.dev/docs/extension). - A coding agent can drive knobs through the Chrome DevTools MCP's `evaluate_script`. See [agents](https://knobs.dev/docs/agents). Each knob has its own page: [mobile simulator](https://knobs.dev/use/mobile-simulator), [dark mode](https://knobs.dev/use/dark-mode), [reduced motion](https://knobs.dev/use/reduced-motion), [time zone](https://knobs.dev/use/time-zone), [fake geolocation](https://knobs.dev/use/fake-geolocation) and [user agent switcher](https://knobs.dev/use/user-agent-switcher). #### Sources - knobs: [every knob](https://knobs.dev/docs/knobs), [Chrome extension](https://knobs.dev/docs/extension), [agents](https://knobs.dev/docs/agents), [limits](https://knobs.dev/docs/limits), [Chrome Web Store listing](https://chromewebstore.google.com/detail/knobs/cpdmafeojnbdnnhldafobkaajiemcidj) - Chrome DevTools: [device mode](https://developer.chrome.com/docs/devtools/device-mode), [emulate CSS media features](https://developer.chrome.com/docs/devtools/rendering/emulate-css), [rendering effects](https://developer.chrome.com/docs/devtools/rendering/apply-effects), [locations](https://developer.chrome.com/docs/devtools/settings/locations), [sensors](https://developer.chrome.com/docs/devtools/sensors), [user agent](https://developer.chrome.com/docs/devtools/device-mode/override-user-agent), [AI assistance](https://developer.chrome.com/docs/devtools/ai-assistance), [frontend code](https://github.com/ChromeDevTools/devtools-frontend), [chrome-de