In
computing
Computing is any goal-oriented activity requiring, benefiting from, or creating computer, computing machinery. It includes the study and experimentation of algorithmic processes, and the development of both computer hardware, hardware and softw ...
, a button (sometimes known as a command button or push button) is a
graphical control element that provides the user a simple way to trigger an
event, like searching for a query at a
search engine
A search engine is a software system that provides hyperlinks to web pages, and other relevant information on World Wide Web, the Web in response to a user's web query, query. The user enters a query in a web browser or a mobile app, and the sea ...
, or to interact with
dialog box
In computing, a dialog box (also simply dialog) is a graphical control element in the form of a small window that communicates information to the user and prompts them for a response.
Dialog boxes are classified as " modal" or "modeless", dep ...
es, like confirming an action.
Overview
A typical button is a rectangle or rounded rectangle, wider than it is tall, with a descriptive caption in its center. Other buttons may be square or round, with simple
icons.
The most common method of pressing a button is clicking it with a
pointer controlled by a
mouse
A mouse (: mice) is a small rodent. Characteristically, mice are known to have a pointed snout, small rounded ears, a body-length scaly tail, and a high breeding rate. The best known mouse species is the common house mouse (''Mus musculus'' ...
, or a
touchpad
A touchpad or trackpad is a type of pointing device. Its largest component is a tactile sensor: an electronic device with a flat surface, that detects the motion and position of a user's fingers, and translates them to 2D motion, to control a Cu ...
, but other input such as keystroke can be used to execute the command of a button. However, a button is not always restricted to a rectangular shape.
The sole requirement of button interaction is that the user can execute a command by a
click action. Thus, pictures and background areas can be programmed as buttons. When pressed, in addition to performing a predetermined task, buttons often undergo a graphical change to mimic a mechanical button being depressed.
Depending on the circumstance, buttons may be designated to be pushed only once and execute a command, while others may be used to receive instant feed back and may require the user to click more than once to receive the desired result. Other buttons are designed to toggle behavior on and off like a
check box.
checkState button attribute
in Mozilla
Mozilla is a free software community founded in 1998 by members of Netscape. The Mozilla community uses, develops, publishes and supports Mozilla products, thereby promoting free software and open standards. The community is supported institution ...
's XUL These buttons will show a graphical clue (such as staying depressed after the mouse is released) to indicate the state of the option. Such a button may be called a latch button or a latching switch.
A button often displays a tooltip
The tooltip, also known as infotip or hint, is a common graphical user interface (GUI) element in which, when hoverbox, hovering over a screen element or component, a text box displays information about that element, such as a description of a ...
when a user moves the pointer over it, especially if the button's content is a standalone icon. The tooltip serves as built-in documentation that briefly explains the purpose of the button. If you hover your mouse over the blue window button below (without clicking it or moving your mouse), it will display a text saying "Window (computing)."
Some very common incarnations of the button widget are:
* An ''OK button'' for confirming actions and closing the windows
* A ''Cancel button'' for canceling actions and closing the window
A window is an opening in a wall, door, roof, or vehicle that allows the exchange of light and may also allow the passage of sound and sometimes air. Modern windows are usually glazed or covered in some other transparent or translucent ma ...
* An ''Apply button'' for confirming actions without closing the window
* A ''Close button'' for closing windows after changes have already been applied
Appearance
macOS
Buttons in macOS
macOS, previously OS X and originally Mac OS X, is a Unix, Unix-based operating system developed and marketed by Apple Inc., Apple since 2001. It is the current operating system for Apple's Mac (computer), Mac computers. With ...
's Aqua interface are usually depicted as rounded-rectangles of crystallized glass. Normally these buttons are light grey in color and turn blue when pressed. The button with keyboard focus (selectable with the spacebar) appears with a blue glow surrounding it. The default button in an active window (selectable with the return key) animates between a bright blue and a darker blue (the same color as a pressed button).
Also used, primarily within application toolbars, are slightly rounded rectangles with a light grey metallic appearance. These buttons appear darker and "pushed inward" when pressed.
Window management controls appear in the top left corner of each window. These buttons are similar in style to standard aqua buttons, but are color-coded as a memory aid. From left to right, these are: "Close Window", shown in red; "Minimize Window", shown in yellow; and "Zoom", shown in green, which causes the window to resize to best fit its contents.
Windows shell
Buttons in Microsoft Windows
Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
are usually rectangular, with mildly rounded corners in Windows XP
Windows XP is a major release of Microsoft's Windows NT operating system. It was released to manufacturing on August 24, 2001, and later to retail on October 25, 2001. It is a direct successor to Windows 2000 for high-end and business users a ...
, Vista, and 7, in Windows 11
Windows 11 is a version of Microsoft's Windows NT operating system, released on October 5, 2021, as the successor to Windows 10 (2015). It is available as a free upgrade for devices running Windows 10 that meet the #System requirements, Windo ...
. In Windows 8
Windows 8 is a major release of the Windows NT operating system developed by Microsoft. It was Software release life cycle#Release to manufacturing (RTM), released to manufacturing on August 1, 2012, made available for download via Microsoft ...
, the buttons are rectangular with sharp corners. A button with active focus is shown with a black dotted line just inside the border of the button. In addition, more recent versions, the default button is shown with a blue border. In Windows Vista
Windows Vista is a major release of the Windows NT operating system developed by Microsoft. It was the direct successor to Windows XP, released five years earlier, which was then the longest time span between successive releases of Microsoft W ...
and Windows 7
Windows 7 is a major release of the Windows NT operating system developed by Microsoft. It was Software release life cycle#Release to manufacturing (RTM), released to manufacturing on July 22, 2009, and became generally available on October 22, ...
, the default button will slowly fade between its normal appearance and the blue border. Window management controls are in the upper right-hand corner of the application window, and, from left to right: "minimize" the window (causing it to disappear into the taskbar
The taskbar is a graphical user interface element that has been part of Microsoft Windows since Windows 95, displaying and facilitating switching between running computer program, programs. The taskbar and the associated Start menu, Start Menu were ...
at the bottom of the screen); ''maximize'' the window (causing it to expand to cover the whole screen; if the window is already maximized, the button will restore it to its previous size and position); and close the window.
Linux and other Unix-like systems
The appearance and behavior of buttons in Linux
Linux ( ) is a family of open source Unix-like operating systems based on the Linux kernel, an kernel (operating system), operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically package manager, pac ...
and other Unix-like operating systems is defined primarily by which widget toolkit
A widget toolkit, widget library, GUI toolkit, or UX library is a library (computing), library or a collection of libraries containing a set of graphical control elements (called ''widgets'') used to construct the graphical user interface (GUI) of ...
is being employed, the most popular being GTK
GTK (formerly GIMP ToolKit and GTK+) is a free software cross-platform widget toolkit for creating graphical user interfaces (GUIs). It is licensed under the terms of the GNU Lesser General Public License, allowing both Free software, free and ...
and Qt, though other toolkits are used as well. The use of multiple toolkits can lead to less uniform look and feel
In software design, the look and feel of a graphical user interface comprises aspects of its design, including elements such as colors, shapes, layout, and typefaces (the "look"), as well as the behavior of dynamic elements such as buttons, boxes ...
across applications. Most widget toolkits also have theming capabilities, so there is no single standard appearance as there is with Mac OS
Mac operating systems were developed by Apple Inc. in a succession of two major series.
In 1984, Apple debuted the operating system that is now known as the classic Mac OS with its release of the original Macintosh System Software. The system ...
and Windows
Windows is a Product lining, product line of Proprietary software, proprietary graphical user interface, graphical operating systems developed and marketed by Microsoft. It is grouped into families and subfamilies that cater to particular sec ...
.
HTML
Buttons appear as elements of HTML forms to carry out actions such as clearing user input or submitting the form contents to the server. Buttons specified in HTML may be rendered by web browser
A web browser, often shortened to browser, is an application for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's scr ...
s in different ways, typically either using the native button appearance of the underlying OS, or by using a button definition from within the browser. Buttons may also be styled by the developer of the web site
A website (also written as a web site) is any web page whose content is identified by a common domain name and is published on at least one web server. Websites are typically dedicated to a particular topic or purpose, such as news, education, ...
the form appears on by using cascading style sheets.
HTML links are sometimes represented by a graphic closely resembling a button. Sometimes this type of link is used in advertisements to induce the user to click the ad and visit the advertiser's site.
References
{{DEFAULTSORT:Button (Computing)
Graphical control elements