Source code for dazzler.components.core._button

"""Autogenerated file: DO NOT EDIT!"""
import typing  # noqa: F401
from dazzler.system import Component, Aspect, UNDEFINED  # noqa: F401


[docs]class Button(Component): """ A button to click on! :CSS: - ``dazzler-core-button`` - ``bordered`` - ``rounded`` - ``circle`` - ``primary`` - ``danger`` - ``warning`` - ``success`` - ``tiny`` - ``small`` - ``medium`` - ``large`` - ``x-large`` - ``xx-large`` :example: .. literalinclude:: ../../tests/components/pages/button.py :lines: 5-19 """ label = Aspect(required=True, docstring="Text or component to display.") clicks = Aspect(default=0, docstring="The number of times the button was clicked. (default=0)") # noqa: E501 id = Aspect(docstring="DOM id, otherwise the identity is used.") preset = Aspect(docstring="Preset style colors to apply. (Possible values: 'primary', 'primary-light', 'primary-dark', 'secondary', 'secondary-light', 'secondary-dark', 'tertiary', 'tertiary-light', 'tertiary-dark', 'danger', 'danger-light', 'danger-dark', 'warning', 'warning-light', 'warning-dark', 'success', 'success-light', 'success-dark', 'neutral', 'neutral-light', 'neutral-dark', 'dark', 'dark-light', 'dark-dark', 'darker', 'darker-light', 'darker-dark')") # noqa: E501 disabled = Aspect(docstring="Disable the button.") rounded = Aspect(docstring="Round the edges.") circle = Aspect(docstring="Circle button") bordered = Aspect(default=True, docstring="Add a border around the button. (default=True)") # noqa: E501 size = Aspect(docstring="The size of the button. (Possible values: 'tiny', 'small', 'medium', 'large', 'larger', 'x-large', 'xx-large')") # noqa: E501 class_name = Aspect(docstring="Class name automatically added by dazzler api with a prefix for the component library.ie: core component Container become ``dazzler-core-container``.When added on the component, the class names will be concatenated.") # noqa: E501 style = Aspect(docstring="Style object for the top level wrapper of the component.") # noqa: E501
[docs] def __init__( self, label: typing.Any, clicks: typing.Optional[typing.Union[float, int]] = 0, id: typing.Optional[str] = UNDEFINED, preset: typing.Optional[typing.Any] = UNDEFINED, disabled: typing.Optional[bool] = UNDEFINED, rounded: typing.Optional[bool] = UNDEFINED, circle: typing.Optional[bool] = UNDEFINED, bordered: typing.Optional[bool] = True, size: typing.Optional[typing.Any] = UNDEFINED, class_name: typing.Optional[str] = UNDEFINED, style: typing.Optional[typing.Dict] = UNDEFINED, identity: str = None ): """ :param label: Text or component to display. :param clicks: The number of times the button was clicked. (default=0) :param id: DOM id, otherwise the identity is used. :param preset: Preset style colors to apply. (Possible values: 'primary', 'primary-light', 'primary-dark', 'secondary', 'secondary-light', 'secondary-dark', 'tertiary', 'tertiary-light', 'tertiary-dark', 'danger', 'danger-light', 'danger-dark', 'warning', 'warning-light', 'warning-dark', 'success', 'success- light', 'success-dark', 'neutral', 'neutral-light', 'neutral-dark', 'dark', 'dark-light', 'dark-dark', 'darker', 'darker-light', 'darker-dark') :param disabled: Disable the button. :param rounded: Round the edges. :param circle: Circle button :param bordered: Add a border around the button. (default=True) :param size: The size of the button. (Possible values: 'tiny', 'small', 'medium', 'large', 'larger', 'x-large', 'xx-large') :param class_name: Class name automatically added by dazzler api with a prefix for the component library. ie: core component Container become ``dazzler-core-container``. When added on the component, the class names will be concatenated. :param style: Style object for the top level wrapper of the component. """ Component.__init__(self, locals(), identity)