Advanced

Asset loading

The Full, Core, component and extension files, their formats, and the order to load them in.

Bundles

Full is Core plus every standard component; for smaller pages, load Core and only the components you use. Preflight, the icons and the extensions sit outside both: load them only on pages that need them.

Bundle Contents CSS Browser script ESM import
Full Core and every standard component pelatform-ui.css pelatform-ui.js @pelatform/ui/css, @pelatform/ui
Core Tokens, foundation, utilities and the init/destroy runtime core/pelatform-ui-core.css core/pelatform-ui-core.js @pelatform/ui/core/css, @pelatform/ui/core
Preflight An optional reset of the elements inside a root, outside Full and Core core/pelatform-ui-preflight.css None @pelatform/ui/preflight/css
Component One component, without Core components/{name}.css components/{name}.js @pelatform/ui/components/{name}/css, @pelatform/ui/components/{name}
Extension One optional extension, outside Full extensions/{name}.css extensions/{name}.js @pelatform/ui/extensions/{name}/css, @pelatform/ui/extensions/{name}
Icons Every outline icon, or every filled one, outside Full icons/icons.css, icons/icons-filled.css None @pelatform/ui/icons/css, @pelatform/ui/icons-filled/css

The Full script starts itself once at DOM readiness, also when it loads later, and an extension script loaded after it starts its own elements; Core and component scripts never start themselves, so call PLF.init() after they load. You can choose Full or single files separately for CSS and JavaScript, such as Full CSS with Core and component scripts, but never load a file that a Full file already provides. CSS-only components have no script.

Preflight resets every element inside a root, so markup built with the utilities spaces as these docs show, also beside a site’s own CSS; load it before Core or Full.

The icon stylesheets give the icon classes their icons, drawn by the icon class in Core; load them after Core or Full, only on pages with icon classes.

Formats

Each bundle comes in these formats. Normal and minified files are alternatives with the same declarations and behavior; a document loads one CSS mode, one runtime format and one version.

Variant Files Use
Clean CSS .css, .min.css Clean class names such as btn
Prefixed CSS .prefixed.css, .prefixed.min.css; ESM /css/prefixed plf: class names, as in Installation
Browser script .js, .min.js; ESM @pelatform/ui/browser and /browser/min for the Full script A classic <script> that attaches window.PLF; no bundler or module type
ESM @pelatform/ui exports with shared chunks and type declarations Bundlers; imports never start components or attach window.PLF

CSS order

Stylesheets load in this layer order: tokens → foundation → utilities → components → extensions → consumer overrides.

Layer Comes from
Tokens, foundation, utilities Core, or Full
Components Full, or component files in the order of the components list in manifest.json
Extensions Extension files, after the components they need, and the icon stylesheets
Consumer overrides Your stylesheet, last

Core and components

Load Core first, then each component’s CSS and script, then call PLF.init():

HTML
<link rel="stylesheet" href="core/pelatform-ui-core.min.css">
<link rel="stylesheet" href="components/modal.min.css">
<script src="core/pelatform-ui-core.min.js" defer></script>
<script src="components/modal.min.js" defer></script>
<script>document.addEventListener('DOMContentLoaded', () => PLF.init());</script>

With ESM, import the CSS yourself, as JavaScript imports never import CSS, and register the components with use() so that init() starts them:

TypeScript
import '@pelatform/ui/core/css';
import '@pelatform/ui/components/modal/css';
import {init, use} from '@pelatform/ui/core';
import {Modal} from '@pelatform/ui/components/modal';
use(Modal);
init();

Extensions

Calendar, Date Picker, Date & Time Picker, Color Picker, DataTable, Chart and Sortable are not in Full or the ESM root. Load their files after the components they need: after the Full script they start themselves, and with Core, call PLF.init(); Extensions lists the files.

Types

The package includes type declarations, which editors also use for autocomplete in JavaScript; they need moduleResolution set to bundler or nodenext. Each ESM import carries its types, such as ModalInstance and ModalEventDetail, and an event listener knows its detail, such as event.detail.reason on plf:modal:close.

