Select
The ty-select
component allows users to drop down a list of options and choose one. It's an essential component for collecting user input in forms, settings pages, or any scenario where a list of options is available.
Usage
Here's how you can use the ty-select
component in your HTML code:
Live Editor
<ty-select placeholder="Choose an option"> <ty-option value="option1" label="Option 1"></ty-option> <ty-option value="option2" label="Option 2"></ty-option> </ty-select>
Result
Loading...
API
The ty-select
component accepts the following properties:
Properties
Name | Description | Type | Default |
---|---|---|---|
placeholder | Placeholder text | String | '' |
value | Value of the selected option | String | '' |
label | label of the selected option | String | '' |
disabled | Disable the select component | Boolean | false |
Events
Name | Description | Detail |
---|---|---|
ty-change | Fires when the select changes | { value: string, label: string } |