Graphite/frontend/src/components
Keavon Chambers ab822afae4
Implement window-controls-overlay PWA window frameless mode (#3986)
* Implement window-controls-overlay PWA window frameless mode

* Avoid warning
2026-04-02 18:17:36 -07:00
..
floating-menus Improve PWA support with service worker-based offline caching (#3985) 2026-04-02 18:14:40 -07:00
layout Rename /frontend/wasm -> /frontend/wrapper (#3927) 2026-03-21 03:46:47 -07:00
panels Add Layers panel support for displaying multiple groups with instances of the same children layers (#3982) 2026-04-01 00:13:42 -07:00
views Rename /frontend/wasm -> /frontend/wrapper (#3927) 2026-03-21 03:46:47 -07:00
widgets Fix an assortment of small bugs (#3968) 2026-03-28 17:12:13 -07:00
window Implement window-controls-overlay PWA window frameless mode (#3986) 2026-04-02 18:17:36 -07:00
Editor.svelte Rename /frontend/wasm -> /frontend/wrapper (#3927) 2026-03-21 03:46:47 -07:00
README.md Refactor the TypeScript data flow for full type safety and auto-generation of Rust types (#3865) 2026-03-09 16:35:04 -07:00

README.md

Overview of /frontend/src/components/

Each component represents a (usually reusable) part of the Graphite editor GUI.

Floating Menus: floating-menus/

The temporary UI areas with dark backgrounds which hover over the top of the editor window content. Examples include menu lists, popovers, and dialogs.

Layout: layout/

Useful containers that control the flow of content held within.

Panels: panels/

The dockable tabbed regions like the Document, Properties, Layers, Data, and Welcome panels.

Views: views/

Content views rendered within panels, such as the node graph.

Widgets: widgets/

The interactive input items used to display information and provide user control.

Window: window/

The building blocks for the Title Bar, Workspace, and Status Bar within an editor application window.

Svelte tips and tricks

This section contains a growing list of quick reference information for helpful Svelte solutions and best practices. Feel free to add to this to help contributors learn things, or yourself remember tricks you'll likely forget in a few months.

Bi-directional props

The component declares this:

// The dispatcher that sends the changed value as a custom event to the parent
const dispatch = createEventDispatcher<{ theBidirectionalProperty: number }>();

// The prop
export let theBidirectionalProperty: number;

// Called only when `theBidirectionalProperty` is changed from outside this component via its props
$: console.log(theBidirectionalProperty);

// Example of a method that would update the value
function doSomething() {
	dispatch("theBidirectionalProperty", SOME_NEW_VALUE);
},

Users of the component do this for theCorrespondingDataEntry to be a two-way binding:

let theCorrespondingDataEntry = 42;
<DropdownInput
	theBidirectionalProperty={theCorrespondingDataEntry}
	on:theBidirectionalProperty={({ detail }) => { theCorrespondingDataEntry = detail; }}
/>