Skip to content

DocsFormsModels

PT

Forms

Models

Model choice as radios with an effort slider that writes the level next to it.

data-u="models"

Example

Models
EffortMedium

Installation

Models ships in the full package, in unslop.css and unslop.js:

curl -fsSL unslop.leallabs.dev/i | sh

A ready-made block that uses models:

curl -fsSL unslop.leallabs.dev/i | sh -s add wall-models

No build Name-based add is for charts and blocks. Components with JS live in unslop.js, which mounts every data-u on the page by itself.

Props

No props. The models registration only listens to the inner slider's u:change and writes the text into [data-effort].

Classes and variants

ClassWhat it does
u-modelsThe host, with role="radiogroup" and aria-label.
u-models__optEach option: a label plus a u-radio.
u-models__effortEffort row, with the level in [data-effort] and a slider.

Accessibility and keyboard

State and roles

WhereAttributeWhat it says
hostrole="radiogroup", aria-labelWrite it in the HTML.
optionstype="radio" inputNative radios with the same name.

Keyboard

KeyDoes
Arrowschange the model (native radio)
Tabgoes to the effort slider

Type to search. Arrows pick, Enter opens.