Btn#
Overview#
Btn is custom widget to provide easy to use button in the pysepal framework. it inherits from the SepalWidget class.
Any argument from the original Btn ipyvuetify class can be used to complement it. The button icon needs to be searched in the fontAwesome library or mdi library <https://materialdesignicons.com>`_, if none is set, a fa-solid fa-check will be used.
The default color is set to “primary”.
from pysepal import sepalwidgets as sw
# correct colors for the documentation
# set to dark in SEPAL by default
import ipyvuetify as v
v.theme.dark = False
btn = sw.Btn(
msg = "The One btn",
gliph = "fa-solid fa-cogs"
)
btn
/home/docs/checkouts/readthedocs.org/user_builds/sepal-ui/envs/latest/lib/python3.10/site-packages/google/api_core/_python_version_support.py:273: FutureWarning: You are using a Python version (3.10.19) which Google will stop supporting in new releases of google.api_core once it reaches its end of life (2026-10-04). Please upgrade to the latest Python version, or at least Python 3.11, to continue receiving updates for google.api_core past that date. warnings.warn(message, FutureWarning)
Methods#
Btn can be used to launch function on any Javascript event such as “click”.
from pysepal import sepalwidgets as sw
# correct colors for the documentation
# set to dark in SEPAL by default
import ipyvuetify as v
v.theme.dark = False
btn = sw.Btn(
msg = "The One btn",
gliph = "fa-solid fa-cogs"
)
btn.on_event('click', lambda *args: print('Hello world!'))
btn
Note
More information can be found here.