Element
A component for embedding arbitrary HTML elements into a pane.
Any children wrapped in this component will be rendered into the pane. Any content larger than the pane in the horizontal axis will be clipped.
Useful for quickly prototyping UIs, or adding content to a pane that's not easily represented by the built-in components.
This component does not have a direct analog in the vanilla Tweakpane universe.
Think of <Element>
as an escape hatch for getting something into the pane that you couldn't otherwise. Generally, it's recommended to abstract new functionality for reuse by extending one of the internal component types in Svelte Tweakpane UI, or better yet by creating a new Tweakpane Plugin — but sometimes you just need to get something into the pane quickly.
In many cases, this component should not be necessary because Svelte Tweakpane UI already makes it easy to combine tweakpane components with other inline elements simply by using stand-alone components or a <Pane position="inline">
component. <Element>
should generally be the most useful when you're using <Pane position="draggable">
or <Pane position="fixed">
and you want a custom element embedded in the pane.
Usage outside of a <Pane>
component doesn't make a ton of sense, but in such a case the <Element>
will be implicitly wrapped in <Pane position="inline">
.
optional | |
Description | Maximum height of the element block, in pixels. By default, the element block will expand vertically to fit its contents, but clip any horizontal excess. If a max height is set, it is used as the component height during SSR. If the actual element content is less than the max, you will see CLS. If it is not set, the contents are rendered... but keep in mind that style and other contextual changes during the client render could result in CLS. |
---|---|
Type | number |
Default | undefined No max height. |
optional | |
Description | Whether to reset the CSS of the element block to its default values. Avoids inheritance of Tweakpane's CSS styles. Note that this uses a simple |
---|---|
Type | boolean |
Default | true |
optional | |
Description | Custom color scheme. |
---|---|
Type | Theme |
Default | undefined Inherits default Tweakpane theme equivalent to ThemeUtils.presets.standard , or the theme set with setGlobalDefaultTheme() . |
Description | Any HTML Element. |
---|---|
Type | {} |