General
Connecting library and basic template
Connect library by calling the extension:
\Bitrix\Main\UI\Extension::load("ui.forms");
Basic template
<div class="ui-ctl ui-ctl-textbox ui-ctl-before-icon ui-ctl-after-icon"> <!-- 1. Main container --> <div class="ui-ctl-before ui-ctl-icon-search"></div> <!-- 3. Additional element (optional)--> <button class="ui-ctl-after ui-ctl-icon-clear"></button> <!-- 3. Additional element (optional)--> <input type="text" class="ui-ctl-element"> <!-- 2. Main field --> </div>
- Main element - required element. Has the basic class
.ui-ctl
that defines basic properties for a full control. Specifically this element has all classes-modifiers assigned. - Main field - required element. Directly the control itself. Always has a single class
.ui-ctl-element
, but can be a different tag (<input>
,<select>
,<textarea>
or<div>
). - Additional elements - optional elements. Intended for displaying icons inside a field. Can be not less that 2 pcs., but specifically with different classes. More details on these elements.
When fields can be customized by its draft, use the class modifier at .ui-ctl
.
Attention! Redefining styles without custom class is prohibited!
By default, fields have a basic height as 39px and width 320px. For some fields these values can differ. You can find more details in a [link=12561984]individual field description.
Dimensions and layout
inline-flex / flex
One of default properties .ui-ctl
is display: flex
. Subsequently, this field works as block element, but stretches out to the basic width of the complete type. Width can be re-defined and reset. Find more details here.
Modifier .ui-ctl-inline
- changes property display
to inline-flex
, with properties similar to display: inline-block
, i. e. the field starts to behave as block inline element.
Modifier | Code |
---|---|
Modifier |
<!-- .ui-ctl.ui-ctl-textbox.ui-ctl-inline > input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox ui-ctl-inline"> <input type="text" class="ui-ctl-element"> </div> |
When property must be reversed, you can use the modifier .ui-ctl-block . | |
Modifier |
<!-- .ui-ctl.ui-ctl-textbox.ui-ctl-block > input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox ui-ctl-block"> <input type="text" class="ui-ctl-element"> </div> |
Field width
Width modifiers re-define basic values.
Modifier | Code |
---|---|
Modifier |
<!-- .ui-ctl.ui-ctl-textbox.ui-ctl-w25 > input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox ui-ctl-w25"> <input type="text" class="ui-ctl-element"> |
Modifier |
<!-- .ui-ctl.ui-ctl-textbox.ui-ctl-w33 > input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox ui-ctl-w33"> <input type="text" class="ui-ctl-element"> |
Modifier |
<!-- .ui-ctl.ui-ctl-textbox.ui-ctl-w50 > input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox ui-ctl-w50"> <input type="text" class="ui-ctl-element"> |
Modifier |
<!-- .ui-ctl.ui-ctl-textbox.ui-ctl-w75 > input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox ui-ctl-w75"> <input type="text" class="ui-ctl-element"> |
Modifier |
<!-- .ui-ctl.ui-ctl-textbox.ui-ctl-w100 > input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox ui-ctl-w100"> <input type="text" class="ui-ctl-element"> |
Modifier |
<!-- .ui-ctl.ui-ctl-textbox.ui-ctl-wa > input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox ui-ctl-wa"> <input type="text" class="ui-ctl-element"> |
Modifier |
<!-- .ui-ctl.ui-ctl-textbox.ui-ctl-wd > input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox ui-ctl-wd"> <input type="text" class="ui-ctl-element"> |
Field height
Modifier | Code |
---|---|
Modifier |
<!-- .ui-ctl.ui-ctl-textbox.ui-ctl-lg > input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox ui-ctl-lg"> <input type="text" class="ui-ctl-element"> |
Modifier |
<!-- .ui-ctl.ui-ctl-textbox.ui-ctl-md > input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox ui-ctl-md"> <input type="text" class="ui-ctl-element"> |
Modifier |
<!-- .ui-ctl.ui-ctl-textbox.ui-ctl-sm > input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox ui-ctl-sm"> <input type="text" class="ui-ctl-element"> |
Modifier |
<!-- .ui-ctl.ui-ctl-textbox.ui-ctl-xs > input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox ui-ctl-xs"> <input type="text" class="ui-ctl-element"> |
Color
Modifier | Code |
---|---|
Modifiers |
<!-- .ui-ctl.ui-ctl-textbox.ui-ctl-active > input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox ui-ctl-active"> <input type="text" class="ui-ctl-element"> |
Modifier |
<!-- .ui-ctl.ui-ctl-textbox.ui-ctl-success > input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox ui-ctl-success"> <input type="text" class="ui-ctl-element"> |
Modifier |
<!-- .ui-ctl.ui-ctl-textbox.ui-ctl-warning > input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox ui-ctl-warning"> <input type="text" class="ui-ctl-element"> |
Modifier |
<!-- .ui-ctl.ui-ctl-textbox.ui-ctl-danger > input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox ui-ctl-danger"> <input type="text" class="ui-ctl-element"> |
Modifier |
<!-- .ui-ctl.ui-ctl-textbox.ui-ctl-disabled > input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox ui-ctl-disabled"> <input type="text" class="ui-ctl-element"> <!-- .ui-ctl-container > input.ui-ctl-element[disabled] --> <div class="ui-ctl ui-ctl-textbox"> <input type="text" class="ui-ctl-element" disabled> </div> |
Modifier changes only field layout. To block possibility of data input, add .ui-element attribute to disabled . This attribute is independent, it can be used without class, with field's layout will change as well. |
Tags
Modifier | Code |
---|---|
Element new
|
<!-- .ui-ctl.ui-ctl-textbox > .ui-ctl-tag{text} + input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox"> <div class="ui-ctl-tag">new</div> <input type="text" class="ui-ctl-element"> </div> |
Modifier new
|
<!-- .ui-ctl.ui-ctl-textbox > .ui-ctl-tag-success{text} + input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox"> <div class="ui-ctl-tag-success">new</div> <input type="text" class="ui-ctl-element"> </div> |
Modifier new
|
<!-- .ui-ctl.ui-ctl-textbox > .ui-ctl-tag-primary{text} + input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox"> <div class="ui-ctl-tag-primary">new</div> <input type="text" class="ui-ctl-element"> </div> |
Модификатор new
|
<!-- .ui-ctl.ui-ctl-textbox > .ui-ctl-tag-danger{text} + input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox"> <div class="ui-ctl-tag-danger">new</div> <input type="text" class="ui-ctl-element"> </div> |
Modifier new
|
<!-- .ui-ctl.ui-ctl-textbox > .ui-ctl-tag-warning{text} + input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox"> <div class="ui-ctl-tag-warning">new</div> <input type="text" class="ui-ctl-element"> </div> |
Additional field properties
Modifier | Code |
---|---|
Modifier |
<!-- .ui-ctl.ui-ctl-textbox.ui-ctl-no-border > input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox ui-ctl-no-border"> <input type="text" class="ui-ctl-element"> </div> |
Modifier |
<!-- .ui-ctl.ui-ctl-textbox.ui-ctl-underline > input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox ui-ctl-underline"> <input type="text" class="ui-ctl-element"> </div> |
Modifier |
<!-- .ui-ctl.ui-ctl-textbox.ui-ctl-no-padding > input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox ui-ctl-no-padding"> <input type="text" class="ui-ctl-element"> </div> |
Modifier |
<!-- .ui-ctl.ui-ctl-textbox.ui-ctl-round > input.ui-ctl-element --> <div class="ui-ctl ui-ctl-textbox ui-ctl-round"> <input type="text" class="ui-ctl-element"> </div> |