Skip to content
PlaygroundForm Builder
Terminal window
npm i @sjsf-lab/beercss-theme

Required peer dependencies: @sjsf/form@3.5.0 beercss@4.0.0 svelte@5.34.8

Import the Beer CSS stylesheet:

import "beercss/dist/cdn/beer.css";

You can connect extra widgets using the following include imports:

// Used by default in the following fields: multiEnumField
import "@sjsf-lab/beercss-theme/extra-widgets/checkboxes-include"
import "@sjsf-lab/beercss-theme/extra-widgets/date-picker-include"
// Used by default in the following fields: fileField, filesField, arrayFilesField, nativeFileField, nativeFilesField, arrayNativeFilesField
import "@sjsf-lab/beercss-theme/extra-widgets/file-include"
import "@sjsf-lab/beercss-theme/extra-widgets/radio-include"
import "@sjsf-lab/beercss-theme/extra-widgets/range-include"
import "@sjsf-lab/beercss-theme/extra-widgets/switch-include"
import "@sjsf-lab/beercss-theme/extra-widgets/textarea-include"

checkbox oninput, onchange, onblur
checkboxes
file onchange, onblur
multiFile onchange, onblur
number oninput, onchange, onblur
select oninput, onchange, onblur
text oninput, onchange, onblur
datePicker oninput, onchange, onblur
radio
range oninput, onchange, onblur
switch oninput, onchange, onblur
textarea oninput, onchange, onblur
import type { ButtonType, LayoutType } from "@sjsf/form/fields/components";
import type {
HTMLAttributes,
HTMLButtonAttributes,
HTMLFormAttributes,
HTMLInputAttributes,
HTMLOutputAttributes,
HTMLLabelAttributes,
HTMLSelectAttributes,
HTMLTextareaAttributes,
} from "svelte/elements";
export interface UiOptions {
/**
* Overrides the attributes of any button component.
*/
button?: HTMLButtonAttributes;
/**
* Overrides the attributes of a button with a specific type.
* This override takes precedence over the `button` override, but does not replace it.
*/
buttons?: {
[B in ButtonType]?: HTMLButtonAttributes;
};
/**
* Overrides the attributes of the errors list.
*/
errorsList?: HTMLAttributes<HTMLUListElement>;
form?: HTMLFormAttributes;
/**
* Overrides the attributes of the field label.
*/
labelAttributes?: HTMLLabelAttributes;
/**
* Overrides the attributes of any layout component.
*/
layout?: HTMLAttributes<HTMLDivElement>;
/**
* Overrides the attributes of a layout with a specific type.
* This override takes precedence over the `layout` override, but does not replace it.
*/
layouts?: {
[L in LayoutType]?: HTMLAttributes<HTMLDivElement>;
};
submitButton?: HTMLButtonAttributes;
/**
* Overrides the attributes of the field title
*/
titleAttributes?: HTMLAttributes<HTMLDivElement>;
checkbox?: HTMLInputAttributes;
number?: HTMLInputAttributes;
select?: HTMLSelectAttributes;
text?: HTMLInputAttributes;
checkboxes?: HTMLInputAttributes;
datePicker?: HTMLInputAttributes;
file?: HTMLInputAttributes;
radio?: HTMLInputAttributes;
range?: HTMLInputAttributes;
switch?: HTMLInputAttributes;
textarea?: HTMLTextareaAttributes;
/**
* Overrides the attributes of the switch widget container.
*/
beercssSwitch?: HTMLInputAttributes;
/**
* Overrides the attributes of the description component.
*/
beercssDescription?: HTMLAttributes<HTMLElement>;
/**
* Overrides the attributes of the help component.
*/
beercssHelp?: HTMLOutputAttributes;
/**
* Overrides the attributes of the layout nav wrapper.
*/
beercssNav?: HTMLAttributes<HTMLElement>;
/**
* Overrides the attributes of the checkboxes container.
*/
beercssCheckboxesContainer?: HTMLAttributes<HTMLElement>;
/**
* Overrides the attributes of the radio container.
*/
beercssRadioContainer?: HTMLAttributes<HTMLElement>;
}