Skip to content
feega
star on github download

Focus on a component

Open a component in its own view tab and try its props and variants.

Select an element inside a component and press F, or use the focus action on its row in Layers. The component opens in the same tab, in place of the page.

While a component is focused, its zoom and transparent canvas controls sit in the strip at the bottom of the preview, next to Design, Navigate, undo and redo.

Real component: React, Vue, Svelte, Next.js, Nuxt and Astro

Section titled “Real component: React, Vue, Svelte, Next.js, Nuxt and Astro”

The tab renders the real component, served by your own dev server: Vite, Nuxt and Astro serve it from a page of their own, and Next.js reopens your page inside the tab and renders the component the page already has. React and Vue start from the props the instance has on the page. Svelte and Astro read them from the tag that renders the instance: literal values (strings, numbers, booleans, arrays, objects, dates) are shown, and a prop passed as an expression keeps its default and is marked dynamic. Edits in the tab land in the source like edits on the page, and Vite hot reloads the tab.

The right bar gets a Props section at the top:

Prop typeControl
Union of literals ('sm' | 'lg', 1 | 2 | 3)Select
BooleanToggle
StringText field
String named like a color (color, fill, background) or holding oneText field with a color picker
NumberNumber field
Array, tupleJSON field
Object, record, interfaceJSON field
DateDate field
CallbackRead-only, replaced by a no-op
children, ReactNode, Snippet, VNodeText field

A prop the instance passes as JSX shows a read-only JSX chip. A star marks a required prop. A JSON field keeps the last valid value and flags text that does not parse or has the wrong shape.

Props are read from the types in the source with the same rules in every framework: the props type of a React component (or its PropTypes), defineProps<{ ... }>() in Vue (also the object and array forms, PropType casts and factory defaults), the destructured $props() in Svelte 5, and interface Props with Astro.props in the frontmatter of an Astro component. Defaults come from the destructuring or withDefaults. A type that is declared in another file resolves in React; in Vue, Svelte and Astro a type imported from another file shows a JSON field.

In Next.js the controls are read from the source too, by the same loader that tags your elements, so selects appear there as well. A prop the source does not describe but the page passes still gets a control.

Apply to page writes the props you changed into the tag that renders the focused instance, so the page ends up as the tab shows it. It appears in Changes and can be undone. Only edited props are written; one set back to its default removes the attribute. Each framework gets its own syntax: prop="text" or prop={value} in React, Svelte and Astro, and prop="text" or :prop="value" in Vue. Arrays, objects and dates are written as expressions. Callbacks and children are never written, and the panel names them. If the tag spreads props or renders in a loop, Feega shows the diff and asks first, as with other edits of unknown scope. A prop passed as an expression such as title={post.title} is never replaced by fixed text: when it resolves to a string in the repo, a constant or an object entry, even in another file, Feega writes the new value there; otherwise it refuses and names where the value comes from. Select the instance on the page before focusing it: from the Layers list Feega does not know where it is used, and the button stays off.

Variants shows every combination of the select and toggle props in a grid, one prop across the columns and the rest down the rows. Numeric selects vary by their numbers. The grid holds at most 24 combinations. When there are more, the last props are left out and the bar says which. Hover, focus and disabled simulation works on every cell.

In React the component is wrapped in the providers around your app in the entry file (the render call in main.tsx), such as a theme, router or query client. Vue and Svelte have no providers: a component that needs a plugin such as a router or store shows the snapshot.

If the component cannot render alone, for example because its provider lives inside App, the tab shows a snapshot of the page instead, and says why in the bottom bar, on the info icon: a provider or context is missing, the component is not exported or failed to load, it rendered nothing in time, Turbopack cannot mount components, the dev server has no Feega mount page, or the framework cannot mount alone. The snapshot has no props section.

The component sits on one of two neutral greys: a dark grey when the background behind the instance on your page is dark, a light grey otherwise, so white text on a dark site stays readable. The checkerboard button in the bottom bar switches to a transparent checkerboard instead.

The sun, moon and monitor buttons in the toolbar switch the component between light, dark and the device scheme, the same as for the page, and the canvas follows between the two greys. A dark class or attribute of your project is set on the component, and prefers-color-scheme is emulated in the tab.

The component opens at its real size, centered. Use Fit, minus, plus and the percentage (it resets to 100%) in the bottom bar, or Cmd or Ctrl with the mouse wheel, or pinch on a trackpad. Variants show at the same zoom.

The real component also gets the page’s fonts, stylesheets, html and body classes and inherited text styles, so text matches the page.

Next.js needs the webpack dev server (next dev, not --turbopack) and withFeegaSource in next.config, or Feega starting the server for you. The tab loads your page, hides it and renders the component in a root of its own, so global styles and fonts apply. Props start from what the instance has on the page. The providers in layout are not applied: a component that needs one shows the snapshot.

Vue components in Nuxt work as in Vue on Vite, with props read from defineProps. Nuxt components that use composables such as useRoute or useFetch show the snapshot.

An .astro component is rendered by your dev server with Astro’s container, including its scoped styles. Props are read from the tag that renders it. React, Vue and Svelte components used as islands work as in Vite, with props read from the instance when it is hydrated.

React Router shows the snapshot: a copy of the live instances, kept in sync with the page.