Enums and types

Everything the package exports besides the elements.

The attribute values are strings, so the enums are optional. They are, however, the list of what is accepted, and they turn a typo into a compile error.

import {
    BorderRadiusPaper,
    CheckboxLabelSide,
    DarkPalette,
    DescriptionType,
    DropdownType,
    IconName,
    IconSizeVariant,
    InputType,
    LinkTarget,
    MainVariant,
    PaperElevation,
    Palette,
    ScreenSizes,
    TextSize,
    TextVariant,
    ToastType,
} from 'tuix-webcomponents'

MainVariant

The two-way split used by every button and link.

MemberValue
MainVariant.PRIMARYprimary
MainVariant.SECONDARYsecondary

TextSize

Fourteen text styles. The table with sizes and weights is on tuix-text.

TextVariant

Sixteen semantic colours, resolved per theme. The mapping to Palette and DarkPalette is on tuix-text.

Palette and DarkPalette

The raw colours, one enum per theme, with the same member names. Values are in Theming.

IconName and IconSizeVariant

IconName has 88 members, listed in the icon catalog. IconSizeVariant is SMALL (16px), MEDIUM (24px), LARGE (32px) and FULL (100%).

InputType and DescriptionType

EnumMembers
InputTypeTEXT text, SEARCH search, PASSWORD password, TEXT_AREA textarea
DescriptionTypeTEXT text, WARNING warning, ERROR error, SUCCESS success, LOADING loading

Both are used by tuix-input and tuix-dropdown.

MemberValueBehaviour
DropdownType.SINGLEsingleRead-only field, click to open
DropdownType.SEARCHsearchType to filter the options

CheckboxLabelSide

MemberValue
CheckboxLabelSide.LEFTleft
CheckboxLabelSide.RIGHTright

Shared by the checkbox, the radio group and the toggle.

PaperElevation and BorderRadiusPaper

EnumMembers
PaperElevationVARIANT_0 0 … VARIANT_4 4
BorderRadiusPaperNONE 0px, SOFT 4px, MEDIUM 10px, STRONG 20px

LinkTarget

MemberValue
LinkTarget.BLANK_blank
LinkTarget.SELF_self
LinkTarget.PARENT_parent
LinkTarget.TOP_top

ToastType

NONE none, TEXT text, WARNING warning, ERROR error, SUCCESS success. See tuix-toast.

ScreenSizes

MemberValue
ScreenSizes.TABLET1280
ScreenSizes.MOBILE640

Types

TypeShape
DetailValue<T>{ value: T }, the payload of most events
DetailValueCheckboxDetailValue<boolean> plus an optional label
TuixDropdownPlainOptionstring | number | boolean
TuixDropdownObjectOption{ name: string, value: TuixDropdownPlainOption }
TuixDropdownOptionEither of the two above
TuixRadioButtonOptionstring | number, one entry of the radio group's options
IDataTableHeader<TRowData>A table column; see tuix-table
TuixTableElement<TRowData>HTMLElement typed with the table's properties
ThreeDotsLoaderConfigThe table's loader; see tuix-table
PaginationEventDetail{ page: number, pageSize: number }
CustomEventTuixButtonCustomEvent<undefined>
CustomEventTuixInputCustomEvent<DetailValue<string>>
CustomEventTuixCheckboxCustomEvent<DetailValueCheckbox>
CustomEventTuixToggleSame as the checkbox event
CustomEventTuixRadioButton<T>CustomEvent<DetailValue<T>>
CustomEventTuixDropdownSelect<T>CustomEvent<DetailValue<T>>
CustomEventTuixDropdownInputSame as the input event
TuixPaginationEventCustomEvent<PaginationEventDetail>

Element classes

TuixButton, TuixCheckbox, TuixDropdown, TuixIcon, TuixIconButton, TuixInput, TuixLink, TuixModal, TuixPaper, TuixRadioButton, TuixTable, TuixText, TuixToast, TuixToggleButton.

Importing a class registers its tag. The ready-made React wrappers built on them are exported from tuix-webcomponents/react; see the React guide.

On this page