Skeleton v4
Installation
Section titled “Installation”npm i @sjsf/skeleton4-theme@nextyarn add @sjsf/skeleton4-theme@nextpnpm add @sjsf/skeleton4-theme@nextbun add @sjsf/skeleton4-theme@next@skeletonlabs/skeleton ^4.2.0 and
@skeletonlabs/skeleton-svelte ^4.2.0 are required.
Install Skeleton v4
Section titled “Install Skeleton v4”Install and configure Skeleton for SvelteKit
Configuration
Section titled “Configuration”Register the theme source path by adding the following line to the app.css file:.
@source "../node_modules/@sjsf/skeleton4-theme/dist";Extra widgets
Section titled “Extra widgets”You can connect extra widgets using the following include imports:
// Used by default in the following fields: multiEnumFieldimport "@sjsf/skeleton4-theme/extra-widgets/checkboxes-include"import "@sjsf/skeleton4-theme/extra-widgets/combobox-include"import "@sjsf/skeleton4-theme/extra-widgets/date-picker-include"import "@sjsf/skeleton4-theme/extra-widgets/file-upload-include"// Used by default in the following fields: fileField, filesFieldimport "@sjsf/skeleton4-theme/extra-widgets/file-include"import "@sjsf/skeleton4-theme/extra-widgets/multi-select-include"import "@sjsf/skeleton4-theme/extra-widgets/radio-buttons-include"import "@sjsf/skeleton4-theme/extra-widgets/radio-include"import "@sjsf/skeleton4-theme/extra-widgets/range-include"import "@sjsf/skeleton4-theme/extra-widgets/rating-include"import "@sjsf/skeleton4-theme/extra-widgets/slider-include"import "@sjsf/skeleton4-theme/extra-widgets/switch-include"// Used by default in the following fields: tagsFieldimport "@sjsf/skeleton4-theme/extra-widgets/tags-include"import "@sjsf/skeleton4-theme/extra-widgets/textarea-include"Widgets demo
Section titled “Widgets demo”{ "type": "object", "properties": { "checkbox": { "type": "object", "properties": { "default": { "type": "boolean" }, "error": { "type": "boolean" } } }, "checkboxes": { "type": "object", "properties": { "default": { "type": "array", "items": { "type": "string", "enum": [ "foo", "bar", "fuzz", "qux" ] }, "uniqueItems": true }, "error": { "type": "array", "items": { "type": "string", "enum": [ "foo", "bar", "fuzz", "qux" ] }, "uniqueItems": true } } }, "file": { "type": "object", "properties": { "default": { "type": "string", "format": "data-url" }, "error": { "type": "string", "format": "data-url" } } }, "multiFile": { "type": "object", "properties": { "default": { "type": "array", "items": { "type": "string", "format": "data-url" } }, "error": { "type": "array", "items": { "type": "string", "format": "data-url" } } } }, "number": { "type": "object", "properties": { "default": { "type": "number" }, "error": { "type": "number" } } }, "select": { "type": "object", "properties": { "default": { "type": "string", "enum": [ "foo", "bar", "fuzz", "qux" ] }, "error": { "type": "string", "enum": [ "foo", "bar", "fuzz", "qux" ] } } }, "text": { "type": "object", "properties": { "default": { "type": "string" }, "error": { "type": "string" } } }, "combobox": { "type": "object", "properties": { "default": { "type": "string", "enum": [ "foo", "bar", "fuzz", "qux" ] }, "error": { "type": "string", "enum": [ "foo", "bar", "fuzz", "qux" ] } } }, "datePicker": { "type": "object", "properties": { "default": { "type": "string" }, "error": { "type": "string" } } }, "fileUpload": { "type": "object", "properties": { "default": { "type": "string", "format": "data-url" }, "error": { "type": "string", "format": "data-url" } } }, "fileUploadMultiple": { "type": "object", "properties": { "default": { "type": "array", "items": { "type": "string", "format": "data-url" } }, "error": { "type": "array", "items": { "type": "string", "format": "data-url" } } } }, "multiSelect": { "type": "object", "properties": { "default": { "type": "array", "items": { "type": "string", "enum": [ "foo", "bar", "fuzz", "qux" ] }, "uniqueItems": true }, "error": { "type": "array", "items": { "type": "string", "enum": [ "foo", "bar", "fuzz", "qux" ] }, "uniqueItems": true } } }, "radioButtons": { "type": "object", "properties": { "default": { "type": "string", "enum": [ "foo", "bar", "fuzz", "qux" ] }, "error": { "type": "string", "enum": [ "foo", "bar", "fuzz", "qux" ] } } }, "radio": { "type": "object", "properties": { "default": { "type": "string", "enum": [ "foo", "bar", "fuzz", "qux" ] }, "error": { "type": "string", "enum": [ "foo", "bar", "fuzz", "qux" ] } } }, "range": { "type": "object", "properties": { "default": { "type": "number" }, "error": { "type": "number" } } }, "rating": { "type": "object", "properties": { "default": { "type": "number" }, "error": { "type": "number" } } }, "slider": { "type": "object", "properties": { "default": { "type": "number" }, "error": { "type": "number" } } }, "switch": { "type": "object", "properties": { "default": { "type": "boolean" }, "error": { "type": "boolean" } } }, "tags": { "type": "object", "properties": { "default": { "type": "array", "items": { "type": "string", "enum": [ "foo", "bar", "fuzz", "qux" ] }, "uniqueItems": true }, "error": { "type": "array", "items": { "type": "string", "enum": [ "foo", "bar", "fuzz", "qux" ] }, "uniqueItems": true } } }, "textarea": { "type": "object", "properties": { "default": { "type": "string" }, "error": { "type": "string" } } } }}{ "checkbox": { "default": { "ui:options": { "title": "checkbox" } }, "error": { "ui:options": { "title": "checkbox" } }, "ui:options": { "layouts": { "object-properties": { "style": "display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;" } } } }, "checkboxes": { "default": { "ui:components": { "arrayField": "multiEnumField" }, "ui:options": { "title": "checkboxes" } }, "error": { "ui:components": { "arrayField": "multiEnumField" }, "ui:options": { "title": "checkboxes" } }, "ui:options": { "layouts": { "object-properties": { "style": "display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;" } } } }, "file": { "default": { "ui:components": { "stringField": "fileField" }, "ui:options": { "title": "file" } }, "error": { "ui:components": { "stringField": "fileField" }, "ui:options": { "title": "file" } }, "ui:options": { "layouts": { "object-properties": { "style": "display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;" } } } }, "multiFile": { "default": { "ui:components": { "arrayField": "arrayFilesField" }, "ui:options": { "title": "multiFile" } }, "error": { "ui:components": { "arrayField": "arrayFilesField" }, "ui:options": { "title": "multiFile" } }, "ui:options": { "layouts": { "object-properties": { "style": "display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;" } } } }, "number": { "default": { "ui:options": { "title": "number" } }, "error": { "ui:options": { "title": "number" } }, "ui:options": { "layouts": { "object-properties": { "style": "display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;" } } } }, "select": { "default": { "ui:components": { "stringField": "enumField" }, "ui:options": { "title": "select" } }, "error": { "ui:components": { "stringField": "enumField" }, "ui:options": { "title": "select" } }, "ui:options": { "layouts": { "object-properties": { "style": "display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;" } } } }, "text": { "default": { "ui:options": { "title": "text" } }, "error": { "ui:options": { "title": "text" } }, "ui:options": { "layouts": { "object-properties": { "style": "display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;" } } } }, "combobox": { "default": { "ui:components": { "stringField": "enumField", "selectWidget": "comboboxWidget" }, "ui:options": { "title": "combobox" } }, "error": { "ui:components": { "stringField": "enumField", "selectWidget": "comboboxWidget" }, "ui:options": { "title": "combobox" } }, "ui:options": { "layouts": { "object-properties": { "style": "display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;" } } } }, "datePicker": { "default": { "ui:components": { "textWidget": "datePickerWidget" }, "ui:options": { "title": "datePicker" } }, "error": { "ui:components": { "textWidget": "datePickerWidget" }, "ui:options": { "title": "datePicker" } }, "ui:options": { "layouts": { "object-properties": { "style": "display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;" } } } }, "fileUpload": { "default": { "ui:components": { "stringField": "fileField", "fileWidget": "skeleton4FileUploadWidget" }, "ui:options": { "title": "fileUpload" } }, "error": { "ui:components": { "stringField": "fileField", "fileWidget": "skeleton4FileUploadWidget" }, "ui:options": { "title": "fileUpload" } }, "ui:options": { "layouts": { "object-properties": { "style": "display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;" } } } }, "fileUploadMultiple": { "default": { "ui:components": { "arrayField": "arrayFilesField", "fileWidget": "skeleton4FileUploadWidget" }, "ui:options": { "title": "fileUploadMultiple" } }, "error": { "ui:components": { "arrayField": "arrayFilesField", "fileWidget": "skeleton4FileUploadWidget" }, "ui:options": { "title": "fileUploadMultiple" } }, "ui:options": { "layouts": { "object-properties": { "style": "display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;" } } } }, "multiSelect": { "default": { "ui:components": { "arrayField": "multiEnumField", "checkboxesWidget": "multiSelectWidget" }, "ui:options": { "useLabel": true, "title": "multiSelect" } }, "error": { "ui:components": { "arrayField": "multiEnumField", "checkboxesWidget": "multiSelectWidget" }, "ui:options": { "useLabel": true, "title": "multiSelect" } }, "ui:options": { "layouts": { "object-properties": { "style": "display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;" } } } }, "radioButtons": { "default": { "ui:components": { "stringField": "enumField", "selectWidget": "radioButtonsWidget" }, "ui:options": { "useLabel": false, "title": "radioButtons" } }, "error": { "ui:components": { "stringField": "enumField", "selectWidget": "radioButtonsWidget" }, "ui:options": { "useLabel": false, "title": "radioButtons" } }, "ui:options": { "layouts": { "object-properties": { "style": "display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;" } } } }, "radio": { "default": { "ui:components": { "stringField": "enumField", "selectWidget": "radioWidget" }, "ui:options": { "useLabel": false, "title": "radio" } }, "error": { "ui:components": { "stringField": "enumField", "selectWidget": "radioWidget" }, "ui:options": { "useLabel": false, "title": "radio" } }, "ui:options": { "layouts": { "object-properties": { "style": "display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;" } } } }, "range": { "default": { "ui:components": { "numberWidget": "rangeWidget" }, "ui:options": { "title": "range" } }, "error": { "ui:components": { "numberWidget": "rangeWidget" }, "ui:options": { "title": "range" } }, "ui:options": { "layouts": { "object-properties": { "style": "display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;" } } } }, "rating": { "default": { "ui:components": { "numberWidget": "ratingWidget" }, "ui:options": { "title": "rating" } }, "error": { "ui:components": { "numberWidget": "ratingWidget" }, "ui:options": { "title": "rating" } }, "ui:options": { "layouts": { "object-properties": { "style": "display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;" } } } }, "slider": { "default": { "ui:components": { "numberWidget": "skeleton4SliderWidget" }, "ui:options": { "title": "slider" } }, "error": { "ui:components": { "numberWidget": "skeleton4SliderWidget" }, "ui:options": { "title": "slider" } }, "ui:options": { "layouts": { "object-properties": { "style": "display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;" } } } }, "switch": { "default": { "ui:components": { "checkboxWidget": "switchWidget" }, "ui:options": { "title": "switch" } }, "error": { "ui:components": { "checkboxWidget": "switchWidget" }, "ui:options": { "title": "switch" } }, "ui:options": { "layouts": { "object-properties": { "style": "display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;" } } } }, "tags": { "default": { "ui:components": { "arrayField": "arrayTagsField" }, "ui:options": { "title": "tags" } }, "error": { "ui:components": { "arrayField": "arrayTagsField" }, "ui:options": { "title": "tags" } }, "ui:options": { "layouts": { "object-properties": { "style": "display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;" } } } }, "textarea": { "default": { "ui:components": { "textWidget": "textareaWidget" }, "ui:options": { "title": "textarea" } }, "error": { "ui:components": { "textWidget": "textareaWidget" }, "ui:options": { "title": "textarea" } }, "ui:options": { "layouts": { "object-properties": { "style": "display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;" } } } }}Supported validation events
Section titled “Supported validation events”| checkbox | oninput, onchange, onblur |
| checkboxes | oninput, onchange, onblur |
| file | onchange, onblur |
| multiFile | onchange, onblur |
| number | oninput, onchange, onblur |
| select | oninput, onchange, onblur |
| text | oninput, onchange, onblur |
| combobox | |
| datePicker | oninput, onchange, onblur |
| fileUpload | onchange |
| fileUploadMultiple | onchange |
| multiSelect | oninput, onchange, onblur |
| radioButtons | oninput, onchange |
| radio | oninput, onchange, onblur |
| range | oninput, onchange, onblur |
| rating | oninput, onchange |
| slider | oninput, onchange, onblur |
| switch | oninput, onchange |
| tags | oninput, onchange, onblur |
| textarea | oninput, onchange, onblur |
UI options
Section titled “UI options”import type { HTMLAttributes, HTMLButtonAttributes, HTMLFormAttributes, HTMLInputAttributes, HTMLLabelAttributes, HTMLSelectAttributes, HTMLTextareaAttributes,} from "svelte/elements";import type { ButtonType, LayoutType } from "@sjsf/form/fields/components";import type { ComboboxRootProps, FileUploadRootProviderProps, RatingGroupRootProps, SegmentedControlItemProps, SegmentedControlRootProps, SliderRootProps, SwitchRootProps, TagsInputRootProps} from "@skeletonlabs/skeleton-svelte4";import type { DatePickerRootProps } from 'bits-ui';
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 description. */ descriptionAttributes?: HTMLAttributes<HTMLDivElement>; /** * Overrides the attributes of the errors list. */ errorsList?: HTMLAttributes<HTMLUListElement>;
form?: HTMLFormAttributes; /** * Overrides the attributes of the help. */ helpAttributes?: HTMLAttributes<HTMLDivElement>; /** * 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;
file?: HTMLInputAttributes;
multiSelect?: HTMLSelectAttributes;
radio?: HTMLInputAttributes;
range?: HTMLInputAttributes;
textarea?: HTMLTextareaAttributes;
skeleton4Combobox?: ComboboxRootProps;
skeleton4DatePicker?: DatePickerRootProps;
skeleton4FileUpload?: Omit<FileUploadRootProviderProps, 'value'>;
skeleton4Segment?: SegmentedControlRootProps; skeleton4SegmentItem?: Omit<SegmentedControlItemProps, 'value'>;
skeleton4Rating?: RatingGroupRootProps;
skeleton4Slider?: SliderRootProps;
skeleton4Switch?: SwitchRootProps;
skeleton4Tags?: TagsInputRootProps;}