@wedgekit/templates
v0.0.0-rc.3
Published
A core component of the WedgeKit Design System is templating.
Downloads
5
Maintainers
Keywords
Readme
WedgeKit Templates
A core component of the WedgeKit Design System is templating.
Usage
import Template from '@wedgekit/templates';
import pageSettings from './page.json';
import InstallerPicker from './installers/picker';
const Page = () => {
<Layout>
<Template
settings={pageSettings}
components={{
installer: () => (<InstallerPicker />),
}}
/>
</Layout>
};
API
Template
The Template component utilizes a combination of @wedgekit/layout and @wedgekit/form under the hood to created a fully generated blackbox UI.
| Props | Type | Required? | Default | Description |
| --------------- | ----------------------------------------------- | --------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| settings | Object
| ✅ | | A settings object built according to the Template settings spec (doc TBD) |
| components | Object<[key: string]: () => React$Element<*>>
| ❌ | {}
| A settings object can have a "generic" or "placeholder" field applied, allowing a developer to assign and control that field with a custom component. While no props are currently passed through this prop, each item should be treated as a Render Prop. Note, this will only map to fields explicitly declared as "placeholder" in the settings object. |
| externalOptions | Object<[key: string]: any>
|