With the Browser script, add the global PLF with this line at the top of a script file, or for every file by listing @pelatform/ui/browser in the types of jsconfig.json (tsconfig.json in TypeScript):

JavaScript
/// <reference types="@pelatform/ui/browser" />

An extension is on PLF once its script loads, so its type is optional: PLF.DataTable?.getInstance(table).

Package metadata

The runtime never loads these files.

File Contents
manifest.json (@pelatform/ui/manifest) Schema and release version, inventory, modes, normal and minified paths, dependencies, provided IDs, the scripts a CSS-only component uses (uses), the elements each script starts on (selector), the format each export adapter adds (exportFormat), ESM and type entries, raw, gzip and Brotli sizes
class-map.json (@pelatform/ui/class-map) Each plf: visual class and its Clean name, for build tools
tailwind.css (@pelatform/ui/tailwind) A Tailwind CSS theme for your own build, whose utilities read the tokens (Installation)
tabler-notices.txt, extensions/chart-notices.txt, extensions/datatable-export-notices.txt License notices; keep them with redistributed files

Compact control sizes

Controls share three minimum heights and grow with larger fonts or content; Default has no modifier and there is no --md class.

Size Modifier Minimum height Decorative icon
Small --sm 32px 14px
Default None 36px 16px
Large --lg 40px 18px
Control Classes
Button btn-sm, btn-lg
Input input-sm, input-lg
Textarea textarea-sm, textarea-lg; height follows its rows
Input Group input-group-sm, input-group-lg on the group; do not size the inner input
Select select-sm, select-lg, also on a custom select
Combobox combobox-sm, combobox-lg
Multi Select multi-select-sm, multi-select-lg

A component’s own height, radius or icon variable on a root or element takes precedence over the modifiers; --plf-control-font-size, --plf-control-font-weight and --plf-control-icon-size set the shared defaults (Tokens). Use Small for dense toolbars and forms and Default or Large for touch input. A native select can show the platform’s own corner radius, as in WebKit.

Some mobile browsers zoom into a field whose text is smaller than 16px when it gets focus. To avoid it, set --plf-control-font-size: 16px on the root.

Component assets

Load Core, then the files under Also load, then the component’s CSS and the scripts under JavaScript, which can belong to another component (Sheet’s behavior is components/modal.js). Each file has a minified .min version and Prefixed markup uses the .prefixed.css files; a component guide’s JavaScript section lists the files its examples use.

