Your users can now enter their name and clicking the say hi button displays the alert: Now you can click run to test your app and it's interface. In your Button's click method, you can call Anvil's alert function to display an alert that says hello to your users:Ĭonfiguring a click event for the 'Say Hi' button
We can create a Python method in the Code View to be called when this happens. For example, when a user of your app clicks a Button component it raises a click event. This includes both the information the component displays and its styling:Ĭhanging the properties of the Label and Button componentsĮvery component is a Python object, so you can also set the component's properties in the Form Editor's Code View:Īll components have events they can raise. To configure components, you can edit their properties on the right hand side in the Properties Panel. This hello world app will also need a TextBox for users to enter their name: You can drag and drop components, like Labels, from the toolbox to build your user interface.
On the right of the Anvil editor you will find the Toolbox. In the middle of the Anvil IDE is the Form Editor which is split into the Design View and the Code View. Let's look at how you can use the Anvil editor to create a user interface by turning this app into a "hello world" app that says hello to your users. You can build your UI by dragging and dropping components in Anvil's visual designer or by adding components using Python code: Anvil lets you build your app’s front-end entirely in Python - no HTML, CSS or Javascript required.