Skip to main content

SurfaceProvider

SurfaceProvider(props): Element

Provider for a Surface. You can use this at some high level in your UI - some common parent component between the parent of where you want to put a Surface and where you want put other components that will need to reference it. Whenever a SurfaceComponent is declared as a descendant of this provider, the provider's underlying surface is set and this is propagated to all the other components using this context. To use this you just declare a SurfaceProvider element and put some children inside of it:

<SurfaceProvider>
<SurfaceComponent renderOptions={...}/>
<Palette/>
<div>
<MiniviewComponent/>
</div>
</SurfaceProvider>

Parameters

props

children?

ReactNode | ReactElement<any, any> | ReactNode | ReactElement<any, any>[]

Returns

Element