0.0.0-rc.3 • Published 4 years ago

@wedgekit/templates v0.0.0-rc.3

Weekly downloads
9
License
MIT
Repository
-
Last release
4 years ago

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.

PropsTypeRequired?DefaultDescription
settingsObjectA settings object built according to the Template settings spec (doc TBD)
componentsObject<[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.
externalOptionsObject<[key: string]: any>