An advanced dropdown component for selecting options efficiently.
The JTB-Select is an advanced dropdown component designed to simplify the selection of options in forms and interfaces. With support for customizable styles, it enhances user experience by making option selection intuitive and efficient.
Its flexible structure allows seamless integration with various data sources and customization options, ensuring that the JTB-Select fits naturally into any web application layout.
To create a JTB-Select element in your projects, use the <jtb-select>
tag in the way that suits your needs. Whether you add elements dynamically with JavaScript, directly in HTML, or through server-side languages like PHP, it doesn’t matter. As long as the component is correctly initialized, JTB_MD will handle the request of yours and render the element as specified.
You can customize the JTB-Select element by applying one (or more) of its pre-defined attributes with the corresponding values. These attributes allow you to tailor the element to meet your specific requirements and preferences via modifying its behavior, functionality, appearance, design etc.
To specify the options that you want to display in the select box you can simply provide them as a json-array in the options
attribute of element.
For the content of element, use content
attribute, for the value use value
To specify an option as selected by default you can add selected
attribute to its object with value true
If you want to specify a placeholder, use the element's placeholder
attribute.
For specifying a name to your select element, you can use name
attribute of JTB-select.
To create an element with pre-define value, you can use value
attribute of it.
If you want to disable an element, you can append disabled
attribute into it.
To add a label to your JTB-select element, simply include the label
attribute with the desired text. This will display the text as a label for the select field.
Helper texts provide users with guidance while entering select. To create a helper text, simply specify it using the helper
attribute in your JTB-Select element.
To use an icon in your select element, simply set the icon
attribute with the identifier of your desired icon.
By default, the icon template is set to: <i class='{icon}'></i>
where {icon}
serves as a placeholder that will be replaced by the value of the icon attribute.
Instead of using the default template, you can also specify your own custom template to generate icons exactly the way you want. Simply define your desired structure using the icon_template
attribute, where {icon}
will be replaced by the value of the icon attribute.
To make your select element required for form submission, you can use required
attribute of JTB-select.
To customize the color palette of select boxes, use the color
attribute to specify your preferred palette.
Available options are: purple | blue | aqua | green | lime | yellow | orange | volcano | red
.
To adjust the size of the select element, use the size
attribute to specify your desired value.
Available options are: xs | sm | md | lg | xl
.
To change the shape of the select element, use the shape
attribute with your desired value.
Available options are: default | rect | pill
.
JTB select elements inherit all global listeners and callbacks from the base component, ensuring seamless handling for lifecycle events. For a detailed overview of inherited listeners and callbacks, refer to the Base component - Core page.
Additionally, JTB selects has its own listeners and callbacks:
Triggered when the component’s value is modified and the change is finalized. This event is useful for tracking user select, updating related elements, or triggering form submissions.
Similar to listeners and callbacks, JTB selects also inherit all methods from the base component, enabling seamless functionality. For a complete list of available methods, visit the Base component - Core page.
While each property on its own brings unique changes to the elements, combining them can help you create the perfect one.
For making it easier to navigate through all the attributes, we’ve created a comprehensive table for you. Below, you can find a list of all and their uses.
Copyright © 2025 JTBLabs - All rights reserved.