ComponentCSSJavaScriptAlso loadESM export
accordioncomponents/accordion.cssNoneNoneNone
alertcomponents/alert.cssNoneNoneNone
alert-dialogcomponents/alert-dialog.csscomponents/modal.jscomponents/button.css, components/modal.cssModal
aspect-ratiocomponents/aspect-ratio.cssNoneNoneNone
attachmentcomponents/attachment.cssNoneNoneNone
avatarcomponents/avatar.cssNoneNoneNone
badgecomponents/badge.cssNoneNoneNone
breadcrumbcomponents/breadcrumb.cssNoneNoneNone
buttoncomponents/button.csscomponents/button.jsNoneButton
button-groupcomponents/button-group.cssNonecomponents/button.cssNone
cardcomponents/card.cssNoneNoneNone
carouselcomponents/carousel.csscomponents/carousel.jsNoneCarousel
choice-cardcomponents/choice-card.cssNonecomponents/form.cssNone
code-blockcomponents/code-block.csscomponents/code-block.jsNoneCodeBlock
collapsiblecomponents/collapsible.cssNoneNoneNone
comboboxcomponents/combobox.csscomponents/combobox.jsNoneCombobox
commandcomponents/command.csscomponents/command.jsNoneCommand
context-menucomponents/context-menu.csscomponents/context-menu.jscomponents/dropdown-menu.cssContextMenu
drawercomponents/drawer.csscomponents/modal.jscomponents/modal.css, components/sheet.cssModal
dropdown-menucomponents/dropdown-menu.csscomponents/dropdown-menu.jsNoneDropdownMenu
emptycomponents/empty.cssNoneNoneNone
fieldNonecomponents/field.jsNoneField
file-uploadcomponents/file-upload.csscomponents/file-upload.jscomponents/attachment.cssFileUpload
formcomponents/form.cssNoneNoneNone
hover-cardcomponents/hover-card.csscomponents/hover-card.jsNoneHoverCard
input-groupNonecomponents/input-group.jsNoneInputGroup
input-otpcomponents/input-otp.csscomponents/input-otp.jscomponents/form.cssInputOTP
itemcomponents/item.cssNoneNoneNone
kbdcomponents/kbd.cssNoneNoneNone
lightboxcomponents/lightbox.csscomponents/lightbox.jscomponents/button.css, components/modal.css, components/spinner.css, components/modal.jsLightbox
linkcomponents/link.cssNoneNoneNone
menubarcomponents/menubar.csscomponents/menubar.jscomponents/dropdown-menu.css, components/dropdown-menu.jsMenubar
mockupcomponents/mockup.cssNoneNoneNone
modalcomponents/modal.csscomponents/modal.jsNoneModal
multi-selectcomponents/multi-select.csscomponents/multi-select.jsNoneMultiSelect
navigation-menucomponents/navigation-menu.csscomponents/navigation-menu.jsNoneNavigationMenu
number-inputNonecomponents/number-input.jsNoneNumberInput
paginationcomponents/pagination.cssNoneNoneNone
phone-inputNonecomponents/phone-input.jsNonePhoneInput
popovercomponents/popover.csscomponents/popover.jsNonePopover
progresscomponents/progress.cssNoneNoneNone
repeatercomponents/repeater.csscomponents/repeater.jsNoneRepeater
resizablecomponents/resizable.csscomponents/resizable.jsNoneResizable
result-dialogcomponents/result-dialog.csscomponents/modal.jscomponents/button.css, components/modal.cssModal
scroll-areacomponents/scroll-area.cssNoneNoneNone
scrollspycomponents/scrollspy.csscomponents/scrollspy.jsNoneScrollspy
selectcomponents/select.csscomponents/select.jscomponents/form.cssSelect
separatorcomponents/separator.cssNoneNoneNone
sheetcomponents/sheet.csscomponents/modal.jscomponents/modal.cssModal
sidebarcomponents/sidebar.csscomponents/sidebar.jscomponents/modal.css, components/sheet.css, components/tooltip.css, components/collapsible.css, components/modal.jsSidebar
skeletoncomponents/skeleton.cssNoneNoneNone
slidercomponents/slider.csscomponents/slider.jsNoneSlider
spinnercomponents/spinner.cssNoneNoneNone
steppercomponents/stepper.csscomponents/stepper.jscomponents/progress.cssStepper
tablecomponents/table.cssNoneNoneNone
tabscomponents/tabs.csscomponents/tabs.jsNoneTabs
textarea-growNonecomponents/textarea-grow.jsNoneTextareaGrow
theme-switchNonecomponents/theme-switch.jscomponents/dropdown-menu.js, components/toggle-group.jsThemeSwitch
time-pickerNonecomponents/time-picker.jsNoneTimePicker
timelinecomponents/timeline.cssNoneNoneNone
toastcomponents/toast.csscomponents/toast.jscomponents/alert.cssToast
togglecomponents/toggle.csscomponents/toggle.jscomponents/button.cssToggle
toggle-groupcomponents/toggle-group.csscomponents/toggle-group.jscomponents/button.css, components/button-group.css, components/toggle.cssToggleGroup
tooltipcomponents/tooltip.csscomponents/tooltip.jsNoneTooltip
tree-viewcomponents/tree-view.csscomponents/tree-view.jsNoneTreeView

Built with Pelatform UIv0.1.0

Documentation

Getting started

Foundations

Components

Actions

Data display

Navigation

Feedback

Data input

Layout

Advanced

Integrations

Blocks

Application

Authentication

Icons