Skeleton
Installation
Section titled “Installation”npm i @sjsf/skeleton3-theme
yarn add @sjsf/skeleton3-theme
pnpm add @sjsf/skeleton3-theme
bun add @sjsf/skeleton3-theme
@skeletonlabs/skeleton ^3.1.0
and
@skeletonlabs/skeleton-svelte ^1.2.0
are required.
Install Skeleton v3
Section titled “Install Skeleton v3”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/skeleton3-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/skeleton3-theme/extra-widgets/checkboxes-include"import "@sjsf/skeleton3-theme/extra-widgets/date-picker-include"import "@sjsf/skeleton3-theme/extra-widgets/file-upload-include"// Used by default in the following fields: fileField, filesFieldimport "@sjsf/skeleton3-theme/extra-widgets/file-include"import "@sjsf/skeleton3-theme/extra-widgets/multi-select-include"import "@sjsf/skeleton3-theme/extra-widgets/radio-buttons-include"import "@sjsf/skeleton3-theme/extra-widgets/radio-include"import "@sjsf/skeleton3-theme/extra-widgets/range-include"import "@sjsf/skeleton3-theme/extra-widgets/rating-include"import "@sjsf/skeleton3-theme/extra-widgets/slider-include"import "@sjsf/skeleton3-theme/extra-widgets/switch-include"// Used by default in the following fields: tagsFieldimport "@sjsf/skeleton3-theme/extra-widgets/tags-include"import "@sjsf/skeleton3-theme/extra-widgets/textarea-include"
UI options
Section titled “UI options”import type { ComponentProps as SvelteComponentProps } from "svelte";import type { HTMLAttributes, HTMLButtonAttributes, HTMLFormAttributes, HTMLInputAttributes, HTMLLabelAttributes, HTMLSelectAttributes, HTMLTextareaAttributes,} from "svelte/elements";import type { ButtonType, LayoutType } from "@sjsf/form/fields/components";import type { FileUpload as SkeletonFileUpload, Rating as SkeletonRating, Segment, Slider as SkeletonSlider, Switch as SkeletonSwitch, TagsInput,} from "@skeletonlabs/skeleton-svelte";
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;
datePicker?: HTMLInputAttributes;
file?: HTMLInputAttributes;
multiSelect?: HTMLSelectAttributes;
radio?: HTMLInputAttributes;
range?: HTMLInputAttributes;
textarea?: HTMLTextareaAttributes;
skeleton3FileUpload?: SvelteComponentProps<typeof SkeletonFileUpload>;
skeleton3Segment?: SvelteComponentProps<typeof Segment>; skeleton3SegmentItem?: SvelteComponentProps<typeof Segment.Item>;
skeleton3Rating?: SvelteComponentProps<typeof SkeletonRating>;
skeleton3Slider?: SvelteComponentProps<typeof SkeletonSlider>;
skeleton3Switch?: SvelteComponentProps<typeof SkeletonSwitch>;
skeleton3Tags?: SvelteComponentProps<typeof TagsInput>;}
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" } } }, "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" } } } }}
{ "checkboxes": { "default": { "ui:components": { "arrayField": "multiEnumField" } }, "error": { "ui:components": { "arrayField": "multiEnumField" } } }, "file": { "default": { "ui:components": { "stringField": "fileField" } }, "error": { "ui:components": { "stringField": "fileField" } } }, "multiFile": { "default": { "ui:components": { "arrayField": "<function: anonymous>" } }, "error": { "ui:components": { "arrayField": "<function: anonymous>" } } }, "select": { "default": { "ui:components": { "stringField": "enumField" } }, "error": { "ui:components": { "stringField": "enumField" } } }, "datePicker": { "default": { "ui:components": { "textWidget": "datePickerWidget" } }, "error": { "ui:components": { "textWidget": "datePickerWidget" } } }, "fileUpload": { "default": { "ui:components": { "stringField": "fileField", "fileWidget": "<function: File_upload>" } }, "error": { "ui:components": { "stringField": "fileField", "fileWidget": "<function: File_upload>" } } }, "fileUploadMultiple": { "default": { "ui:components": { "arrayField": "<function: anonymous>", "fileWidget": "<function: File_upload>" } }, "error": { "ui:components": { "arrayField": "<function: anonymous>", "fileWidget": "<function: File_upload>" } } }, "multiSelect": { "default": { "ui:components": { "arrayField": "multiEnumField", "checkboxesWidget": "multiSelectWidget" }, "ui:options": { "useLabel": true } }, "error": { "ui:components": { "arrayField": "multiEnumField", "checkboxesWidget": "multiSelectWidget" }, "ui:options": { "useLabel": true } } }, "radioButtons": { "default": { "ui:components": { "stringField": "enumField", "selectWidget": "radioButtonsWidget" }, "ui:options": { "useLabel": false } }, "error": { "ui:components": { "stringField": "enumField", "selectWidget": "radioButtonsWidget" }, "ui:options": { "useLabel": false } } }, "radio": { "default": { "ui:components": { "stringField": "enumField", "selectWidget": "radioWidget" }, "ui:options": { "useLabel": false } }, "error": { "ui:components": { "stringField": "enumField", "selectWidget": "radioWidget" }, "ui:options": { "useLabel": false } } }, "range": { "default": { "ui:components": { "numberWidget": "rangeWidget" } }, "error": { "ui:components": { "numberWidget": "rangeWidget" } } }, "rating": { "default": { "ui:components": { "numberWidget": "ratingWidget" } }, "error": { "ui:components": { "numberWidget": "ratingWidget" } } }, "slider": { "default": { "ui:components": { "numberWidget": "<function: Slider>" } }, "error": { "ui:components": { "numberWidget": "<function: Slider>" } } }, "switch": { "default": { "ui:components": { "checkboxWidget": "switchWidget" } }, "error": { "ui:components": { "checkboxWidget": "switchWidget" } } }, "tags": { "default": { "ui:components": { "arrayField": "<function: anonymous>" } }, "error": { "ui:components": { "arrayField": "<function: anonymous>" } } }, "textarea": { "default": { "ui:components": { "textWidget": "textareaWidget" } }, "error": { "ui:components": { "textWidget": "textareaWidget" } } }}