Create a styled button element. Args: style: One of "", "primary", "success", "warning", "error", "secondary".
(container, id, label, style="", disabled=False)
| 218 | |
| 219 | |
| 220 | def button(container, id, label, style="", disabled=False): |
| 221 | """Create a styled button element. |
| 222 | |
| 223 | Args: |
| 224 | style: One of "", "primary", "success", "warning", "error", "secondary". |
| 225 | """ |
| 226 | btn = container.append_child("button") |
| 227 | btn.set_id(id) |
| 228 | classes = "btn" |
| 229 | if style: |
| 230 | classes += f" btn--{style}" |
| 231 | btn.set_class_names(classes) |
| 232 | btn.set_text(label) |
| 233 | if disabled: |
| 234 | btn.set_attribute("disabled", "disabled") |
| 235 | return btn |
| 236 | |
| 237 | |
| 238 | def aligned_property_row(container, label="", control_classes="setting-row__control-col"): |
no test coverage detected