Skip to content

UI kit ​

In Frame, a UI kit is everything the editor offers that comes from your theme: the design tokens, the components, the features editors may use on them, and the widths of the page. Frame has no look of its own. Bring a kit, and editors build pages from it; change the kit, and every page follows.

A kit lives in a subtheme of the Frame theme. Frame reads it from the active theme and its base themes, so a subtheme changes only what differs.

PartWhereIs
Tokensframe_editor: uikit: in the theme's .info.ymlthe spacing scale, type scale, sizes, palette, border widths, radii, image styles: the only values editors can pick
Layout widthsframe_editor: uikit: layout:the content width of a page and the wide width, for the Width feature
Featuresframe_editor: features:, and thirdPartySettings.frame_editor.features of a componentwhich sections of Layout and style editors get, per theme and per component
Componentscomponents/ of the themeSingle Directory Components: each is a block of the editor, its props are fields, its slots take other components
Breakpoints<theme>.breakpoints.ymlthe widths of the preview, and the breakpoints at which layout and style can differ
CSSthe theme's libraries and the CSS of each componentthe look; the same on the page and on the canvas

The pages of this section ​

PageAbout
Design tokensmap the tokens of your design to Frame, and use them in SCSS
Iconsicon packs of Drupal's Icon API (<theme>.icons.yml) and icon fonts for icon props
Your componentsbring your own components: groups, replacing the base theme's, features per component
Settings referenceevery key of frame_editor in the .info.yml, with its default
A CSS frameworkwire components built on Bootstrap, Tailwind or another framework
Scripts, web components and theme filesbehaviors for scripts that run at page load, custom elements in a template, files of the theme in Twig, the prop variant, rich text and its text format
Test your kitcheck that the kit works in the editor and on the page

The details behind them: Tokens, features and styling and Components for the editor.

In short ​

  1. Make a subtheme of the Frame theme (Create a subtheme). The starterkit writes a frame_editor: block with default tokens into its .info.yml.
  2. Put the values of your design into that block: spacing, type scale, palette, sizes, borders, radii.
  3. Add your components to components/ of the theme. A component prints {{ attributes }} on its root element, so the features reach it.
  4. Switch off features where a component draws its own: thirdPartySettings.frame_editor.features.
  5. drush cr, open a page in the editor, and test.

Limitations ​

  • Only components of the active theme and its base themes are offered. Components of modules are not: wrap one in a component of your theme if editors need it.
  • Components with status: obsolete are not offered; noUi: true hides one entirely.
  • A scale or a palette is replaced as a whole by a subtheme, not merged by name.
  • Editors cannot type a colour or CSS: what the kit does not declare cannot be chosen.
  • The editor runs in a page of your theme, so very broad global rules (button, label, *) also reach its controls.