Eigenschaften
Ziel ist, möglichst über alle Komponenten einheitliche Eigenschaften (Properties) zu verwenden, um die Erlernbarkeit zu erleichtern. Folgende Anforderungen sind dafür definiert:
- Nur ein Property-Name für gleichartige Eigenschaften
- Wenn möglich, einheitliche Beschreibungen bei gleichen Property-Namen
- Wenn möglich, einheitliche Typen bei gleichen Property-Namen
- Anzahl an unterschiedlichen Eigenschaften, Beschreibungen und Typen minimieren
Aktueller Stand
# | Property | Components | Descriptions | Types |
---|---|---|---|---|
1 | _label | abbr, accordion, alert, avatar, badge, breadcrumb, button, button-link, card, details, heading, icon, input-checkbox, input-color, input-date, input-email, input-file, input-number, input-password, input-radio, input-range, input-text, link, link-button, modal, nav, pagination, progress, quote, select, skip-nav, split-button, table, tabs, textarea | Defines the visible or semantic label of the component (e.g. aria-label, label, headline, caption, summary, etc.). Defines the visible or semantic label of the component (e.g. aria-label, label, headline, caption, summary, etc.). Set to `false` to enable the expert slot. | string |
2 | _tooltip-align | abbr, button, button-link, input-checkbox, input-color, input-date, input-email, input-file, input-number, input-password, input-radio, input-range, input-text, link, link-button, pagination, select, split-button, textarea | Defines where to show the Tooltip preferably: top, right, bottom or left. | "bottom" | "left" | "right" | "top" |
3 | _level | accordion, alert, card, heading | Defines which H-level from 1-6 the heading has. 0 specifies no heading and is shown as bold text. | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
4 | _open | accordion, details | If set (to true) opens/expands the element, closes if not set (or set to false). | boolean |
5 | _alert | alert, input-checkbox, input-color, input-date, input-email, input-file, input-number, input-password, input-radio, input-range, input-text, select, textarea | Defines whether the screen-readers should read out the notification. | boolean |
6 | _has-closer | alert, card | Defines whether the element can be closed. | boolean |
7 | _type | alert, button, button-link, input-date, input-text, split-button | Defines either the type of the component or of the components interactive element. | "default" | "error" | "info" | "success" | "warning" "button" | "reset" | "submit" "date" | "datetime-local" | "month" | "time" | "week" "search" | "tel" | "text" | "url" |
8 | _variant | alert, button, input-checkbox, link-button, progress, quote, spin, split-button | Defines which variant should be used for presentation. | "card" | "msg" "custom" | "danger" | "ghost" | "normal" | "primary" | "secondary" | "tertiary" "button" | "default" | "switch" "bar" | "cycle" | "cycle-label-value" | "cycle-value-label" "block" | "inline" "cycle" | "dot" | "none" |
9 | _src | avatar, image | Sets the image `src` attribute to the given string. | string |
10 | _color | badge | Defines the backgroundColor and foregroundColor. | string | { backgroundColor: string; foregroundColor: Stringified |
11 | _icons | badge, button, button-link, icon, input-checkbox, input-color, input-date, input-email, input-file, input-number, input-password, input-range, input-text, link, link-button, select, split-button | Defines the icon classnames (e.g. `_icons="fa-solid fa-user"`). | KoliBriHorizontalIcons & KoliBriVerticalIcons | string string string | { checked: string; indeterminate?: string; unchecked?: string; } | { checked?: string; indeterminate: string; unchecked?: string; } | { checked?: string; indeterminate?: string; unchecked: string; } string | { right?: IconOrIconClass; left?: IconOrIconClass; } |
12 | _smart-button | badge, input-color, input-date, input-email, input-file, input-number, input-password, input-text | Allows to add a button with an arbitrary action within the element (_hide-label only). | string | { _label: string; } & { _tabIndex?: number; _value?: Stringified |
13 | _links | breadcrumb, nav, skip-nav | Defines the list of links combined with their labels to render. Defines the list of links, buttons or texts to render. | BreadcrumbLinkProps[] | string ButtonOrLinkOrTextWithChildrenProps[] | string LinkProps[] | string |
14 | _access-key | button, button-link, input-checkbox, input-color, input-date, input-email, input-file, input-number, input-password, input-radio, input-range, input-text, link, link-button, select, textarea | Defines the elements access key. Defines which key combination can be used to trigger or focus the interactive element of the component. | string |
15 | _aria-controls | button, button-link, split-button | Defines which elements are controlled by this component. (https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-controls) | string |
16 | _aria-expanded | button, button-link, split-button | Defines whether the interactive element of the component expanded something. (https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-expanded) | boolean |
17 | _aria-selected | button, button-link, split-button | Defines whether the interactive element of the component is selected (e.g. role=tab). (https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-selected) | boolean |
18 | _custom-class | button, link-button, pagination, split-button | Defines the custom class attribute if _variant="custom" is set. | string |
19 | _disabled | button, button-link, input-checkbox, input-color, input-date, input-email, input-file, input-number, input-password, input-radio, input-range, input-text, select, split-button, textarea | Makes the element not focusable and ignore all events. | boolean |
20 | _hide-label | button, button-link, input-checkbox, input-color, input-date, input-email, input-file, input-number, input-password, input-radio, input-range, input-text, link, link-button, nav, select, split-button, textarea | Hides the caption by default and displays the caption text with a tooltip when the interactive element is focused or the mouse is over it. | boolean |
21 | _id | button, button-link, input-checkbox, input-color, input-date, input-email, input-file, input-number, input-password, input-radio, input-range, input-text, select, split-button, textarea | Defines the internal ID of the primary component element. | string |
22 | _name | button, button-link, input-checkbox, input-color, input-date, input-email, input-file, input-number, input-password, input-radio, input-range, input-text, select, split-button, textarea | Defines the technical name of an input field. | string |
23 | _tab-index | button, button-link, input-checkbox, input-color, input-date, input-email, input-file, input-number, input-password, input-radio, input-range, input-text, link, link-button, select, split-button, textarea | Defines which tab-index the primary element of the component has. (https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) | number |
24 | _value | button, button-link, input-checkbox, input-color, input-date, input-email, input-file, input-number, input-password, input-radio, input-range, input-text, progress, select, split-button, textarea | Defines the value that the button emits on click. Defines the value of the input. Defines the progress. | boolean | null | number | object | string string Date | `${number}-${number}-${number}T${number}:${number}:${number}` | `${number}-${number}-${number}T${number}:${number}` | `${number}-${number}-${number}` | `${number}-${number}` | `${number}-W${number}` | `${number}:${number}:${number}` | `${number}:${number}` | null `${number}-${number}-${number}T${number}:${number}:${number}` | `${number}-${number}-${number}T${number}:${number}` | `${number}-${number}-${number}` | `${number}-${number}` | `${number}-W${number}` | `${number}:${number}:${number}` | `${number}:${number}` | null | number number | string number W3CInputValue[] | string |
25 | _required-text | form | Defines whether the mandatory-fields-hint should be shown. A string overrides the default text. | boolean | string |
26 | _secondary-headline | heading | Defines the text of the secondary headline. | string |
27 | _loading | image | Defines the loading mode for the image. | "eager" | "lazy" |
28 | _sizes | image | Defines the image sizes for different screen resolutions, supporting _srcset. | string |
29 | _srcset | image | Setzt eine Liste von Quell-URLs mit Breiten der Bilder. | string |
30 | _checked | input-checkbox | Defines whether the checkbox is checked or not. Can be read and written. | boolean |
31 | _error | input-checkbox, input-color, input-date, input-email, input-file, input-number, input-password, input-radio, input-range, input-text, select, textarea | Defines the error message text. | string |
32 | _hide-error | input-checkbox, input-color, input-date, input-email, input-file, input-number, input-password, input-radio, input-range, input-text, select, textarea | Hides the error message but leaves it in the DOM for the input's aria-describedby. | boolean |
33 | _hint | input-checkbox, input-color, input-date, input-email, input-file, input-number, input-password, input-radio, input-range, input-text, select, textarea | Defines the hint text. | string |
34 | _indeterminate | input-checkbox | Puts the checkbox in the indeterminate state, does not change the value of _checked. | boolean |
35 | _required | input-checkbox, input-date, input-email, input-file, input-number, input-password, input-radio, input-text, select, textarea | Makes the input element required. | boolean |
36 | _touched | input-checkbox, input-color, input-date, input-email, input-file, input-number, input-password, input-radio, input-range, input-text, select, textarea | Shows if the input was touched by a user. | boolean |
37 | _auto-complete | input-color, input-date, input-email, input-number, input-password, input-range, input-text | Defines whether the input can be auto-completed. | "off" | "on" |
38 | _suggestions | input-color, input-date, input-email, input-number, input-range, input-text | Suggestions to provide for the input. | W3CInputValue[] | string |
39 | _max | input-date, input-number, input-range, pagination, progress | Defines the largest possible input value. Defines the maximum number of pages. Defines at which value the progress display is completed. | Date | `${number}-${number}-${number}T${number}:${number}:${number}` | `${number}-${number}-${number}T${number}:${number}` | `${number}-${number}-${number}` | `${number}-${number}` | `${number}-W${number}` | `${number}:${number}:${number}` | `${number}:${number}` `${number}-${number}-${number}T${number}:${number}:${number}` | `${number}-${number}-${number}T${number}:${number}` | `${number}-${number}-${number}` | `${number}-${number}` | `${number}-W${number}` | `${number}:${number}:${number}` | `${number}:${number}` | number number |
40 | _min | input-date, input-number, input-range | Defines the smallest possible input value. | Date | `${number}-${number}-${number}T${number}:${number}:${number}` | `${number}-${number}-${number}T${number}:${number}` | `${number}-${number}-${number}` | `${number}-${number}` | `${number}-W${number}` | `${number}:${number}:${number}` | `${number}:${number}` `${number}-${number}-${number}T${number}:${number}:${number}` | `${number}-${number}-${number}T${number}:${number}` | `${number}-${number}-${number}` | `${number}-${number}` | `${number}-W${number}` | `${number}:${number}:${number}` | `${number}:${number}` | number number |
41 | _read-only | input-date, input-email, input-number, input-password, input-text, textarea | Makes the input element read only. | boolean |
42 | _step | input-date, input-number, input-range | Defines the step size for value changes. | number |
43 | _has-counter | input-email, input-password, input-text, textarea | Shows the character count on the lower border of the input. | boolean |
44 | _max-length | input-email, input-password, input-text, textarea | Defines the maximum number of input characters. | number |
45 | _multiple | input-email, input-file, select | Makes the input accept multiple inputs. | boolean |
46 | _pattern | input-email, input-password, input-text | Defines a validation pattern for the input field. | string |
47 | _placeholder | input-email, input-number, input-password, input-text, textarea | Defines the placeholder for input field. To be shown when there's no value. | string |
48 | _accept | input-file | Defines which file formats are accepted. | string |
49 | _options | input-radio, select | Options the user can choose from. Options the user can choose from, also supporting Optgroup. | Option (Option |
50 | _orientation | input-radio, nav | Defines whether the orientation of the component is horizontal or vertical. | "horizontal" | "vertical" |
51 | _download | link, link-button | Tells the browser that the link contains a file. Optionally sets the filename. | string |
52 | _href | link, link-button, quote | Sets the target URI of the link or citation source. Defines the target URI of the link. | string |
53 | _listen-aria-current | link, link-button | Listen on an aria-current event with this value. If the value matches the current value and the href is the same as the current url, the aria-current attribute will be set to current value. | "date" | "location" | "page" | "step" | "time" | boolean |
54 | _target | link, link-button | Defines where to open the link. | string |
55 | _target-description | link, link-button | Defines the description to use when the link is going to be opened in another application. | string |
56 | _width | modal | Defines the width of the modal. (max-width: 100%) | string |
57 | _aria-current-value | nav | Defines the value of aria-current to be used with the current context within the navigation. | "date" | "location" | "page" | "step" | "time" | boolean |
58 | _collapsible | nav | Defines if navigation nodes can be collapsed or not. Enabled by default. | boolean |
59 | _boundary-count | pagination | Defines the amount of pages to show next to the outer arrow buttons. | number |
60 | _has-buttons | pagination | Defines which navigation buttons to render (first, last, next, previous buttons). | boolean | string | { first: boolean; last: boolean; next: boolean; previous: boolean; } |
61 | _page | pagination | Defines the current page. | number |
62 | _page-size | pagination | Defines the amount of entries to show per page. | number |
63 | _page-size-options | pagination | Defines the options for the page-size-select. | number[] | string |
64 | _sibling-count | pagination | Defines the amount of pages to show next to the current page. | number |
65 | _align | popover-wc, tabs | Defines the alignment of the tooltip, popover or tabs in relation to the element. Defines the position of the tab captions. | "bottom" | "left" | "right" | "top" |
66 | _show | popover-wc, spin | Makes the element show up. | boolean |
67 | _unit | progress | Defines the unit of the step values (not shown). | string |
68 | _quote | quote | Defines the text of the quote. | string |
69 | _rows | select, textarea | Defines how many rows of options should be visible at the same time. Defines how many rows of text should be visible at the same time. | number |
70 | _data | table | Defines the primary table data. | KoliBriTableDataType[] | string |
71 | _data-foot | table | Defines the data for the table footer. | KoliBriTableDataType[] | string |
72 | _headers | table | Defines the horizontal and vertical table headers. | string | { horizontal?: KoliBriTableHeaderCell[][]; vertical?: KoliBriTableHeaderCell[][]; } |
73 | _min-width | table | Defines the table min-width. | string |
74 | _pagination | table | Defines whether to show the data distributed over multiple pages. | boolean | string | { _page: number; } & { _on?: KoliBriPaginationButtonCallbacks; _page?: number; _max?: number; _boundaryCount?: number; _hasButtons?: boolean | Stringified |
75 | _selected | tabs | Defines which tab is active. | number |
76 | _tabs | tabs | Defines the tab captions. | TabButtonProps[] | string |
77 | _adjust-height | textarea | Adjusts the height of the element to its content. | boolean |
78 | _resize | textarea | Defines whether and in which direction the size of the input can be changed by the user. (https://developer.mozilla.org/de/docs/Web/CSS/resize) | "both" | "horizontal" | "none" | "vertical" |
79 | _hide-button | kol-pagination | Versteckt entweder den Zurück- oder Weiter-Schalter, oder beide Schalter. | "previous" | "next" | "both" |
Veraltete Eigenschaften
Die in der folgenden Tabelle aufgelisteten Eigenschaften lösen zahlreiche veraltete Eigenschaften (13 von 98, ~13%) ab.
New Property | Deprecated Properties |
---|---|
_align | _tabs-align |
_dataFoot | |
_hide-button | _has-buttons (?) |
_hide-label | _compact, _icon-only |
_label | _alt, _aria-label, _caption, _heading, _headline, _summary, _symbol, _title |
_max | _total |
_row | _size |
_variant | _type* |
_show | _show-dropdown |
_has-footer, _height, _icon-align, _list, _part, _role, _show-duration, _stealth, _selector, _useCase |
* Betrifft nur Typen, die eigentlich Varianten meinen.
Veraltete Komponenten
Mit der initialen Realisierung von KoliBri in Version 1 sind auch ein Paar Komponenten entstanden, die sich im Laufe der Zeit als nicht optimal erwiesen haben. Entweder sind Komponenten nicht gut verortet oder ihre Funktionsweise und Verwendung ist nicht gut. Diese Komponenten werden in Zukunft in Version 2 entweder in andere NPM-Pakete umziehen oder nicht mehr weiterentwickelt und sollten daher nicht mehr direkt aus KoliBri / Public-UI verwendet werden.
New Component | Deprecated Components |
---|---|
avatar | |
toolbar | |
tree | |
list | |
button-group, icon-font-awesome, icon-icofont, input-radio-group, link-group, symbol |
* Betrifft nur Typen, die eigentlich Varianten meinen.
Weiter bestehende Komponenten
ButtonGroup
wird durch die Umsetzung derToolbar
-Komponente abgelöstLinkGroup
wird durch die Umsetzung derList
-Komponente abgelöstLogo
zieht in ein Bund-spezifisches Repository und NPM-Paket auf OpenCoDE um
Entfallende Komponenten
Alle anderen Komponenten werden mit der Version 2 ersatzlos gestrichen. Sie sind nicht mehr in der Dokumentation zu finden und werden auch nicht mehr über KoliBri / Public-UI verfügbar sein.